mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-18 08:35:53 +01:00
Merge pull request #315 from eswick/master
Convert region ID to lowercase when saving polygon points to MySQL database.
This commit is contained in:
commit
fb5ae838d9
@ -433,6 +433,12 @@ private void loadPoly2d() {
|
|||||||
poly2dVectorResultSet.getInt("z")
|
poly2dVectorResultSet.getInt("z")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (points.size() < 3) {
|
||||||
|
logger.warning(String.format("Invalid polygonal region '%s': region only has %d point(s). Ignoring.", id, points.size()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ProtectedRegion region = new ProtectedPolygonalRegion(id, points, minY, maxY);
|
ProtectedRegion region = new ProtectedPolygonalRegion(id, points, minY, maxY);
|
||||||
|
|
||||||
region.setPriority(poly2dResultSet.getInt("priority"));
|
region.setPriority(poly2dResultSet.getInt("priority"));
|
||||||
@ -932,7 +938,7 @@ private void updatePoly2dPoints(ProtectedPolygonalRegion region) throws SQLExcep
|
|||||||
") VALUES (null, ?, " + this.worldDbId + ", ?, ?)"
|
") VALUES (null, ?, " + this.worldDbId + ", ?, ?)"
|
||||||
);
|
);
|
||||||
|
|
||||||
String lowerId = region.getId();
|
String lowerId = region.getId().toLowerCase();
|
||||||
for (BlockVector2D point : region.getPoints()) {
|
for (BlockVector2D point : region.getPoints()) {
|
||||||
insertPoly2dPointStatement.setString(1, lowerId);
|
insertPoly2dPointStatement.setString(1, lowerId);
|
||||||
insertPoly2dPointStatement.setInt(2, point.getBlockZ());
|
insertPoly2dPointStatement.setInt(2, point.getBlockZ());
|
||||||
|
Loading…
Reference in New Issue
Block a user