Fixed dupe issue with mixer, no longer break but does dead

This commit is contained in:
Robert S 2014-05-12 05:08:38 -04:00
parent 1fe288a396
commit cbe00a617d

View file

@ -34,6 +34,8 @@ public class TileMixer extends TileMechanical implements IInventory
public static final long POWER = 500000; public static final long POWER = 500000;
public static final int PROCESS_TIME = 12 * 20; public static final int PROCESS_TIME = 12 * 20;
public static final Timer<EntityItem> timer = new Timer<EntityItem>(); public static final Timer<EntityItem> timer = new Timer<EntityItem>();
private boolean areaBlockedFromMoving = false;
public TileMixer() public TileMixer()
{ {
@ -60,6 +62,7 @@ public class TileMixer extends TileMechanical implements IInventory
{ {
if (!world().isRemote && ticks % 20 == 0) if (!world().isRemote && ticks % 20 == 0)
{ {
this.areaBlockedFromMoving = false;
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)
{ {
for (int z = -1; z <= 1; z++) for (int z = -1; z <= 1; z++)
@ -71,8 +74,7 @@ public class TileMixer extends TileMechanical implements IInventory
if (block != null && !(block instanceof IFluidBlock) && !(block instanceof BlockFluid)) if (block != null && !(block instanceof IFluidBlock) && !(block instanceof BlockFluid))
{ {
block.dropBlockAsItem(world(), x(), y(), z(), 0, 0); this.areaBlockedFromMoving = true;
position().setBlock(0);
return; return;
} }
} }
@ -95,7 +97,7 @@ public class TileMixer extends TileMechanical implements IInventory
*/ */
public boolean canWork() public boolean canWork()
{ {
return mechanicalNode.getAngularVelocity() != 0; return mechanicalNode.getAngularVelocity() != 0 && areaBlockedFromMoving;
} }
public void doWork() public void doWork()