Fixed client sync failing when a machine finishes running.

This commit is contained in:
CrazyPants committed 2014-06-12 19:20:37 +08:00
1 parent 2b30f4c542
commit 40f4b1fb57
2 files changed
+10 -13

No files matched your search

@@ -18,7 +18,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
protected final Random random = new Random();
protected int ticksSinceCheckedRecipe = 0;
protected boolean startFailed = false;
protected boolean startFailed = false;
protected int lastProgressScaled = -1;
@@ -78,8 +78,8 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
@Override
protected boolean processTasks(boolean redstoneChecksPassed) {
if(!redstoneChecksPassed) {
if(!redstoneChecksPassed) {
return false;
}
@@ -104,15 +104,14 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
IMachineRecipe nextRecipe = canStartNextTask(chance);
if(nextRecipe != null) {
boolean started = startNextTask(nextRecipe, chance);
startFailed = !started;
//requiresClientSync |= started;
if(started) {
PacketHandler.sendToAllAround(new PacketCurrentTask(this), this);
if(started != startFailed) {
PacketHandler.sendToAllAround(new PacketCurrentTask(this), this);
}
startFailed = !started;
} else {
startFailed = true;
}
return requiresClientSync;
}
@@ -18,13 +18,11 @@ public class PacketHandler
return ID++;
}
public static void sendToAllAround(IMessage message, TileEntity te, int range)
{
public static void sendToAllAround(IMessage message, TileEntity te, int range) {
INSTANCE.sendToAllAround(message, new TargetPoint(te.getWorldObj().provider.dimensionId, te.xCoord, te.yCoord, te.zCoord, range));
}
public static void sendToAllAround(IMessage message, TileEntity te)
{
sendToAllAround(message, te, 16);
public static void sendToAllAround(IMessage message, TileEntity te) {
sendToAllAround(message, te, 64);
}
}