Unregisters worlds with MV on shutdown. #2150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2149
There is a bug in MV (I think) where it doesn't properly set the generator for a world if it already knows about the world. If the MV config is deleted, after the server is shutdown, or the
mv remove
command is run on the worlds before shutdown, then everything is okay, but it's a pain for admins to have to run that remove command manually every time.I think the issue is an MV bug. It used to work but now doesn't and if you reboot your server with AcidIsland for example, you get super flat world generation. I could file a bug with MV, but I'm trying a workaround. I wonder why we don't hear any bugs on this. Maybe MV is not used much nowadays? MyWorlds works fine BTW.
I suspect the incompatibility is because BentoBox loads worlds after Multiverse, so that the generators are unknown (you can see in the log thatMV tries really early) on start up. This seems to cause MV to stop caring about the world and even issuing the
mv modify set generator BentoBox
command does not work. The generator is just not picked up at all. The only way to force MV to detect it is to remove the world from it via command or just deleting the config.This "fix" runs the mv remove command on shutdown. As plugins are not allowed to run tasks or commands in onDisable, it has to catch the "stop" or "restart" commands using an event. This works, and it's the only way to do this AFAIK. Not great though.