Fixed interface dropping items into itself

Fixes #456
This commit is contained in:
yueh
2015-04-23 15:55:40 +02:00
parent 36c72d641f
commit c2cd395ca1
@@ -371,7 +371,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
return; return;
} }
} }
else // Stored != null; dispose! else
// Stored != null; dispose!
{ {
IAEItemStack work = AEApi.instance().storage().createItemStack( Stored ); IAEItemStack work = AEApi.instance().storage().createItemStack( Stored );
this.requireWork[slot] = work.setStackSize( -work.getStackSize() ); this.requireWork[slot] = work.setStackSize( -work.getStackSize() );
@@ -507,7 +508,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
return TickRateModulation.SLEEP; return TickRateModulation.SLEEP;
if( this.hasItemsToSend() ) if( this.hasItemsToSend() )
this.pushItemsOut( EnumSet.allOf( ForgeDirection.class ) ); this.pushItemsOut( this.iHost.getTargets() );
boolean couldDoWork = this.updateStorage(); boolean couldDoWork = this.updateStorage();
return this.hasWorkToDo() ? ( couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER ) : TickRateModulation.SLEEP; return this.hasWorkToDo() ? ( couldDoWork ? TickRateModulation.URGENT : TickRateModulation.SLOWER ) : TickRateModulation.SLEEP;
@@ -734,7 +735,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
this.cancelCrafting(); this.cancelCrafting();
this.markDirty(); this.markDirty();
} @Override }
@Override
public IMEMonitor<IAEFluidStack> getFluidInventory() public IMEMonitor<IAEFluidStack> getFluidInventory()
{ {
if( this.hasConfig() ) if( this.hasConfig() )
@@ -825,7 +828,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
ItemStack is = table.getStackInSlot( x ); ItemStack is = table.getStackInSlot( x );
if( is != null ) if( is != null )
{ {
this.addToSendList( ad.addItems( is ) ); final ItemStack added = ad.addItems( is );
this.addToSendList( added );
} }
} }
this.pushItemsOut( possibleDirections ); this.pushItemsOut( possibleDirections );
@@ -1095,7 +1099,6 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
} }
} }
class InterfaceInventory extends MEMonitorIInventory class InterfaceInventory extends MEMonitorIInventory
{ {
@@ -1124,5 +1127,4 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
} }
} }
} }