WorldEdit

WorldEdit

43M Downloads

[API] SetSelection always use the current player world

LadyCailinBot opened this issue ยท 1 comments

commented

WORLDEDIT-3465 - Reported by elFlashor

MC version: Spigot 1.8.8
WorldEdit version: 6.1.1 (SNAPSHOT 3394-9a65bdb7)

Issue: when setting a selection using WorldEditPlugin.setSelection(player, selection), getSelection(player).getWorld() return the player world, and not the one set in the setSelection selection parameter.

Steps:

  • set a selection (using WorldEditPlugin.setSelection(player, selection)) in a different world than the one the player is in: new Selection(targetWorld, location1, location2)
  • use WorldEditPlugin.getSelection(player)
  • see that WorldEditPlugin.getSelection(player).getWorld() is different than the world set in setSelection: the selection world is equal to player.getWorld(), and not the one set in setSelection().
commented

Comment by wizjany

that's intended - a player can't have a selection outside their current world because the localsession isn't world aware. you can get a RegionSelector for another world via LocalSession.getRegionSelector(World), but the selection bounds will be lost. from the javadocs:
Get the region selector for defining the selection. If the selection was defined for a different world, the old selection will be discarded.