Fix legacy Gate code on the Pipe

Why does NO ONE ever test builds on old worlds? Compatibility between MC
versions is a huge priority!
This commit is contained in:
CovertJaguar 2013-07-27 19:23:50 -07:00
parent 54677904f0
commit a3565c71c6

View file

@ -185,14 +185,16 @@ public abstract class Pipe<T extends PipeTransport> implements IPipe, IDropContr
}
// Legacy update code
for (int i = 0; i < 8; ++i) {
if (data.hasKey("trigger[" + i + "]"))
gate.triggers[i] = ActionManager.getTriggerFromLegacyId(data.getInteger("trigger[" + i + "]"));
if (data.hasKey("action[" + i + "]"))
gate.actions[i] = ActionManager.getActionFromLegacyId(data.getInteger("action[" + i + "]"));
if (data.hasKey("triggerParameters[" + i + "]")) {
gate.triggerParameters[i] = new TriggerParameter();
gate.triggerParameters[i].readFromNBT(data.getCompoundTag("triggerParameters[" + i + "]"));
if (hasGate()) {
for (int i = 0; i < 8; ++i) {
if (data.hasKey("trigger[" + i + "]"))
gate.triggers[i] = ActionManager.getTriggerFromLegacyId(data.getInteger("trigger[" + i + "]"));
if (data.hasKey("action[" + i + "]"))
gate.actions[i] = ActionManager.getActionFromLegacyId(data.getInteger("action[" + i + "]"));
if (data.hasKey("triggerParameters[" + i + "]")) {
gate.triggerParameters[i] = new TriggerParameter();
gate.triggerParameters[i].readFromNBT(data.getCompoundTag("triggerParameters[" + i + "]"));
}
}
}
}