Skip to content

Commit

Permalink
Fixes #508
Browse files Browse the repository at this point in the history
  • Loading branch information
cm0x4D committed Aug 22, 2016
1 parent 03e5e65 commit 8b3b201
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ public Container newContainer(Direction side, EntityPlayer player) {
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);

try {
mod = Mod.valueOf(nbt.getString("mode"));
} catch (Exception e) {
mod = Mod.ModCounter;
}
energyStack = nbt.getDouble("energyStack");
timeCounter = nbt.getDouble("timeCounter");
password = nbt.getString("password");
Expand All @@ -256,6 +261,7 @@ public void readFromNBT(NBTTagCompound nbt) {
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);

nbt.setString("mode", mod.toString());
nbt.setDouble("energyStack", energyStack);
nbt.setDouble("timeCounter", timeCounter);
nbt.setString("password", password);
Expand Down

0 comments on commit 8b3b201

Please sign in to comment.