Multiverse-Core

Multiverse-Core

6M Downloads

the spawn system does not properly account for world borders.

PATXS opened this issue ยท 4 comments

commented

Information

Details

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.

Description
[for context, all the testing here was done with a border size of 192 in width (worldborder set 192 without manually setting any center), since it is not an unreasonable size but still extremely likely to require spawn readjustment. vanilla seems to have no problems with this, for reference, but i couldn't test teleporting into a separate world's spawn in vanilla without using another world manager.]

multiverse's spawning system and the "safe spawn" feature seem to be unprepared to handle worlds containing borders. when dealing with a newly added 192-wide border on an already loaded (but never visited) world, multiverse can spawn the player outside of the border the first time, no matter the safe spawn setting. this kills the player on default settings. when a multiverse-assigned "safe spawn" is enabled for that world, it can continously respawn the player outside of the world border and therefore kill them repeatedly, forever. when the safe spawn feature is disabled, the game seems to be able to respawn the player inside the border (but keep in mind this requires the player to die once first).

when importing a never-visited world that already contains a 192-wide border and an unmodified spawnpoint, multiverse seems to always spawn the player below bedrock (and into the void) on first visit. it seems to think the world spawn is 0,0,0 (and it outputs this in console!), and the adjusted spawn does not deviate much from that. once again, if the safe adjusted spawn is enabled, it will keep spawning them here and render the world entirely unplayable unless players are manually teleported up. if adjusted spawn is disabled, the game respawns the player somewhere safe after death. [note: this issue doesn't only happen when importing a world via a command. if the world in question is the server's primary world (just named "world"), multiverse will still do this. when starting the server up without any plugins, this issue is nowhere to be seen. the same can be said when loading the world into singleplayer.]

Steps to reproduce

  1. create a world named "test" with multiverse
  2. set a border with execute in minecraft:test run worldborder set 192
  3. teleport yourself there (using the mvtp command) and likely die

OR

  1. create a world in another server environment, and set a border with execute in minecraft:overworld run worldborder set 192
  2. copy the world folder to a server with multiverse
  3. import it manually or load it as the main world
  4. spawn below bedrock

Expected behavior
the player should be spawned within the world borders at the very least, and not into the void. it's hard to tell whether some of this is vanilla behavior or not, but the vanilla game (as well as paper by itself) does seem to flawlessly handle first-time spawns into the very same worlds i tested with multiverse.

and i apologize if this is not appropriate to mention, but the world manager "hyperverse" handles all of these spawn situations flawlessly as well, and could be a good reference here. i suspect it just lets the game handle spawning as it normally would, but i have no proof of that and don't know how it would be done. (and yes i tried this multiple times with many different worlds and seeds using both multiverse and hyperverse.)

i have no screenshots nor videos but can provide if necessary.

commented

May I ask how are you teleporting players?

Edit: nvm I saw that you use mvtp

commented

Also the it says New Spawn for 'importtest' is located at: importtest:1.50,-2.00,0.50:0.00:0.00 Which I'm sure its within 192 radius. Tho yea, block safety code probably doesn't account for world borders. But if you set spawn to the correctly location before implementing world borders it shouldn't be an issue.

commented

lol yes it is within the 192 block radius, but that spawn is below bedrock at a Y level of -2 (and it's supposed to be safe!)

the reason i found out about this is that for my admittedly niche case, i was automatically generating new worlds and setting up borders before players even got there. so it's not necessarily that i need this fixed, since i can just stop doing it like that, but these two possible scenarios i reported are pretty broken and i thought they might deserve a little bit of dev attention.

commented

Yes I see the areas that can be improve, but current not a huge amount of time in hand. PR will be linked if someone can work on it.