Solved What's the new method for WorldEdit.getSelection()

Discussion in 'Spigot Plugin Development' started by codename_ATL, Jul 14, 2019 at 4:53 AM.

Thread Status:
Not open for further replies.
  1. I'm trying to get the selection of the player and creating an arena with their two locations as shown:
    Code (Text):
    if (this.plugin.getWorldEdit().getSelection(player) != null) {
                            Selection sel = this.plugin.getWorldEdit().getSelection(player);
                            Location min = sel.getMinimumPoint();
                            Location max = sel.getMaximumPoint();
                           
                            Arena arena = new Arena(this.plugin, args[1], GameType.SPLEEF, 3);
                            arena.setLoc1(min);
                            arena.setLoc2(max);
                           
                            this.plugin.arenas.put(args[1], arena);
                           
                            player.sendMessage("§f§k||§bTheSpleefMinigame§f§k|| §f» " + args[1] + " §barena created!");
                        } else {
                            player.sendMessage("§4Error: §cYou must have a WorldEdit selection!");
                        }
    My problem is, getSelection() is no longer valid
     
  2. I think it's this, not tried.
    Code (Java):
            WorldEdit.getInstance().getSessionManager().findByName("playerName").getSelection(WorldEdit.getInstance().getSessionManager().findByName("playerName").getSelectionWorld());
     
    • Useful Useful x 1
  3. Code (Java):
    BukkitPlayer bPlayer = BukkitAdapter.adapt(player);
    Region region = WorldEdit.getInstance().getSessionManager().get(bPlayer).getSelection(bPlayer.getWorld())
     
    • Useful Useful x 1
  4. thanks everyone for your help!!
     
Thread Status:
Not open for further replies.