Merge pull request #2018 from AEnterprise/6.1.x

fix MJ->RF migration with blocks that where already in the world
This commit is contained in:
SpaceToad 2014-09-14 15:25:34 +01:00
commit 2e76b90191

View file

@ -14,10 +14,12 @@ public class RFBattery implements IEnergyStorage {
}
public void readFromNBT(NBTTagCompound tag) {
this.energy = tag.getInteger("energy");
this.maxEnergy = tag.getInteger("maxEnergy");
this.maxReceive = tag.getInteger("maxReceive");
this.maxExtract = tag.getInteger("maxExtract");
if (tag.hasKey("energy") && tag.hasKey("maxEnergy") && tag.hasKey("maxReceive") && tag.hasKey("maxExtract")) {
this.energy = tag.getInteger("energy");
this.maxEnergy = tag.getInteger("maxEnergy");
this.maxReceive = tag.getInteger("maxReceive");
this.maxExtract = tag.getInteger("maxExtract");
}
}
public void writeToNBT(NBTTagCompound tag) {