Chunk Components don't save
alkyaly opened this issue ยท 5 comments
Versions:
Cardinal Components API: 4.0.1
Minecraft: 1.18.1
While updating a mod that had a cca chunk component to 1.18, I noticed that none of its values persisted between world reloads, I was marking the chunk as unsaved (Chunk#setShouldSave), as instructed by the documentation, and still was not working.
Test mod I made to test the issue
Log of test (Relevant Lines: 220-222 & 276-278)
As can be seen in the log, on the second join the thing value was 0 even though the first join sets the value to 1337.
If I'm not mistaken, mojang's data fixer should preserve the old data so there should not be an issue
Cardinal Components API: 4.0.1
Minecraft: 1.18.1
Java: openjdk-17
I'm experiencing the same issue with a mod of mine. I took a look at the NBT of the test mod made by @alkyaly, and it looks like the NBT data has shifted a bit between Minecraft versions so maybe that has something to do with it.
I've also just identified that the serialisation mixin for chunk storage is still trying to look for the "Level" tag.
Not entirely sure what these methods have access to, as they're mixins and I was using CC to avoid having to use them in the first place. Hope this is helpful in fixing the issue though!
I also ran into the same issue. After some investigation, I found out that the chunks used for initialization of the components are ReadOnlyChunks, thus their setShouldSave method does nothing.

