[Bug] 1.18 does not use `BlockEntity.save()` like it used to..
EwyBoy opened this issue ยท 3 comments
Version Info
- Minecraft:
1.18
- Core Lib: latest 1.18
Description of the Bug
See #3 Tanks do not retain fluid after saving world
Using BlockEntity#saveAdditional
instead of BlockEntity#save
seems to do the trick for me.
That also appears to be the way vanilla BlockEntity
's save their data.
Apart from that, just be sure to call BlockEntity#setChanged
. If it's not called, the world thinks the chunk hasn't changed and thus it isn't "rewritten" to disk.
This would match your explanation as placing another block would cause the chunk to be saved again, thus the first tank would be saved when the second tank is placed and the second tank does not get saved.