mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Added Region.shift
- Provided a default implementation using expand+contract in AbstractRegion - Overrid the implementation in the subtypes
This commit is contained in:
@ -302,6 +302,23 @@ public class Polygonal2DRegion extends AbstractRegion {
|
||||
recalculate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shift(Vector change) throws RegionOperationException {
|
||||
final double changeX = change.getX();
|
||||
final double changeY = change.getY();
|
||||
final double changeZ = change.getZ();
|
||||
|
||||
for (int i = 0; i < points.size(); ++i) {
|
||||
BlockVector2D point = points.get(i);
|
||||
points.set(i, new BlockVector2D(point.getX() + changeX, point.getZ() + changeZ));
|
||||
}
|
||||
|
||||
minY += changeY;
|
||||
maxY += changeY;
|
||||
|
||||
recalculate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if a point is inside this region.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user