#1213 NPE on inserting ingredients into a Vat

This commit is contained in:
CrazyPants committed 2014-11-09 13:21:55 +08:00
1 parent e7a26793c2
commit 92a0ce8f1c
10 files changed
+157 -61

No files matched your search

@@ -69,6 +69,10 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
return currentTask == null ? 0 : currentTask.getProgress();
}
public IPoweredTask getCurrentTask() {
return currentTask;
}
public float getExperienceForOutput(ItemStack output) {
if(lastCompletedRecipe == null) {
return 0;
@@ -108,7 +112,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
IMachineRecipe nextRecipe = canStartNextTask(chance);
if(nextRecipe != null) {
boolean started = startNextTask(nextRecipe, chance);
PacketHandler.sendToAllAround(new PacketCurrentTask(this), this);
sendTaskProgressPacket();
startFailed = !started;
} else {
startFailed = true;
@@ -117,6 +121,10 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
return requiresClientSync;
}
protected void sendTaskProgressPacket() {
PacketHandler.sendToAllAround(new PacketCurrentTaskProgress(this), this);
}
protected boolean checkProgress(boolean redstoneChecksPassed) {
if(currentTask == null || !hasPower()) {
return false;
@@ -132,7 +140,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
int curScaled = getProgressScaled(16);
if(curScaled != lastProgressScaled) {
PacketHandler.sendToAllAround(new PacketCurrentTask(this), this);
sendTaskProgressPacket();
lastProgressScaled = curScaled;
}
@@ -164,7 +172,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractMachineEntity {
markDirty();
currentTask = null;
lastProgressScaled = 0;
PacketHandler.sendToAllAround(new PacketCurrentTask(this), this);
sendTaskProgressPacket();
}
protected void mergeResults(ResultStack[] results) {