Merge pull request #2802 from HenryLoenwind/createTask

Logic fix for reading the current task from nbt
This commit is contained in:
tterrag1098 committed 2015-09-12 01:32:20 -04:00
commit f928709e52
2 files changed
+1 -5

No files matched your search

@@ -363,7 +363,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
@Override
public void readCustomNBT(NBTTagCompound nbtRoot) {
super.readCustomNBT(nbtRoot);
currentTask = createTask(nbtRoot.getCompoundTag("currentTask"));
currentTask = nbtRoot.hasKey("currentTask") ? createTask(nbtRoot.getCompoundTag("currentTask")) : null;
String uid = nbtRoot.getString("lastCompletedRecipe");
lastCompletedRecipe = MachineRecipeRegistry.instance.getRecipeForUid(uid);
}
@@ -147,10 +147,6 @@ public class PoweredTask implements IPoweredTask {
}
public static IPoweredTask readFromNBT(NBTTagCompound nbtRoot) {
if(nbtRoot == null) {
return null;
}
IMachineRecipe recipe;
float usedEnergy = nbtRoot.getFloat(KEY_USED_ENERGY);