team-abnormals / blueprint

Library that implements the framework of all Abnormals mods
https://www.curseforge.com/minecraft/mc-mods/blueprint
Other
115 stars 33 forks source link

[1.20.1] Overworld surface rules corrupting worlds #253

Open Neko2n opened 2 months ago

Neko2n commented 2 months ago

Blueprint seems to be causing an issue where the overworld surface rules in a world's level.dat slowly gets larger and larger until the NBT is too large to read (has depth greater than 512). Here's a screenshot of how the NBT looks on a world that is crashing: image

Upon making a new world this pattern seems to still be present, but there are less recursions with the depth only reaching 4 or 5. Here's what that looks like: image

A corrupted world looks like this in the logs: latest.log

And finally here's a copy of the corrupted level.dat: https://drive.google.com/file/d/1bZdR5i4QrWmayJ5ErYDTN_fiSLevsEMM/view?usp=sharing (Couldn't upload directly to github as they don't support the .dat file type)

I have 300+ other mods installed alongside blueprint as well as some of the indev versions of other abnormal's mods, so it's very possible the issue doesn't actually come from blueprint. The most notable mod installed is terrablender, which has been reported to have had this same issue with citadel in the past: https://github.com/LunaPixelStudios/Better-MC/issues/1415#issuecomment-1743944136

SmellyModder commented 2 months ago

I've been seeing level data corruption issues very frequently recently, but Blueprint code hasn't changed in a while, so I suspect something new is making the issue happen or much more common than before. I've only seen this issue occurring in Connector/Fabric environments lately, which probably explains the significant increase in the frequency of level.dat corruption because Blueprint is not designed for that platform.

Anyway, I'm not very concerned with the cause or who is at fault because it's very bad to see user worlds getting corrupted, and I want to fix it myself as soon as possible.

I will fix this issue and likely all future Blueprint level.dat issues by stopping Blueprint from serializing its dimension modifications. Normally Blueprint handles the serialization fine, but I suspect something is forcing Blueprint to not reset its serialized modifications.

Fortunately, user worlds are recoverable if the level.dat dimension data gets reset to vanilla.

Neko2n commented 2 months ago

fyi the server I was running that originally contained this world was not running connector. I only have connector installed on my client for some client-sided mods like presence footsteps and wakes. The server was not printing logs properly, though, so I had to download the world files and run it in singleplayer to get readable log data.

Also, yes, I was able to fix the issue by deleting the old world’s overworld and end dimension surface rules and replacing them with surface rules from the newly generated world. I did this through NBTStudio.

SmellyModder commented 2 months ago

I tried to reproduce the issue you're getting with similar conditions and got a similar problem.

I can't reproduce the blueprint:transient_merged surface rule containing other blueprint:transient_merged surface rules, so I'm unsure why that's happening. Anyway, that shouldn't be possible unless a mod other than Terrablender is doing something weird.

Potential Fix: @Neko2n I'd appreciate it if you could try the following steps to see if the NBT stops growing with each world reload with your mod set. Step 1: Reset your surface rules to vanilla. Step 2: Use this experimental Blueprint version instead. Step 3: Reload the same world many times and see if the surface rule NBT no longer grows.

Neko2n commented 2 months ago

Will do, hopefully I’ll be back with results by the end of the day.

Neko2n commented 2 months ago

In a newly generated world: image

Ported the settings over to the corrupted world and reloaded the world three times. Each time it loaded up without fail. image

This seems to have fixed the issue :)

SmellyModder commented 2 months ago

Thanks, I will release the fix soon.

Raycoms commented 1 week ago

Still happening