[Bug]: Crash when create or delete world using API
MSDOSadmin opened this issue ยท 2 comments
/mv version -p
output
[12:31:28 INFO]: [Multiverse-Core] Multiverse-Core Version: 4.3.1-b861 [12:31:28 INFO]: [Multiverse-Core] Bukkit Version: git-Paper-91 (MC: 1.19.1) [12:31:28 INFO]: [Multiverse-Core] Loaded Worlds: [{"MVWorld@268405007":{"Gen":"null","Type":"NORMAL","Env":"THE_END","Name":"world_the_end"}}, {"MVWorld@1861911040":{"Gen":"null","Type":"FLAT","Env":"NORMAL","Name":"world"}}, {"MVWorld@62704458":{"Gen":"null","Type":"NORMAL","Env":"NORMAL","Name":"public"}}, {"MVWorld@1865736343":{"Gen":"null","Type":"NORMAL","Env":"NETHER","Name":"world_nether"}}] [12:31:28 INFO]: [Multiverse-Core] Multiverse Plugins Loaded: 0 [12:31:28 INFO]: [Multiverse-Core] Economy being used: XConomy [12:31:28 INFO]: [Multiverse-Core] Permissions Plugin: Bukkit Permissions (SuperPerms) [12:31:28 INFO]: [Multiverse-Core] Dumping Config Values: (version 2.9) [12:31:28 INFO]: [Multiverse-Core] enforceaccess: false [12:31:28 INFO]: [Multiverse-Core] prefixchat: false [12:31:28 INFO]: [Multiverse-Core] prefixchatformat: [%world%]%chat% [12:31:28 INFO]: [Multiverse-Core] useasyncchat: true [12:31:28 INFO]: [Multiverse-Core] teleportintercept: true [12:31:28 INFO]: [Multiverse-Core] firstspawnoverride: true [12:31:28 INFO]: [Multiverse-Core] displaypermerrors: true [12:31:28 INFO]: [Multiverse-Core] enablebuscript: true [12:31:28 INFO]: [Multiverse-Core] globaldebug: 0 [12:31:28 INFO]: [Multiverse-Core] silentstart: false [12:31:28 INFO]: [Multiverse-Core] messagecooldown: 5000 [12:31:28 INFO]: [Multiverse-Core] version: 2.9 [12:31:28 INFO]: [Multiverse-Core] firstspawnworld: world [12:31:28 INFO]: [Multiverse-Core] teleportcooldown: 1000 [12:31:28 INFO]: [Multiverse-Core] defaultportalsearch: true [12:31:28 INFO]: [Multiverse-Core] portalsearchradius: 128 [12:31:28 INFO]: [Multiverse-Core] autopurge: true [12:31:28 INFO]: [Multiverse-Core] Special Code: FRN002
Server logs
https://paste.gg/p/anonymous/01cfd039808f42faafaaed79f10b7fc7
Server Version
[12:32:23 INFO]: Checking version, please wait...
[12:32:25 INFO]: This server is running Paper version git-Paper-91 (MC: 1.19.1) (Implementing API version 1.19.1-R0.1-SNAPSHOT) (Git: 65f0b2e)
You are 20 version(s) behind
Download the new version at: https://papermc.io/downloads
Bug Description
Creating or deleting world use API but crash when it created or deleted
Java version JDK17.0.4 and JDK18.0.2 all tried
Steps to reproduce
1.Write down these code:
Create world:
mvcore.getMVWorldManager().addWorld(player.getName() + "-WLD", Environment.NORMAL, null, WorldType.NORMAL, null, null); mvcore.getMVWorldManager().getMVWorld(player.getName() + "-WLD").getCBWorld().setGameRule(GameRule.KEEP_INVENTORY, true); mvcore.teleportPlayer(player, player, mvcore.getMVWorldManager().getMVWorld(player.getName() + "-WLD").getSpawnLocation());
Delete world:
mvcore.getMVWorldManager().deleteWorld(player.getName() + "-NER");
2.Load plugin
3.Create and delete world in plugin menu
4.Server crashed but action completed
Agreements
- I have searched for and ensured there isn't already an open or resolved issue(s) regarding this.
- I was able to reproduce my issue on a freshly setup and up-to-date server with the latest version of Multiverse plugins with no other plugins and with no kinds of other server or client mods.
The crash looks similar to #2560, where command blocks couldn't load or unload worlds because they were modifying the world map while the server was iterating through that map to tick the worlds. In your case, org.bukkit.Bukkit.createWorld(Bukkit.java:767)
is being called while net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1504)
is running. What's interesting is that you're triggering the world load/unload through org.bukkit.craftbukkit.v1_19_R1.util.Waitable.run(Waitable.java:24)
using some sort of BukkitRunnable instead of in the loop that runs the command blocks.
Simply, this is kinda a duplicate of #2560. This is an upstream problem as well. Luckily, this has kinda already been fixed, you just need to update your server. Paper#126 is the oldest version of Paper where this crash shouldn't happen. If you update to that version or later you should be okay.