mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-07-20 10:44:43 +02:00
Location cleaning.
This commit is contained in:
parent
8f85ba77fa
commit
4bebce5016
|
@ -1381,6 +1381,7 @@ public class IslandManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLocationAtIsland(Island island, org.bukkit.Location location, IslandWorld world) {
|
public boolean isLocationAtIsland(Island island, org.bukkit.Location location, IslandWorld world) {
|
||||||
|
|
||||||
if (LocationUtil.isLocationAtLocationRadius(location, island.getLocation(world, IslandEnvironment.Island),
|
if (LocationUtil.isLocationAtLocationRadius(location, island.getLocation(world, IslandEnvironment.Island),
|
||||||
island.getRadius())) {
|
island.getRadius())) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -104,6 +104,7 @@ public class Move implements Listener {
|
||||||
Island island = islandManager
|
Island island = islandManager
|
||||||
.getIsland(Bukkit.getServer().getOfflinePlayer(playerData.getIsland()));
|
.getIsland(Bukkit.getServer().getOfflinePlayer(playerData.getIsland()));
|
||||||
|
|
||||||
|
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
if (islandManager.isLocationAtIsland(island, to)) {
|
if (islandManager.isLocationAtIsland(island, to)) {
|
||||||
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
|
||||||
|
|
|
@ -50,8 +50,8 @@ public final class LocationUtil {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
double x = Math.abs(location1.getX() - location2.getX());
|
double x = Math.abs(location1.getX() - location2.getX()) - 1;
|
||||||
double z = Math.abs(location1.getZ() - location2.getZ());
|
double z = Math.abs(location1.getZ() - location2.getZ()) - 1;
|
||||||
|
|
||||||
return x < radius && z < radius;
|
return x < radius && z < radius;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user