From ec9712f30e867fbb8942bea2812c191b263cfca7 Mon Sep 17 00:00:00 2001 From: Joshua M Hertlein Date: Tue, 25 Feb 2014 13:51:57 -0600 Subject: [PATCH] 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. --- .../worldguard/protection/regions/ProtectedCuboidRegion.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java index 2aee3e3f..f194e183 100644 --- a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java +++ b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java @@ -76,6 +76,7 @@ public void setMaximumPoint(BlockVector pt) { setMinMaxPoints(min, pt); } + @Override public List getPoints() { List pts = new ArrayList(); int x1 = min.getBlockX(); @@ -85,8 +86,8 @@ public List 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; }