Multiverse / Multiverse-Core

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

Config reset on server shutdown/restart #2443

Open benwoo1110 opened 3 years ago

benwoo1110 commented 3 years ago

Description
The issue is due to config being saved on server shutdown. This is done to prevent any unsaved changes by server to be discarded but it creates a side effect that config file change may be reset upon server shutdown/restart. We could just ask people to do /mvreload but opening this issue to see if there is a better solution.

Steps to reproduce

  1. Edited config.yml/worlds.yml
  2. stop the server
  3. Changes will be reverted.
TreyRuffy commented 3 years ago

Would it ruin the plugin if you removed this.saveMVConfigs(); from onDisable() in MultiverseCore.java?

benwoo1110 commented 3 years ago

By right after every change it will save back to the config files, but just in case, it's safer to do it to ensure unsaved changes by the mv is all saved back to the file.

I would say this issue is quite minor as you can do the following workarounds:

  1. Run /mv reload after a config change.
  2. Stop the server before changing/editing the config files.

I mainly opened this issue just so people are aware of such behaviour and how to work around it for now.

ScrapMetalGolem commented 3 months ago

I see this is an old issue but still open. I'm having this problem but with an additional twist. Purpur 2215 1.20.6, multiverse-core 4.3.12

When I make any change to worlds.yml, the changes are reverted to the auto-generated file. This file contains all my worlds but with information I desparately need to change. I have a MiniGames server with 42 worlds currently (and probably a few more yet to be added), so doing all this from in-game chat will be quite tedious.

This issue persists despite my attempts:

I'm not sure what else to try at this point; if multiverse is somehow pushing the saved file on every restart (from where?), I need to stop that happening.

Edit: also ran the local file through a YAML parser just in case it was reverting because it found an error; test passed, and I've looked very carefully at the file multiple times to confirm it's valid

Edit2: Just checked with in-game commands, the flag keepSpawnInMemory isn't working at all. I can use the in-game commands to set the spawnpoint, difficulty, and world generator, but I have no way of affecting the memory usage. I can force "autoLoad" to false, but that is not at all what I'm wanting to accomplish.

Edit3: I finally got some settings to save, by removing the plugin entirely from the server, loading a different world management plugin, rebooting one time, and then shutting the server down. At that point I can edit the worlds.yml and some of the values will save. Coordinates of spawn point and world generator will save, but others like keepspawninmemory will not. If I edit the order of the worlds in the file (by bulk cutting and pasting) those will be reset as well. If I do not follow all of those steps, the entire content of the file will be reset. If I try to edit with in-game commands, nothing is changed.

timriker commented 2 months ago

same here. keepSpawnInMemory won't set to false.