mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-10-04 17:38:04 +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) {
|
||||
|
||||
if (LocationUtil.isLocationAtLocationRadius(location, island.getLocation(world, IslandEnvironment.Island),
|
||||
island.getRadius())) {
|
||||
return true;
|
||||
|
@ -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"));
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user