Fix redstone signal breaking on save-load
This commit is contained in:
parent
34ced36ba0
commit
2e7d7c2ef6
@ -157,6 +157,7 @@ public abstract class BlockEntityMattery extends BlockEntity implements MenuProv
|
|||||||
nbt.putString("Name", Component.Serializer.toJson(display_name));
|
nbt.putString("Name", Component.Serializer.toJson(display_name));
|
||||||
|
|
||||||
nbt.putByte("redstone", (byte) redstone_setting.ordinal());
|
nbt.putByte("redstone", (byte) redstone_setting.ordinal());
|
||||||
|
nbt.putByte("redstone_signal", (byte) redstone_signal);
|
||||||
|
|
||||||
return super.save(nbt);
|
return super.save(nbt);
|
||||||
}
|
}
|
||||||
@ -169,5 +170,8 @@ public abstract class BlockEntityMattery extends BlockEntity implements MenuProv
|
|||||||
|
|
||||||
if (nbt.get("redstone") instanceof ByteTag tag)
|
if (nbt.get("redstone") instanceof ByteTag tag)
|
||||||
redstone_setting = RedstoneSetting.get(tag.getAsByte());
|
redstone_setting = RedstoneSetting.get(tag.getAsByte());
|
||||||
|
|
||||||
|
if (nbt.get("redstone_signal") instanceof ByteTag tag)
|
||||||
|
redstone_signal = tag.getAsByte();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user