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

@ -40,7 +40,7 @@ public class FZ implements IFZ, IIntegrationModule
if ( i != null )
i = Platform.cloneItemStack( i );
return i;
}
catch (IllegalArgumentException e)
@ -99,8 +99,6 @@ public class FZ implements IFZ, IIntegrationModule
{
if ( day_BarrelClass.isInstance( te ) )
day_item.set( te, input == null ? null : input.copy() );
te.markDirty();
}
catch (IllegalArgumentException e)
{
@ -168,7 +166,11 @@ public class FZ implements IFZ, IIntegrationModule
{
Class c = Class.forName( "factorization.oreprocessing.TileEntityGrinder" );
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)
{

View file

@ -38,9 +38,15 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
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()
@ -66,7 +72,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
fProxy.setItemType( te, input.getItemStack() );
}
if ( containsItemType( input ) )
if ( containsItemType( input, mode == Actionable.SIMULATE ) )
{
int max = fProxy.barrelGetMaxItemCount( te );
int newTotal = (int) storedItemCount() + (int) input.getStackSize();
@ -92,7 +98,7 @@ public class FactorizationBarrel implements IMEInventory<IAEItemStack>
@Override
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
{
if ( containsItemType( request ) )
if ( containsItemType( request, false ) )
{
int howMany = (int) storedItemCount();
if ( request.getStackSize() >= howMany )