From 37373976f5b9d4ad5823bf84de06f00435a6ed86 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Wed, 31 Jul 2013 10:36:47 +0200 Subject: [PATCH] Added the polyhedral selector to //sel. --- .../com/sk89q/worldedit/commands/SelectionCommands.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java index 5914ae29b..03dfba2a1 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java @@ -44,6 +44,7 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.data.ChunkStore; +import com.sk89q.worldedit.regions.ConvexPolyhedralRegionSelector; import com.sk89q.worldedit.regions.CuboidRegionSelector; import com.sk89q.worldedit.regions.CylinderRegionSelector; import com.sk89q.worldedit.regions.EllipsoidRegionSelector; @@ -766,8 +767,12 @@ public class SelectionCommands { } else if (typeName.equalsIgnoreCase("cyl")) { selector = new CylinderRegionSelector(oldSelector); player.print("Cylindrical selector: Left click=center, right click to extend."); + } else if (typeName.equalsIgnoreCase("convex") || typeName.equalsIgnoreCase("hull") || typeName.equalsIgnoreCase("polyhedron")) { + int maxVertices = we.getMaximumPolygonalPoints(player); // TODO: separate maximum for polyhedra + selector = new ConvexPolyhedralRegionSelector(oldSelector, maxVertices); + player.print("Convex polyhedral selector: Left click=First vertex, right click to add more."); } else { - player.printError("Only cuboid|extend|poly|ellipsoid|sphere|cyl are accepted."); + player.printError("Only cuboid|extend|poly|ellipsoid|sphere|cyl|convex are accepted."); return; }