Closed EwyBoy closed 2 years ago
Problem is here in SuperMartijn642sCoreLib.BaseTileEntity.save()
https://github.com/SuperMartijn642/SuperMartijn642sCoreLib/blob/56d1c373f2b351438133e74880226b55b26564c7/src/main/java/com/supermartijn642/core/block/BaseTileEntity.java#L63-L70
This has been fixed now in version 1.0.15a of my core library.
I have created a pull request to remove BlockEntity#save(CompoundTag)
. If that works out, it hopefully causes less confusion in the future.
https://github.com/MinecraftForge/MinecraftForge/pull/8235
Thank you for reporting the issue!
Version info Minecraft
1.18
Portable Tanksportabletanks-1.1.2-mc1.18
Describe the bug Hello, I am currently working on my tank mod ITank for 1.18 and I have this bug here where my fluid is not stored in the tank upon saving and exiting the world. This is due to the new save system in Minecraft. You know have to override and use
saveAdditional()
. Like:But I also have some problems with the new
saveAdditional()
. That is that it does not run upon saving the world.. WTF It only loads when sometimes if you place first 1 tank down and fill that up and then place another tank and fill that one. Then it will run on the first tank you placed on save that to disk but when you log back in the second tank you placed will be empty while the first tank will be filled.Been tearing my hair out about this bug for hours now, then I saw you guys released a tank mod for 1.18 so I though I check it out how you guys did it. Looked at the source code for the library mod and saw you where only using the regular
save()
and though maybe you got it working in some weird way. So downloaded the mod from CF and ran it and indeed you got the exact same bug as me. Decided to report it here and maybe we can work together to find a solution to this. Not sure if there is a good way of implementing this or if it needs to be fixed on forges end.Gigaherz pinned this message in the forge discord:
and we (Mowmaster and me) found out that this is the order things compound tags are saved and loaded:
To Reproduce
What do you think? Please keep me posted if you need any more info on this subject and if you can work out a reliable solution. Not sure if I have just botched the implementation for this or if we need to create a issue over at Minecraft Forge.
BTW: here is my source for 1.18 tank block entity, I still cannot get it to reliably save for me.. https://github.com/EwyBoy/ITank/blob/1.18/src/main/java/com/ewyboy/itank/common/content/tank/TankTile.java