1.8.8 compatibility

This commit is contained in:
Fabrizio La Rosa 2020-07-29 01:19:54 +02:00
parent e58cd903d0
commit f59879dd05
2 changed files with 9 additions and 1 deletions

View File

@ -1629,7 +1629,7 @@ public class IslandManager {
double locIncrement = island.getSize() % 2d != 0d ? 0.50d + Double.MIN_VALUE : -Double.MIN_VALUE;
return LocationUtil.isLocationInLocationRadius(
islandLocation.clone().add(locIncrement, 0d, locIncrement),
location.toCenterLocation(),
LocationUtil.toCenterLocation(location),
island.getRadius() + Math.round(locIncrement));
}
return false;

View File

@ -369,4 +369,12 @@ public final class LocationUtil {
return rndLoc;
}
}
public static Location toCenterLocation(Location loc) {
Location centerLoc = loc.clone();
centerLoc.setX((double)loc.getBlockX() + 0.5D);
centerLoc.setY((double)loc.getBlockY() + 0.5D);
centerLoc.setZ((double)loc.getBlockZ() + 0.5D);
return centerLoc;
}
}