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:
commit
2e76b90191
1 changed files with 6 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue