diff --git a/src/main/java/storagecraft/tile/TileConstructor.java b/src/main/java/storagecraft/tile/TileConstructor.java index 1dd6fdbba..77ac8e420 100644 --- a/src/main/java/storagecraft/tile/TileConstructor.java +++ b/src/main/java/storagecraft/tile/TileConstructor.java @@ -28,17 +28,20 @@ public class TileConstructor extends TileMachine implements IInventory, ISidedIn @Override public void updateMachine() { - int frontX = xCoord + getDirection().offsetX; - int frontY = yCoord + getDirection().offsetY; - int frontZ = zCoord + getDirection().offsetZ; - - if (worldObj.getBlock(frontX, frontY, frontZ) == Blocks.air && inventory.getStackInSlot(0) != null) + if (ticks % 10 == 0) { - ItemStack took = getController().take(inventory.getStackInSlot(0).copy(), compare); + int frontX = xCoord + getDirection().offsetX; + int frontY = yCoord + getDirection().offsetY; + int frontZ = zCoord + getDirection().offsetZ; - if (took != null) + if (worldObj.getBlock(frontX, frontY, frontZ) == Blocks.air && inventory.getStackInSlot(0) != null) { - worldObj.setBlock(frontX, frontY, frontZ, ((ItemBlock) took.getItem()).field_150939_a, took.getItemDamage(), 1 | 2); + ItemStack took = getController().take(inventory.getStackInSlot(0).copy(), compare); + + if (took != null) + { + worldObj.setBlock(frontX, frontY, frontZ, ((ItemBlock) took.getItem()).field_150939_a, took.getItemDamage(), 1 | 2); + } } } } diff --git a/src/main/java/storagecraft/tile/TileDestructor.java b/src/main/java/storagecraft/tile/TileDestructor.java index 20981524f..279e574b3 100644 --- a/src/main/java/storagecraft/tile/TileDestructor.java +++ b/src/main/java/storagecraft/tile/TileDestructor.java @@ -17,23 +17,26 @@ public class TileDestructor extends TileMachine @Override public void updateMachine() { - int frontX = xCoord + getDirection().offsetX; - int frontY = yCoord + getDirection().offsetY; - int frontZ = zCoord + getDirection().offsetZ; - - Block front = worldObj.getBlock(frontX, frontY, frontZ); - - if (front != Blocks.air) + if (ticks % 10 == 0) { - List drops = front.getDrops(worldObj, frontX, frontY, frontZ, worldObj.getBlockMetadata(frontX, frontY, frontZ), 0); + int frontX = xCoord + getDirection().offsetX; + int frontY = yCoord + getDirection().offsetY; + int frontZ = zCoord + getDirection().offsetZ; - worldObj.setBlockToAir(frontX, frontY, frontZ); + Block front = worldObj.getBlock(frontX, frontY, frontZ); - for (ItemStack drop : drops) + if (front != Blocks.air) { - if (!getController().push(drop)) + List drops = front.getDrops(worldObj, frontX, frontY, frontZ, worldObj.getBlockMetadata(frontX, frontY, frontZ), 0); + + worldObj.setBlockToAir(frontX, frontY, frontZ); + + for (ItemStack drop : drops) { - InventoryUtils.dropStack(worldObj, drop, frontX, frontY, frontZ); + if (!getController().push(drop)) + { + InventoryUtils.dropStack(worldObj, drop, frontX, frontY, frontZ); + } } } }