From 0faddbc49b6223785d02f1d5724928bd47ddfddb Mon Sep 17 00:00:00 2001 From: hexosse Date: Mon, 12 Dec 2016 15:00:39 +0100 Subject: [PATCH] Added getWorldSelection. This is an alias for getSelection. It enables CraftScripts to get a world selection as it is not possible to use getSelection which have two default implementations. --- .../com/sk89q/worldedit/LocalSession.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/core/src/main/java/com/sk89q/worldedit/LocalSession.java b/core/src/main/java/com/sk89q/worldedit/LocalSession.java index 942a7a6e..0316cd9d 100644 --- a/core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -738,6 +738,27 @@ public class LocalSession { return world; } + /** + * Get the world selection. + * + * @return the current selection + */ + public Region getWorldSelection() throws IncompleteRegionException { + return getSelection(getSelectionWorld()); + } + + /** + * This is an alias for {@link #getSelection(World)}. + * It enables CraftScripts to get a world selection as it is + * not possible to use getSelection which have two default + * implementations. + * + * @return Get the selection region in the world. + */ + public Region getWorldSelection(World world) throws IncompleteRegionException { + return getSelection(world); + } + /** * Gets the clipboard. *