This commit is contained in:
modmuss50 2019-12-22 18:01:19 +00:00
parent 5e767e97f0
commit 8ba6c25fc5

View file

@ -104,18 +104,15 @@ public class CableBlockEntity extends BlockEntity
@Override
public void fromTag(CompoundTag compound) {
super.fromTag(compound);
if (compound.contains("CableBlockEntity")) {
energy = compound.getCompound("CableBlockEntity").getInt("power");
if (compound.contains("energy")) {
energy = compound.getDouble("energy");
}
}
@Override
public CompoundTag toTag(CompoundTag compound) {
super.toTag(compound);
if (energy > 0) {
CompoundTag data = new CompoundTag();
compound.put("CableBlockEntity", data);
}
compound.putDouble("energy", energy);
return compound;
}