From c2cd395ca1f0abdf7b021be94f58b4bde63658dc Mon Sep 17 00:00:00 2001 From: yueh Date: Thu, 23 Apr 2015 15:55:40 +0200 Subject: [PATCH] Fixed interface dropping items into itself Fixes #456 --- src/main/java/appeng/helpers/DualityInterface.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index 8f8479e8..e67f05cc 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -371,7 +371,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return; } } - else // Stored != null; dispose! + else + // Stored != null; dispose! { IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); @@ -507,7 +508,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn return TickRateModulation.SLEEP; if( this.hasItemsToSend() ) - this.pushItemsOut( EnumSet.allOf( ForgeDirection.class ) ); + this.pushItemsOut( this.iHost.getTargets() ); boolean couldDoWork = this.updateStorage(); return this.hasWorkToDo() ? ( couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER ) : TickRateModulation.SLEEP; @@ -734,7 +735,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn this.cancelCrafting(); this.markDirty(); - } @Override + } + + @Override public IMEMonitor getFluidInventory() { if( this.hasConfig() ) @@ -825,7 +828,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn ItemStack is = table.getStackInSlot( x ); if( is != null ) { - this.addToSendList( ad.addItems( is ) ); + final ItemStack added = ad.addItems( is ); + this.addToSendList( added ); } } this.pushItemsOut( possibleDirections ); @@ -1095,7 +1099,6 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - class InterfaceInventory extends MEMonitorIInventory { @@ -1124,5 +1127,4 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - }