mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-29 04:28:04 +01:00
Fixed ProtectedCuboidRegion::getPoints() returning points in wrong order
ProtectedPolygonRegion returns points in an order such that you could play "connect the dots" and end up with the correct polygon. ProtectedCuboidRegion returns them in an order such that playing connect the dots gives you a Z shape. This breaks the intersectsEdges() function in ProtectedRegion when comparing cuboids. This commit causes ProtectedCuboidRegion::getPoints() to return them in an order consistent with ProtectedPolygonRegion, which makes intersectsEdges() work correctly.
This commit is contained in:
parent
0162910964
commit
ec9712f30e
@ -76,6 +76,7 @@ public void setMaximumPoint(BlockVector pt) {
|
||||
setMinMaxPoints(min, pt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockVector2D> getPoints() {
|
||||
List<BlockVector2D> pts = new ArrayList<BlockVector2D>();
|
||||
int x1 = min.getBlockX();
|
||||
@ -85,8 +86,8 @@ public List<BlockVector2D> getPoints() {
|
||||
|
||||
pts.add(new BlockVector2D(x1, z1));
|
||||
pts.add(new BlockVector2D(x2, z1));
|
||||
pts.add(new BlockVector2D(x1, z2));
|
||||
pts.add(new BlockVector2D(x2, z2));
|
||||
pts.add(new BlockVector2D(x1, z2));
|
||||
|
||||
return pts;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user