public void fixLobbyRegion() {
fix("l1", "l2");
}
private void fix(String location1, String location2) {
Location loc1 = parseLocation(coords, location1, world);
Location loc2 = parseLocation(coords, location2, world);
if (loc1 == null || loc2 == null) {
return;
}
boolean modified = false;
if (loc1.getX() > loc2.getX()) {
double tmp = loc1.getX();
loc1.setX(loc2.getX());
loc2.setX(tmp);
modified = true;
}
if (loc1.getZ() > loc2.getZ()) {
double tmp = loc1.getZ();
loc1.setZ(loc2.getZ());
loc2.setZ(tmp);
modified = true;
}
if (loc1.getY() > loc2.getY()) {
double tmp = loc1.getY();
loc1.setY(loc2.getY());
loc2.setY(tmp);
modified = true;
}
if (!arena.getWorld().getName().equals(world.getName())) {
arena.setWorld(world);