Some region selection fixes
- CuboidSelection no longer deals with IncompleteRegionExceptions - Fixed Polygonal2DSelection not passing its region to the selector - Fixed Polygonal2DRegion not cloning the list it receives in its constructor - Gave PolygonalRegionSelector a new constructor where it takes a list of points
This commit is contained in:
@@ -76,7 +76,7 @@ public class Polygonal2DRegion implements Region {
|
||||
* @param maxY
|
||||
*/
|
||||
public Polygonal2DRegion(LocalWorld world, List<BlockVector2D> points, int minY, int maxY) {
|
||||
this.points = points;
|
||||
this.points = new ArrayList<BlockVector2D>(points);
|
||||
this.minY = minY;
|
||||
this.maxY = maxY;
|
||||
hasY = true;
|
||||
|
||||
@@ -80,6 +80,12 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
}
|
||||
}
|
||||
|
||||
public Polygonal2DRegionSelector(LocalWorld world, List<BlockVector2D> points, int minY, int maxY) {
|
||||
final BlockVector2D pos2D = points.get(0);
|
||||
pos1 = new BlockVector(pos2D.getX(), minY, pos2D.getZ());
|
||||
region = new Polygonal2DRegion(world, points, minY, maxY);
|
||||
}
|
||||
|
||||
public boolean selectPrimary(Vector pos) {
|
||||
if (pos.equals(pos1)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user