From 3cac28ea8415bd6b9cb00de4b73fcc2a5fd728cf Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sat, 20 May 2023 20:56:37 +0200 Subject: [PATCH] Keep extending cuboid selector after //cli selectworld --- .../java/com/sk89q/worldedit/cli/CLIExtraCommands.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIExtraCommands.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIExtraCommands.java index 9f6389463..27cc08821 100644 --- a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIExtraCommands.java +++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIExtraCommands.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; +import com.sk89q.worldedit.regions.selector.ExtendingCuboidRegionSelector; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.task.Task; import com.sk89q.worldedit.world.World; @@ -39,9 +40,12 @@ public class CLIExtraCommands { desc = "Select the entire world" ) public void selectWorld(Actor actor, World world, LocalSession session) { - session.setRegionSelector(world, new CuboidRegionSelector( - world, world.getMinimumPoint(), world.getMaximumPoint() - )); + final CuboidRegionSelector selector; + if (session.getRegionSelector(world) instanceof ExtendingCuboidRegionSelector) { + selector = new ExtendingCuboidRegionSelector(world, world.getMinimumPoint(), world.getMaximumPoint()); + } else { + selector = new CuboidRegionSelector(world, world.getMinimumPoint(), world.getMaximumPoint()); + } actor.printInfo(TextComponent.of("Selected the entire world.")); }