Interfaces functioning in autonomous mode now eject items left over, such as buckets.

This commit is contained in:
AlgorithmX2
2014-08-20 12:07:25 -05:00
parent fd49074ea4
commit 0c74b0fe0f
+12 -5
View File
@@ -386,6 +386,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn
pushOut( inv.getStackInSlot( 9 ) ); pushOut( inv.getStackInSlot( 9 ) );
ejectHeldItems(); ejectHeldItems();
updateSleepyness(); updateSleepyness();
progress = 0;
return isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP; return isAwake ? TickRateModulation.IDLE : TickRateModulation.SLEEP;
} }
@@ -398,6 +399,9 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn
if ( reboot ) if ( reboot )
TicksSinceLastCall = 1; TicksSinceLastCall = 1;
if ( ! isAwake )
return TickRateModulation.SLEEP;
reboot = false; reboot = false;
int speed = 10; int speed = 10;
switch (upgrades.getInstalledUpgrades( Upgrades.SPEED )) switch (upgrades.getInstalledUpgrades( Upgrades.SPEED ))
@@ -468,17 +472,20 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn
private void ejectHeldItems() private void ejectHeldItems()
{ {
if ( myPlan == null && inv.getStackInSlot( 9 ) == null ) if ( inv.getStackInSlot( 9 ) == null )
{ {
for (int x = 0; x < 9; x++) for (int x = 0; x < 9; x++)
{ {
ItemStack is = inv.getStackInSlot( x ); ItemStack is = inv.getStackInSlot( x );
if ( is != null ) if ( is != null )
{ {
inv.setInventorySlotContents( 9, is ); if ( myPlan == null || ! myPlan.isValidItemForSlot( x, is, worldObj ) )
inv.setInventorySlotContents( x, null ); {
markDirty(); inv.setInventorySlotContents( 9, is );
return; inv.setInventorySlotContents( x, null );
markDirty();
return;
}
} }
} }
} }