mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-30 22:44:07 +01:00
replaced string comparison with instanceof
This commit is contained in:
parent
0d80265ff2
commit
676e744c02
@ -164,7 +164,7 @@ public List<ProtectedRegion> getIntersectingRegions(List<ProtectedRegion> region
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the other regions points are inside the current region
|
// Check whether the other regions points are inside the current region
|
||||||
if (region.getTypeName() == "polygon") {
|
if (region instanceof ProtectedPolygonalRegion) {
|
||||||
for (i2 = 0; i < ((ProtectedPolygonalRegion)region).getPoints().size(); i++) {
|
for (i2 = 0; i < ((ProtectedPolygonalRegion)region).getPoints().size(); i++) {
|
||||||
BlockVector2D pt2Dr = ((ProtectedPolygonalRegion)region).getPoints().get(i2);
|
BlockVector2D pt2Dr = ((ProtectedPolygonalRegion)region).getPoints().get(i2);
|
||||||
int minYr = ((ProtectedPolygonalRegion)region).minY;
|
int minYr = ((ProtectedPolygonalRegion)region).minY;
|
||||||
@ -177,7 +177,7 @@ public List<ProtectedRegion> getIntersectingRegions(List<ProtectedRegion> region
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (region.getTypeName() == "cuboid") {
|
} else if (region instanceof ProtectedCuboidRegion) {
|
||||||
BlockVector ptcMin = region.getMinimumPoint();
|
BlockVector ptcMin = region.getMinimumPoint();
|
||||||
BlockVector ptcMax = region.getMaximumPoint();
|
BlockVector ptcMax = region.getMaximumPoint();
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ public List<ProtectedRegion> getIntersectingRegions(List<ProtectedRegion> region
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the other regions points are inside the current region
|
// Check whether the other regions points are inside the current region
|
||||||
if (region.getTypeName() == "polygon") {
|
if (region instanceof ProtectedPolygonalRegion) {
|
||||||
for (i2 = 0; i < ((ProtectedPolygonalRegion)region).getPoints().size(); i++) {
|
for (i2 = 0; i < ((ProtectedPolygonalRegion)region).getPoints().size(); i++) {
|
||||||
BlockVector2D pt2Dr = ((ProtectedPolygonalRegion)region).getPoints().get(i2);
|
BlockVector2D pt2Dr = ((ProtectedPolygonalRegion)region).getPoints().get(i2);
|
||||||
int minYr = ((ProtectedPolygonalRegion)region).minY;
|
int minYr = ((ProtectedPolygonalRegion)region).minY;
|
||||||
@ -184,7 +184,7 @@ public List<ProtectedRegion> getIntersectingRegions(List<ProtectedRegion> region
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (region.getTypeName() == "cuboid") {
|
} else if (region instanceof ProtectedCuboidRegion) {
|
||||||
BlockVector ptcMin = region.getMinimumPoint();
|
BlockVector ptcMin = region.getMinimumPoint();
|
||||||
BlockVector ptcMax = region.getMaximumPoint();
|
BlockVector ptcMax = region.getMaximumPoint();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user