Fixed crash on loading energy from prefab

This commit is contained in:
Robert 2013-12-26 20:25:45 -05:00
parent 2ba17ae22c
commit 118358a768

View file

@ -389,11 +389,11 @@ public abstract class TileEntityEnergyMachine extends TileEntityMachine implemen
NBTBase tag = nbt.getTag("energyStored");
if (tag instanceof NBTTagFloat)
{
this.setEnergy(ForgeDirection.UNKNOWN, (long) nbt.getFloat("energyStored") * 1000);
this.energyStored = (long) nbt.getFloat("energyStored") * 1000;
}
else if (tag instanceof NBTTagLong)
{
this.setEnergy(ForgeDirection.UNKNOWN, nbt.getLong("energyStored"));
this.energyStored = nbt.getLong("energyStored");
}
runWithoutPower = !nbt.getBoolean("shouldPower");