From a2efdbc488702f66c2499c0fbc4098d0c601d283 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 29 Jun 2019 03:10:47 +1000 Subject: [PATCH] a1c15e1c39b9c9f4a437bb1ebf5225f1acf158b0 --- .../bukkit/BukkitPlayerBlockBag.java | 17 ++++- .../worldedit/bukkit/WorldEditListener.java | 4 ++ .../worldedit/bukkit/WorldEditPlugin.java | 4 ++ .../main/resources/defaults/config-legacy.yml | 62 +------------------ .../regions/selector/FuzzyRegionSelector.java | 5 ++ .../selector/PolyhedralRegionSelector.java | 4 ++ .../java/com/sk89q/worldedit/EditSession.java | 1 - .../factory/parser/DefaultBlockParser.java | 36 ++++++++--- .../extent/inventory/SlottableBlockBag.java | 17 +++++ .../function/CombinedRegionFunction.java | 14 ++--- .../function/block/ExtentBlockCopy.java | 3 +- .../function/mask/BlockTypeMask.java | 4 +- .../function/operation/ChangeSetExecutor.java | 14 ++--- .../function/operation/Operations.java | 8 ++- .../function/visitor/BreadthFirstSearch.java | 9 +-- .../worldedit/regions/RegionSelector.java | 8 +++ .../ConvexPolyhedralRegionSelector.java | 4 ++ .../selector/CuboidRegionSelector.java | 6 ++ 18 files changed, 125 insertions(+), 95 deletions(-) create mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index a32f11ac0..06bc2db4c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -19,17 +19,19 @@ package com.sk89q.worldedit.bukkit; +import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; import com.sk89q.worldedit.extent.inventory.OutOfSpaceException; +import com.sk89q.worldedit.extent.inventory.SlottableBlockBag; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -public class BukkitPlayerBlockBag extends BlockBag { +public class BukkitPlayerBlockBag extends BlockBag implements SlottableBlockBag { private Player player; private ItemStack[] items; @@ -61,6 +63,19 @@ public class BukkitPlayerBlockBag extends BlockBag { return player; } + @Override + public BaseItem getItem(int slot) { + loadInventory(); + return BukkitAdapter.adapt(items[slot]); + } + + @Override + public void setItem(int slot, BaseItem block) { + loadInventory(); + BaseItemStack stack = block instanceof BaseItemStack ? (BaseItemStack) block : new BaseItemStack(block.getType(), block.getNbtData(), 1); + items[slot] = BukkitAdapter.adapt(stack); + } + @Override public void fetchBlock(BlockState blockState) throws BlockBagException { if (blockState.getBlockType().getMaterial().isAir()) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java index 05774b84c..3f1e3cfc1 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java @@ -28,6 +28,7 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.CommandMapping; +import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; import org.bukkit.block.Block; import org.bukkit.event.Event.Result; @@ -108,6 +109,8 @@ public class WorldEditListener implements Listener { @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerCommand(PlayerCommandSendEvent event) { + Dispatcher dispatcher = plugin.getWorldEdit().getPlatformManager().getCommandManager().getDispatcher(); + if (dispatcher != null) { CommandLocals locals = new CommandLocals(); locals.put(Actor.class, plugin.wrapCommandSender(event.getPlayer())); Set toRemove = plugin.getWorldEdit().getPlatformManager().getCommandManager().getDispatcher().getCommands().stream() @@ -115,6 +118,7 @@ public class WorldEditListener implements Listener { .map(CommandMapping::getPrimaryAlias) .collect(Collectors.toSet()); event.getCommands().removeIf(toRemove::contains); + } } /** diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 85be3ef5d..15b79a4d9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import com.bekvon.bukkit.residence.commands.message; +import com.bekvon.bukkit.residence.containers.cmd; import com.boydti.fawe.Fawe; import com.boydti.fawe.bukkit.FaweBukkit; import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; @@ -183,8 +185,10 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter PermissionsResolverManager.initialize(this); // Setup permission resolver // Register CUI + fail(() -> { getServer().getMessenger().registerIncomingPluginChannel(this, CUI_PLUGIN_CHANNEL, new CUIChannelListener(this)); getServer().getMessenger().registerOutgoingPluginChannel(this, CUI_PLUGIN_CHANNEL); + }, "Failed to register CUI"); // Now we can register events getServer().getPluginManager().registerEvents(new WorldEditListener(this), this); diff --git a/worldedit-bukkit/src/main/resources/defaults/config-legacy.yml b/worldedit-bukkit/src/main/resources/defaults/config-legacy.yml index 2ed6de2d0..ef7a2e6ad 100644 --- a/worldedit-bukkit/src/main/resources/defaults/config-legacy.yml +++ b/worldedit-bukkit/src/main/resources/defaults/config-legacy.yml @@ -30,67 +30,7 @@ limits: butcher-radius: default: -1 maximum: -1 - disallowed-blocks: - - "minecraft:oak_sapling" - - "minecraft:jungle_sapling" - - "minecraft:dark_oak_sapling:" - - "minecraft:spruce_sapling" - - "minecraft:birch_sapling" - - "minecraft:acacia_sapling" - - "minecraft:black_bed" - - "minecraft:blue_bed" - - "minecraft:brown_bed" - - "minecraft:cyan_bed" - - "minecraft:gray_bed" - - "minecraft:green_bed" - - "minecraft:light_blue_bed" - - "minecraft:light_gray_bed" - - "minecraft:lime_bed" - - "minecraft:magenta_bed" - - "minecraft:orange_bed" - - "minecraft:pink_bed" - - "minecraft:purple_bed" - - "minecraft:red_bed" - - "minecraft:white_bed" - - "minecraft:yellow_bed" - - "minecraft:powered_rail" - - "minecraft:detector_rail" - - "minecraft:grass" - - "minecraft:dead_bush" - - "minecraft:moving_piston" - - "minecraft:piston_head" - - "minecraft:sunflower" - - "minecraft:rose_bush" - - "minecraft:dandelion" - - "minecraft:poppy" - - "minecraft:brown_mushroom" - - "minecraft:red_mushroom" - - "minecraft:tnt" - - "minecraft:torch" - - "minecraft:fire" - - "minecraft:redstone_wire" - - "minecraft:wheat" - - "minecraft:potatoes" - - "minecraft:carrots" - - "minecraft:melon_stem" - - "minecraft:pumpkin_stem" - - "minecraft:beetroots" - - "minecraft:rail" - - "minecraft:lever" - - "minecraft:redstone_torch" - - "minecraft:redstone_wall_torch" - - "minecraft:repeater" - - "minecraft:comparator" - - "minecraft:stone_button" - - "minecraft:birch_button" - - "minecraft:acacia_button" - - "minecraft:dark_oak_button" - - "minecraft:jungle_button" - - "minecraft:oak_button" - - "minecraft:spruce_button" - - "minecraft:cactus" - - "minecraft:sugar_cane" - - "minecraft:bedrock" + disallowed-blocks: [] use-inventory: enable: false diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java index 054ea31e5..d74805895 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java @@ -153,4 +153,9 @@ public class FuzzyRegionSelector extends AbstractDelegateExtent implements Regio } return lines; } + + @Override + public List getVerticies() { + return positions; + } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/PolyhedralRegionSelector.java b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/PolyhedralRegionSelector.java index 29094ed38..c028caa26 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/PolyhedralRegionSelector.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/PolyhedralRegionSelector.java @@ -229,4 +229,8 @@ public class PolyhedralRegionSelector implements RegionSelector, CUIRegion { } } + @Override + public List getVerticies() { + return new ArrayList<>(region.getVertices()); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 8f15a9f47..33bba33a1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -205,7 +205,6 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, } @SuppressWarnings("ProtectedField") - protected final World world; private String worldName; private FaweQueue queue; private boolean wrapped; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java index dbbebb88d..bec4903bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java @@ -31,6 +31,7 @@ import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.NotABlockException; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.SignBlock; import com.sk89q.worldedit.blocks.SkullBlock; @@ -42,6 +43,8 @@ import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; +import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.extent.inventory.SlottableBlockBag; import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.registry.state.Property; @@ -107,8 +110,6 @@ public class DefaultBlockParser extends InputParser { } } - private static String[] EMPTY_STRING_ARRAY = new String[]{}; - /** * Backwards compatibility for wool colours in block syntax. * @@ -214,18 +215,37 @@ public class DefaultBlockParser extends InputParser { final World world = context.requireWorld(); final BlockVector3 primaryPosition; try { - primaryPosition = context.requireSession().getRegionSelector(world).getPrimaryPosition(); + primaryPosition = context.requireSession().getRegionSelector(world).getVerticies().get(index - 1); } catch (IncompleteRegionException e) { throw new InputParseException("Your selection is not complete."); } state = world.getBlock(primaryPosition); } else { if ("hand".equalsIgnoreCase(typeString)) { - // Get the block type from the item in the user's hand. - state = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND); - } else if ("offhand".equalsIgnoreCase(typeString)) { - // Get the block type from the item in the user's off hand. - state = getBlockInHand(context.requireActor(), HandSide.OFF_HAND); + // Get the block type from the item in the user's hand. + state = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND); + } else if ("offhand".equalsIgnoreCase(typeString)) { + // Get the block type from the item in the user's off hand. + state = getBlockInHand(context.requireActor(), HandSide.OFF_HAND); + } else if (typeString.matches("slot[0-9]+")) { + int slot = Integer.parseInt(typeString.substring(4)) - 1; + Actor actor = context.requireActor(); + if (!(actor instanceof Player)) { + throw new InputParseException("The user is not a player!"); + } + Player player = (Player) actor; + BlockBag bag = player.getInventoryBlockBag(); + if (bag == null || !(bag instanceof SlottableBlockBag)) { + throw new InputParseException("Unsupported!"); + } + SlottableBlockBag slottable = (SlottableBlockBag) bag; + BaseItem item = slottable.getItem(slot); + + if (!item.getType().hasBlockType()) { + throw new InputParseException("You're not holding a block!"); + } + state = item.getType().getBlockType().getDefaultState(); + nbt = item.getNbtData(); } else { BlockType type = BlockTypes.parse(typeString.toLowerCase()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java new file mode 100644 index 000000000..410adf328 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/SlottableBlockBag.java @@ -0,0 +1,17 @@ +package com.sk89q.worldedit.extent.inventory; + +import com.sk89q.worldedit.blocks.BaseItem; + +public interface SlottableBlockBag { + BaseItem getItem(int slot); + + void setItem(int slot, BaseItem block); + + default int size() { + return 36; + } + + default int getSelectedSlot() { + return -1; + } +} \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java index 3e5ba674d..d04e63fa4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java @@ -34,7 +34,7 @@ import java.util.List; */ public class CombinedRegionFunction implements RegionFunction { - private final List functions = new ArrayList<>(); + private RegionFunction[] functions; /** * Create a combined region function. @@ -49,7 +49,7 @@ public class CombinedRegionFunction implements RegionFunction { */ public CombinedRegionFunction(Collection functions) { checkNotNull(functions); - this.functions.addAll(functions); + this.functions = functions.toArray(new RegionFunction[functions.size()]); } /** @@ -58,7 +58,7 @@ public class CombinedRegionFunction implements RegionFunction { * @param function an array of functions to match */ public CombinedRegionFunction(RegionFunction... function) { - this(Arrays.asList(checkNotNull(function))); + this.functions = function; } public static CombinedRegionFunction combine(RegionFunction function, RegionFunction add) { @@ -82,7 +82,9 @@ public class CombinedRegionFunction implements RegionFunction { */ public void add(Collection functions) { checkNotNull(functions); - this.functions.addAll(functions); + ArrayList functionsList = new ArrayList<>(Arrays.asList(this.functions)); + functionsList.addAll(functions); + this.functions = functionsList.toArray(new RegionFunction[functionsList.size()]); } /** @@ -98,9 +100,7 @@ public class CombinedRegionFunction implements RegionFunction { public boolean apply(BlockVector3 position) throws WorldEditException { boolean ret = false; for (RegionFunction function : functions) { - if (function.apply(position)) { - ret = true; - } + ret |= (function.apply(position)); } return ret; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index 1e5c62873..168b9692b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -69,12 +69,11 @@ public class ExtentBlockCopy implements RegionFunction { @Override public boolean apply(BlockVector3 position) throws WorldEditException { - BaseBlock block = source.getFullBlock(position); BlockVector3 orig = position.subtract(from); BlockVector3 transformed = transform.apply(orig.toVector3()).toBlockPoint(); // Apply transformations to NBT data if necessary - block = transformNbtData(block); + BaseBlock block = transformNbtData(source.getFullBlock(position)); return destination.setBlock(transformed.add(to), block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockTypeMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockTypeMask.java index 91f8c6fbf..c27e82481 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockTypeMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockTypeMask.java @@ -91,7 +91,9 @@ public class BlockTypeMask extends AbstractExtentMask { * @param block an array of blocks */ public void add(BlockType... block) { - add(Arrays.asList(checkNotNull(block))); + for (BlockType type : block) { + this.types[type.getInternalId()] = true; + } } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java index dd8fa5531..4799f17fe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java @@ -68,15 +68,15 @@ public class ChangeSetExecutor implements Operation { @Override public Operation resume(RunContext run) throws WorldEditException { - while (iterator.hasNext()) { - Change change = iterator.next(); - if (type == Type.UNDO) { - change.undo(context); - } else { - change.redo(context); + if (type == Type.UNDO) { + while (iterator.hasNext()) { + iterator.next().undo(context); + } + } else { + while (iterator.hasNext()) { + iterator.next().redo(context); } } - return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java index f1317501b..34bb3f080 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java @@ -27,6 +27,8 @@ import com.sk89q.worldedit.WorldEditException; */ public final class Operations { + private static final RunContext context = new RunContext(); + private Operations() { } @@ -38,7 +40,7 @@ public final class Operations { */ public static void complete(Operation op) throws WorldEditException { while (op != null) { - op = op.resume(new RunContext()); + op = op.resume(context); } } @@ -52,7 +54,7 @@ public final class Operations { public static void completeLegacy(Operation op) throws MaxChangedBlocksException { while (op != null) { try { - op = op.resume(new RunContext()); + op = op.resume(context); } catch (MaxChangedBlocksException e) { throw e; } catch (WorldEditException e) { @@ -71,7 +73,7 @@ public final class Operations { public static void completeBlindly(Operation op) { while (op != null) { try { - op = op.resume(new RunContext()); + op = op.resume(context); } catch (WorldEditException e) { throw new RuntimeException(e); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index 74b25e576..e7b678d27 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -184,8 +184,8 @@ public abstract class BreadthFirstSearch implements Operation { * @param position the position */ public void visit(BlockVector3 position) { - BlockVector3 blockVector = position; - if (!visited.contains(blockVector)) { + if (!visited.contains(position)) { + BlockVector3 blockVector = position; isVisitable(blockVector, blockVector); // Ignore this, just to initialize mask on this point queue.add(blockVector); visited.add(blockVector); @@ -314,7 +314,8 @@ public abstract class BreadthFirstSearch implements Operation { @Override public void cancel() { + queue.clear(); + visited.clear(); + affected = 0; } - - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java index e0524774b..e8efdef5a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java @@ -156,4 +156,12 @@ public interface RegionSelector { */ List getInformationLines(); + /** + * Get the verticies + * @return + * @throws IncompleteRegionException + */ + default List getVerticies() throws IncompleteRegionException { + return Collections.singletonList(getPrimaryPosition()); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java index 3adbf9444..2717ae8ed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java @@ -276,4 +276,8 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion } } + @Override + public List getVerticies() { + return new ArrayList<>(region.getVertices()); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index 99b7027af..2cb510965 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -40,6 +40,7 @@ import com.sk89q.worldedit.world.World; import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -308,4 +309,9 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion { return "cuboid"; } + @Override + public List getVerticies() { + return Arrays.asList(position1, position2); + } + }