Make sure block entities are valid when loading them#10383
Conversation
|
This seems more like a bandaid fix, where exactly are these block entities being added from? I would think it would be better to patch where these are coming from. |
These block entities are coming from this other issue (#10375), the other PR fixes it only for new worlds and this one is a fix for existing ones |
|
Is this only an issue for old worlds that use the custom generator override stuff but then load those chunks? |
Yes, because they would have a Sculk Sensor block entity where there is a Sculk Catalyst block |
|
Then maybe we should have this under a config. Not many plugins use this system, and i'd hate to keep this workaround forever. |
|
adding a config option generally offers a level of commitment beyond just having something sitting around for a while, otherwise, we'd need to investigate putting it as part of the forceUpgrade pathway so that we can tell people to just run that before we remove it, but, that seems meh |
I didn't check how the forceUpdate flag works in the code but that sounds like a good idea, it's something that doesn't run everytime a chunk loads and it's a thing that servers with corrupted worlds would have to run only once |
|
not all hosts offer the means to do stuff like that, however; is part of the concern; but, if it was a patch that we wanted to only keep for a short period of time, considering that it causes crashes, we'd need at least some tool that we can recommend to people in order to scan their worlds and clean up such busted state |
|
After a bit of discussion, I'll have a look at simply porting this check to a plugin that can perform this check via command. I'll leave this open in case my timeline tomorrow explodes and I don't find the time for this soon. |
|
Threw together a quick plugin to iterate and process all chunks to find and remove these invalid block entities: https://github.com/lynxplay/block-entity-bin People that had their worlds corrupted by the respective bug may use the plugin to fix their chunk data. |
This PR fixes these 2 issues (#10022 and sachingorkar102/Lootin-plugin#24) but for existing worlds
When a chunk loads it checks all the existing block entities and makes sure they are valid, if they are not the block entities are removed from the world.