diff --git a/src/main/java/com/songoda/skyblock/island/IslandManager.java b/src/main/java/com/songoda/skyblock/island/IslandManager.java index 38687293..6d115bce 100644 --- a/src/main/java/com/songoda/skyblock/island/IslandManager.java +++ b/src/main/java/com/songoda/skyblock/island/IslandManager.java @@ -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; diff --git a/src/main/java/com/songoda/skyblock/utils/world/LocationUtil.java b/src/main/java/com/songoda/skyblock/utils/world/LocationUtil.java index 9dc37099..821be37b 100644 --- a/src/main/java/com/songoda/skyblock/utils/world/LocationUtil.java +++ b/src/main/java/com/songoda/skyblock/utils/world/LocationUtil.java @@ -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; + } }