Added the polyhedral selector to //sel.

This commit is contained in:
TomyLobo 2013-07-31 10:36:47 +02:00 committed by wizjany
parent 731c8a0ce7
commit 37373976f5

View File

@ -44,6 +44,7 @@ import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.BlockType;
import com.sk89q.worldedit.data.ChunkStore; import com.sk89q.worldedit.data.ChunkStore;
import com.sk89q.worldedit.regions.ConvexPolyhedralRegionSelector;
import com.sk89q.worldedit.regions.CuboidRegionSelector; import com.sk89q.worldedit.regions.CuboidRegionSelector;
import com.sk89q.worldedit.regions.CylinderRegionSelector; import com.sk89q.worldedit.regions.CylinderRegionSelector;
import com.sk89q.worldedit.regions.EllipsoidRegionSelector; import com.sk89q.worldedit.regions.EllipsoidRegionSelector;
@ -766,8 +767,12 @@ public class SelectionCommands {
} else if (typeName.equalsIgnoreCase("cyl")) { } else if (typeName.equalsIgnoreCase("cyl")) {
selector = new CylinderRegionSelector(oldSelector); selector = new CylinderRegionSelector(oldSelector);
player.print("Cylindrical selector: Left click=center, right click to extend."); 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 { } 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; return;
} }