From 43beaea742d59612d4ae586bb95c8ee0419d64aa Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Tue, 18 Mar 2014 21:55:49 -0500 Subject: [PATCH] FZ Integration Re-Added. --- integration/modules/FZ.java | 10 ++++++---- .../modules/helpers/FactorizationBarrel.java | 14 ++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/integration/modules/FZ.java b/integration/modules/FZ.java index 368cfae0..3fe52491 100644 --- a/integration/modules/FZ.java +++ b/integration/modules/FZ.java @@ -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) { diff --git a/integration/modules/helpers/FactorizationBarrel.java b/integration/modules/helpers/FactorizationBarrel.java index 11a2fda7..c77d513b 100644 --- a/integration/modules/helpers/FactorizationBarrel.java +++ b/integration/modules/helpers/FactorizationBarrel.java @@ -38,9 +38,15 @@ public class FactorizationBarrel implements IMEInventory 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 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 @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 )