Location cleaning.

This commit is contained in:
Brianna O'Keefe 2019-01-24 20:07:36 -05:00
parent 8f85ba77fa
commit 4bebce5016
3 changed files with 4 additions and 2 deletions

View File

@ -1381,6 +1381,7 @@ public class IslandManager {
}
public boolean isLocationAtIsland(Island island, org.bukkit.Location location, IslandWorld world) {
if (LocationUtil.isLocationAtLocationRadius(location, island.getLocation(world, IslandEnvironment.Island),
island.getRadius())) {
return true;

View File

@ -104,6 +104,7 @@ public class Move implements Listener {
Island island = islandManager
.getIsland(Bukkit.getServer().getOfflinePlayer(playerData.getIsland()));
if (island != null) {
if (islandManager.isLocationAtIsland(island, to)) {
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));

View File

@ -50,8 +50,8 @@ public final class LocationUtil {
return false;
}
double x = Math.abs(location1.getX() - location2.getX());
double z = Math.abs(location1.getZ() - location2.getZ());
double x = Math.abs(location1.getX() - location2.getX()) - 1;
double z = Math.abs(location1.getZ() - location2.getZ()) - 1;
return x < radius && z < radius;
}