Multiverse / Multiverse-Core

The original Bukkit Multi-World Plugin!
BSD 3-Clause "New" or "Revised" License
948 stars 297 forks source link

[Bug]: World config gets reset on server launch or MV reload. #3072

Open BreadChaser opened 2 months ago

BreadChaser commented 2 months ago

/mv version -p output

https://paste.gg/adf08fbf7cc0444dbb3f4ee96c4b2a9d

Server logs

https://paste.gg/p/anonymous/53e8f3b8627a4f1ebc85d15f8c8ead43

Server Version

This server is running Paper version 1.21-38-master@1f5db50 (2024-06-27T20:15:58Z) (Implementing API version 1.21-R0.1-SNAPSHOT)

Bug Description

Upon Launching the server or using MV reload in 1.21 paper, it will reset the world config to defaults. It doesnt matter if you mess with it in the config file or use /mvm set it will reset whatever changes you made when using the commads or changing the config, with the server open or not. With more testing it seems most setting works but the KeepSpawnInMemory does not change when trying to set the property, and will reset itself on server launch, even if you set it manually when the server is shut down.

the only setting I see not resetting is Gamemode for some odd reason.

Steps to reproduce

  1. Make a configuration change in Worlds config file.
  2. Launch server, the config with be reset

Agreements

timriker commented 2 months ago

All my keepSpawnInMemory entries get reset to true on server load. running mvm set keepspawninmemory false [world] does NOT change them back.

mvm set keepSpawnInMemory false creative [08:14:00 INFO]: Success! Property keepSpawnInMemory was set to false

[Multiverse-Core] Version 4.3.12 (API v24) Enabled - By dumptruckman, Rigby, fernferret, lithium3141 and main--

( same happens with Multiverse-Core Version: 4.3.1-b861)

Paper version 1.20.6-147-ver/1.20.6@e41d44f (2024-06-17T19:24:35Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)

In the logs, this happens at about the time the Multiverse-Core message shows up, or abot when the message "World(s) loaded." appears.

Changing entries to false in the config, and then manually running a mvm set to false changes ALL worlds to true in the config. Not just the world I'm editing.

ScrapMetalGolem commented 2 months ago

Related, 4-year-old issue: https://github.com/Multiverse/Multiverse-Core/issues/2443

cgaffga commented 2 months ago

I can reproduce this, and it's quite an issue if you can't set keepSpawnInMemory=false anymore and have a lot of worlds that are all ticking (tested with multiverse-core 4.3.12 and mc paper-1.20.6-148)

orbitaldot commented 2 months ago

Getting the same issue with keepSpawnInMemory using multiverse-core-4.3.12 and paper-1.20.6-148. I also tested the issue on a blank Paper server with no plugins other than Multiverse-Core, it happens there too.

I've tested other world settings (such as autoLoad, hunger, weather...), those work fine, keepSpawnInMemory is the main one that keeps resetting for me.

If I use /mvmodify set keepSpawnInMemory false <world>, /mvinfo <same world> shows Keep spawn in memory: true. Similarly, if I edit worlds.yml manually while the server is offline, all keepSpawnInMemory flags are reset to true as soon as the server loads (or, if autoLoad=false for the world where keepSpawnInMemory=false, keepSpawnInMemory turns true for that world after loading it with /mvload).

Furthermore: I tried to replicate this in paper-1.20.4-497 (last stable release for Minecraft 1.24), and paper-1.20.5-4 (first stable release for Minecraft 1.20.5). Setting keepSpawnInMemory=false works as expected in 1.20.4-497, but is broken in 1.20.5-4.

NeverGrowUp commented 2 months ago

In regards to OPs issue, i cant reproduce issue with most world settings when using the /mvm set command. Nor can i reproduce when stopping server and changing config values in worlds.yml.

However can confirm keepSpawnInMemory resets to true.

This has been an issue since 1.20.5 (maybe earlier), but can be individually rectified by adding:

spawn:
  keep-spawn-loaded: false

into the individual worlds paper-world.yml file.

zax71 commented 2 months ago

We mainly support Paper. There’s no reason to be using Spigot any more

timriker commented 2 months ago

