Fix #1915
This commit is contained in:
parent
5e767e97f0
commit
8ba6c25fc5
1 changed files with 3 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue