Multiverse / Multiverse-Core

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

World Gen reverting back to default generator on world/server reload #778

Closed mazirian closed 1 year ago

mazirian commented 12 years ago

Please re-open issue ( #752 Custom World Generator World Reverts Back to Normal.)

I am also experiencing this issue except I'm Using TerrainControl and also experienced this issue with Skylands+ But there are no errors in the console.

Every time the server restarts or the world is unloaded then reloaded this happens causing new chunks to generate with the default generator instead of the Custom generator.

10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Multiverse-Core Version: 2.5-b554 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Bukkit Version: git-Bukkit-1.2.5-R4.0-b2222jnks (MC: 1.2.5) 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Loaded Worlds: 5 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Multiverse Plugins Loaded: 0 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Economy being used: Essentials Economy 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Permissions Plugin: Bukkit Permissions (SuperPerms) 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Dumping Config Values: (version 2.9) 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] messagecooldown: 5000 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] teleportcooldown: 1000 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] worldnameprefix: true 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] enforceaccess: false 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] displaypermerrors: true 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] teleportintercept: true 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] firstspawnoverride: true 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] firstspawnworld: world 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] debug: 0 10:36:51 [INFO] [Multiverse-Core] [Multiverse-Core] Special Code: FRN002

main-- commented 11 years ago

Is the issue still present in the latest dev build?

incredinex commented 11 years ago

This exact issue is happening on my server as well. It was doing this on build 641; I just downloaded 644 and it's still doing it, except instead of TerrainControl and Skylands+, I've been experiencing it with uSkyBlock and CleanroomGenerator.

Creating a new world while specifying the generator works and activates the generator, i.e. /mvcreate <worldname> ...

Restarting the server deactivates the terrain generator (I did check and the generator plugins are being enabled before Multiverse-Core).

Resetting the generator value on a world (e.g. /mvm set generator <generator> <world>) does not enable the generator, though it does update the worlds config file.

Reloading the config (/mv reload) doesn't enable the generator even though it seems to be set properly in the config.

Unloading the world and reloading it (/mv unload <worldname> + /mv load <worldname>) will enable the generator, but it's very inconvenient to be having to do this every time the server restarts.

I've read very carefully through my server log and there are no errors being generated.

EDIT an hour or so later: I did more testing on my test server, with very few plugins installed. On this server:

Creating a new world with the CleanroomGenerator worked fine.

Restarting did not deactivate the terrain generator.

Updating the config file and using "/mv reload" did not activate the new generator (which was just Cleanroom with an additional parameter).

Restarting did activate the new generator.

Using "/mvm set generator <generator>" did update the worlds.yml, but did not activate the new generator in game.

"/mv unload <worldname." + "/mv load <worldname>" did activate the new generator.

Besides not activating the new generator with "/mvm set" and "/mv reload", which seem to be persistant, the main issue here seems to be absent on my test server.

Is there possibly some event which MultiVerse is firing that another plugin may be hooking into and erroring silently out somehow?

incredinex commented 11 years ago

Okay, I've been investigating this all day and what seems like is going on is that when Multiverse loads a world that is already loaded in bukkit, it's not updating the generator setting in bukkit (this might not be the only field). This, I believe, is why "/mv reload" and "/mvm set..." are updating the worlds.yml, but not actually telling bukkit to use the newly assigned generator.

I'm thinking the possibility that some other plugin might be trying to load the world before Multiverse does, but I can't imagine which one or why it would do this. I'm hoping that if we can get the "/mv reload" working, the primary problem of this ticket will disappear. I've played a little around in the code. I'll play around some more tomorrow and let you know what I come up with; getting a bit late to do any more tonight though.

main-- commented 11 years ago

Multiverse is trying to update settings like the generator for worlds that are already loaded. However, I don't know a Bukkit implementation that supports this. So this is actually not a bug in Multiverse.

incredinex commented 11 years ago

I don't mind if this is a bukkit issue, I'll take it to them when I figure that out. But, I didn't come here till I was certain it wasn't in uSkyBlock so it doesn't seem fair to pass this on to bukkit without investigating.

I've been trying to track down where Multiverse is trying to update settings in the reload command, and I'm not seeing it.

The reload command (in https://github.com/Multiverse/Multiverse-Core/blob/master/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java) is loading the yml files then on line 40 passing it to...

The loadWorlds(true) on line 613 in this file https://github.com/Multiverse/Multiverse-Core/blob/master/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java which is clearing all the permissions, clearing all the worlds from Multiverse's world list hash (but not Bukkit's list of loaded worlds) and then doLoad (line 650) on each of the worlds which have autoload set to true.

Now, at this point, it would seem to me a shortsight as you would want to reload not only the ones which have autoload, but also the ones which are currently loaded.

Nevertheless, doLoad creates a WorldCreator object, gives it the values from the relevant Multiverse WorldProperties object and passes it to createWorld in https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/Server.java on line 315 (via createWorld()'s on line 234 of https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/WorldCreator.java and on line 154 of https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/Bukkit.java) which says, "If the world is already loaded, it will just return the equivalent of getWorld(creator.name())." I know WorldCreator.java says "If the world already exists, it will be loaded from disk and some options may be ignored." but that seems to only apply to unloaded worlds that are aleady created

In the end, it seems to all get passed to https://github.com/Bukkit/CraftBukkit/blob/master/src/main/java/org/bukkit/craftbukkit/CraftWorld.java which doesn't have a method to update the generator.

Sorry to post all this, I just wanted to trace it through. It seems to me that there are quite a few other properties which could be updated that aren't though. For the problem at hand though, "World Gen reverting back to default generator on world/server reload" I guess I need to figure out if the server is somehow loading the world in question before Multiverse loads it.

dumptruckman commented 11 years ago

I'm going to need a plugin list of all those afflicted by this issue. DO NOT LEAVE ANY OUT.

dumptruckman commented 11 years ago

@incredinex The plain and simple of part of this is that you CANNOT alter the generator of a world that is already loaded into Bukkit. The only time you can specify a generator is when you are actually loaded a world into Bukkit. This does NOT happen on mv reload but DOES happen on server startup, world creation commands, and load commands.

The real issue here seems to be that there is SOME plugin that is interfering and causing issues with Multiverse world settings. This seems doubly apparent after seeing that you came to the same conclusion as everything working as intended when using your test server with minimal plugins but NOT on your production server that has more plugins. So please, as I just commented, let's see that plugin list. The more people experiencing this that post their plugin lists, the better the chances of finding our culprit.

incredinex commented 11 years ago

I agree with that. Here's the plugins we're running:

AncientGates CartArmor SimpleSignEdit Vault MicroEvents ColoredTablist TopPVP HeadHunter Register WhatIsIt CFBanner Votifier mcMMO CleanroomGenerator Citizens MultiInv SkyChest Minequery GoldIsMoney JCVaultListener WorldEdit LogBlockQuestioner PermissionsEx LogBlock Questioner WorldGuard BKCommonLib Lockette ScheduledAnnouncer2 Modifyworld TheEndAgain LogBlockStats Essentials floAuction MyHome uSkyBlock SilkSpawners NoCheatPlus EssentialsChat PluginControl EssentialsSpawn Multiverse-Core dynmap Towny (Advanced) VanishNoPacket SetRankPEX PrivateWarp Multiverse-NetherPortals ShowCaseStandalone WorldBorder ChestShop Dynmap-Towny TownyChat

I did, by the way, come up with an effective solution for the server I play on. I pregenerated the terrain out past where I think we'd realistically go and I put a worldborder on it so people don't go past that.

EDIT: I'll play with it some more this evening and see if I can find anything helpful (seems practical after spending 2 hours last night figuring out how to compile a Maven project from eclipse, lol). If you can think of anything else I can do to help, just let me know.

dumptruckman commented 11 years ago

Yeesh, that's a lot of plugins... Perhaps you could copy them all to your test server and start removing them one by one (or remove all of them and readd one by one) until the problem occurs.

incredinex commented 11 years ago

I had thought of that (and I agree...it's not my choice to have that many). I'll get on it when I get home.

dumptruckman commented 11 years ago

Plugins shared by the person experiencing #986:

ChestShop
Citizens
dynmap
Essentials
EssentialsChat
EssentialsSpawn
Multiverse-Core
PermissionsEx
VanishNoPacket
Vault
Votifier
WorldBorder
WorldEdit

Posting this here for reference. The only ones in that list I can imagine causing problems would be ChestShop, PermissionsEx, and VanishNoPacket

jazzman170 commented 11 years ago

A simple TEMPORARY fix for issues like flags reverting, would be to use a plugin that allows command signs and make the sign to where players can right click it and it will run the multiverse command to set a flag.

I did this with the serversigns plugin and placed them right at my hunger games, so players can simply right click the sign and it sets that worlds PVP flag to true.

wjslager commented 11 years ago

i'm having the same problem i think: 2012-12-09_15.07.15.png 2012-12-09_15.07.06.png

incredinex commented 11 years ago

@jazzman170 There are command blocks now, so I don't think you'd need a plugin to do what you suggest...however, that won't work with the generator issue because we wouldn't want players to be able to unload and load worlds on demand. Quite well might work with PvP though.

wjslager commented 11 years ago

@jazzman170 because my server isn't 24/7 i don't want to reload all the time, so fix it or make some command 'Reload all' or something... :-)

dumptruckman commented 11 years ago

Problem with this is, once we set the generator for a world, we cannot unset it while the world is loaded. So if the generator suddenly stops working, something is wrong with the generator plugin or Bukkit.

dumptruckman commented 11 years ago

I am going to have to claim that issues #778, #986 and #1019 are unsolvable in Multiverse 2. I have never been able to reproduce them and I cannot see anything that would be causing them unless it's due to ridiculously exposed internal code and other plugins accessing that code. As such, I will not be resolving them for Multiverse 2 but I can assure you this WILL NOT be an issue with Multiverse 3 (whever it is ready). Multiverse 3?

Seggan commented 2 years ago

A user of my plugin (also with custom world gen) is experiencing the same problem. After doing some Python scriipting, I found that the only plugins they share with this reduced list are:

Citizens
Essentials
EssentialsChat
EssentialsSpawn
Multiverse-Core
Vault
Votifier
WorldEdit

I will do some more testing.

Seggan commented 2 years ago

Strangely enough, I was not able to replicate the issue using just Multiverse Core. worlds.yml did say the generator was null, but the chunks were generating fine.

ElMoha943 commented 2 years ago

Having the same problem in my server

Steps to reproduce:

World type turns from FLAT no NORMAL, this can be seen with /mv info 2

Using last dev build, on papermc.

imagen

[14:48:27 INFO]: ValenGamerXD issued server command: /mv create test normal -t flat
[14:48:27 INFO]: ValenGamerXD: Starting creation of world 'test'...
[14:48:27 INFO]: [Multiverse-Core] Loading World & Settings - 'test' - Env: NORMAL - Type: FLAT
[14:48:27 ERROR]: No key layers in MapLike[{}]
[14:48:27 INFO]: Preparing start region for dimension minecraft:test
[14:48:28 INFO]: Preparing spawn area: 0%
[14:48:28 INFO]: Time elapsed: 174 ms
[14:48:28 INFO]: [WorldGuard] Default configuration file written: config_world.yml
[14:48:28 INFO]: [WorldGuard] Default configuration file written: blacklist.txt
[14:48:28 INFO]: [WorldGuard] (test) TNT ignition is PERMITTED.
[14:48:28 INFO]: [WorldGuard] (test) Lighters are PERMITTED.
[14:48:28 INFO]: [WorldGuard] (test) Lava fire is PERMITTED.
[14:48:28 INFO]: [WorldGuard] (test) Fire spread is UNRESTRICTED.
[14:48:28 INFO]: [WorldGuard] Loaded configuration for world 'test'
[14:48:28 INFO]: ValenGamerXD: Complete!
[14:48:31 INFO]: ValenGamerXD issued server command: /mv tp test
[14:48:39 INFO]: ValenGamerXD issued server command: /mv info
[14:48:44 INFO]: ValenGamerXD issued server command: /mv info 2
[14:49:00 INFO]: ValenGamerXD issued server command: /mv unload test
[14:49:00 INFO]: [Multiverse-Core] World 'test' was unloaded from Multiverse.
[14:49:00 INFO]: [ExcellentShop] [Chest Shop] Detected world unload: 'test'. Unloading shops...
[14:49:00 INFO]: [Multiverse-Core] World 'test' was unloaded from Bukkit.
[14:49:00 INFO]: ValenGamerXD: Unloaded world 'test'!
[14:49:05 INFO]: ValenGamerXD issued server command: /mv load test
[14:49:05 INFO]: Preparing start region for dimension minecraft:test
[14:49:05 INFO]: Preparing spawn area: 0%
[14:49:06 INFO]: Time elapsed: 455 ms
[14:49:06 INFO]: ValenGamerXD: Loaded world 'test'!
[14:49:07 INFO]: ValenGamerXD issued server command: /mv tp test
[14:50:44 INFO]: ValenGamerXD issued server command: /mv info 2
benwoo1110 commented 1 year ago

Unable to reproduce