How can I confirm if the keep-spawn-loaded worked or not? I changed keep-spawn-loaded to false in config/paper-world-defaults.yml and edited all the keepSpawnInMemory to false in Multiverse-Core/worlds.yml while the server was stopped.

I restart the server and Multiverse-Core/worlds.yml is re-written with all the keepSpawnInMemory set to true when Multiverse-Core loads all the worlds.

CatBang commented 2 months ago

In regards to OPs issue, i cant reproduce issue with most world settings when using the /mvm set command. Nor can i reproduce when stopping server and changing config values in worlds.yml.

However can confirm keepSpawnInMemory resets to true.

This has been an issue since 1.20.5 (maybe earlier), but can be individually rectified by adding:

spawn:
  keep-spawn-loaded: false

into the individual worlds paper-world.yml file.

To my knowledge, since version 1.20.5+, the option "keep-spawn-loaded: false" seems to have been removed from Pape

zax71 commented 2 months ago

This could probably also be achieved with the new spawn chunks gamerule

PovilasLT commented 2 months ago

This could probably also be achieved with the new spawn chunks gamerule

Gamerule keeps resetting after each server restart when using MV.

zax71 commented 2 months ago

Are you setting it with /mv gamerule?

timriker commented 2 months ago

At the console:

mvrule spawnChunkRadius 0 creative

Does seem to work, however keepSpawnInMemory still shows as true. My guess is that this setting is ignored in 1.20.5+

ScrapMetalGolem commented 1 month ago

Using mvrule spawnChunkRadius 0 [world] returns a success message, but after a server restart the chunks are loaded again, according to cmi /status (and just by seeing how much memory is used, but that doesn't really qualify as proof).

Same result as using the /gamerule command with multiverse installed.

When I use /gamerule without multiverse installed, I get the desired result: /status reports 0 chunks loaded per world.

PovilasLT commented 1 month ago

Are you setting it with /mv gamerule?

Same result with both /gamerule and /mv gamerule.

cgaffga commented 3 weeks ago

are there any news on this issue? Server keeps lagging as all spawns stay loaded and ticking :( any workaround? tx

NeverGrowUp commented 3 weeks ago

In regards to OPs issue, i cant reproduce issue with most world settings when using the /mvm set command. Nor can i reproduce when stopping server and changing config values in worlds.yml.

However can confirm keepSpawnInMemory resets to true.

This has been an issue since 1.20.5 (maybe earlier), but can be individually rectified by adding:

spawn:
  keep-spawn-loaded: false

into the individual worlds paper-world.yml file.

Did you see this, as an alternative.

ScrapMetalGolem commented 3 weeks ago

In regards to OPs issue, i cant reproduce issue with most world settings when using the /mvm set command. Nor can i reproduce when stopping server and changing config values in worlds.yml. However can confirm keepSpawnInMemory resets to true. This has been an issue since 1.20.5 (maybe earlier), but can be individually rectified by adding:

spawn:
  keep-spawn-loaded: false

into the individual worlds paper-world.yml file.

Did you see this, as an alternative.

In my setup, at least, this config option seems to be completely ineffective. I'll have a go at using it on a bare server soon and see if it does anything there.

Update: tested it on a server (purpur 2298 1.21.1) with no plugins; the number of chunks loaded in the end (only world I changed the setting for) is only 10, compared to the 49 chunks per world normally, but still it's not zero. Loaded chunks for the nether on this brand new server are only three, and I didn't even change any settings there.

shimloaf commented 2 weeks ago

This is happening on my server as well. /mv gamerule spawnChunkRadius set to 0 solves the loaded chunks issue until a server restart, then resets the property back to 2 automatically. Same with the keepSpawnInMemory property, though the /mvmset doesn't actually even change the property at all. I've edited the actual worlds.yml file while the server is offline, and that also gets instantly reset when the server is restarted. The "keep-spawn-loaded" fix doesn't actually reduce the loaded chunks for me ostensibly at all. In servers with a lot of worlds, this creates a boat load of loaded chunks, and is pushing me over my allocated RAM constantly. Any updates on this/workarounds would be greatly appreciated!

Edit: My stupid duct-tape solution was to run the gamerule command for every world at server start with a plugin that runs commands automatically. It works... but a proper solution would probably be better!