FZ Integration Re-Added.

This commit is contained in:
AlgorithmX2 2014-03-18 21:55:49 -05:00
parent 9e85c33b16
commit 43beaea742
2 changed files with 16 additions and 8 deletions

View file

@ -99,8 +99,6 @@ public class FZ implements IFZ, IIntegrationModule
{ {
if ( day_BarrelClass.isInstance( te ) ) if ( day_BarrelClass.isInstance( te ) )
day_item.set( te, input == null ? null : input.copy() ); day_item.set( te, input == null ? null : input.copy() );
te.markDirty();
} }
catch (IllegalArgumentException e) catch (IllegalArgumentException e)
{ {
@ -168,7 +166,11 @@ public class FZ implements IFZ, IIntegrationModule
{ {
Class c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" ); Class c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" );
Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class ); Method m = c.getMethod( "addRecipe", Object.class, ItemStack.class, float.class );
m.invoke( c, in, out, 1.0 );
float amt = out.stackSize;
out.stackSize = 1;
m.invoke( c, in, out, amt );
} }
catch (Throwable t) catch (Throwable t)
{ {

View file

@ -38,9 +38,15 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
return fProxy.barrelGetMaxItemCount( te ) - fProxy.barrelGetItemCount( te ); return fProxy.barrelGetMaxItemCount( te ) - fProxy.barrelGetItemCount( te );
} }
public boolean containsItemType(IAEItemStack i) public boolean containsItemType(IAEItemStack i, boolean acceptEmpty)
{ {
return i.equals( fProxy.barrelGetItem( te ) ); ItemStack currentItem = fProxy.barrelGetItem( te );
// empty barrels want your love too!
if ( acceptEmpty && currentItem == null )
return true;
return i.equals( currentItem );
} }
public long storedItemCount() public long storedItemCount()
@ -66,7 +72,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
fProxy.setItemType( te, input.getItemStack() ); fProxy.setItemType( te, input.getItemStack() );
} }
if ( containsItemType( input ) ) if ( containsItemType( input, mode == Actionable.SIMULATE ) )
{ {
int max = fProxy.barrelGetMaxItemCount( te ); int max = fProxy.barrelGetMaxItemCount( te );
int newTotal = (int) storedItemCount() + (int) input.getStackSize(); int newTotal = (int) storedItemCount() + (int) input.getStackSize();
@ -92,7 +98,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
@Override @Override
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
{ {
if ( containsItemType( request ) ) if ( containsItemType( request, false ) )
{ {
int howMany = (int) storedItemCount(); int howMany = (int) storedItemCount();
if ( request.getStackSize() >= howMany ) if ( request.getStackSize() >= howMany )