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 @Override
public void fromTag(CompoundTag compound) { public void fromTag(CompoundTag compound) {
super.fromTag(compound); super.fromTag(compound);
if (compound.contains("CableBlockEntity")) { if (compound.contains("energy")) {
energy = compound.getCompound("CableBlockEntity").getInt("power"); energy = compound.getDouble("energy");
} }
} }
@Override @Override
public CompoundTag toTag(CompoundTag compound) { public CompoundTag toTag(CompoundTag compound) {
super.toTag(compound); super.toTag(compound);
if (energy > 0) { compound.putDouble("energy", energy);
CompoundTag data = new CompoundTag();
compound.put("CableBlockEntity", data);
}
return compound; return compound;
} }