Skip to content

Commit

Permalink
Added the polyhedral selector to //sel.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyLobo committed Aug 4, 2013
1 parent b66bd27 commit 4a5e6ae
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -44,6 +44,7 @@
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;
Expand Down Expand Up @@ -766,8 +767,12 @@ public void select(CommandContext args, LocalSession session, LocalPlayer player
} 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;
}

Expand Down

0 comments on commit 4a5e6ae

Please sign in to comment.