mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-25 11:46:54 +01:00
Fix NPE console spam
This commit is contained in:
parent
15ad11a6cb
commit
a748a41313
@ -214,11 +214,15 @@ public class MoveListeners implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
if (!player.getGameMode().equals(GameMode.CREATIVE) && !player.getGameMode().equals(GameMode.SPECTATOR)) {
|
if (!player.getGameMode().equals(GameMode.CREATIVE) && !player.getGameMode().equals(GameMode.SPECTATOR)) {
|
||||||
if (plugin.getConfiguration().getBoolean("Island.Teleport.SafetyCheck", true)) {
|
if (plugin.getConfiguration().getBoolean("Island.Teleport.SafetyCheck", true)) {
|
||||||
Location safeLoc = LocationUtil.getSafeLocation(island.getLocation(world, IslandEnvironment.Visitor));
|
Location isLoc = island.getLocation(world, IslandEnvironment.Visitor);
|
||||||
|
|
||||||
|
if (isLoc != null) {
|
||||||
|
Location safeLoc = LocationUtil.getSafeLocation(isLoc);
|
||||||
if (safeLoc != null) {
|
if (safeLoc != null) {
|
||||||
loc = safeLoc;
|
loc = safeLoc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
loc = island.getLocation(world, IslandEnvironment.Visitor);
|
loc = island.getLocation(world, IslandEnvironment.Visitor);
|
||||||
}
|
}
|
||||||
|
@ -75,11 +75,15 @@ public class PortalPermission extends ListeningPermission {
|
|||||||
if (island.hasRole(IslandRole.Visitor, player.getUniqueId())) {
|
if (island.hasRole(IslandRole.Visitor, player.getUniqueId())) {
|
||||||
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"))
|
if (plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml"))
|
||||||
.getFileConfiguration().getBoolean("Island.Teleport.SafetyCheck", true)) {
|
.getFileConfiguration().getBoolean("Island.Teleport.SafetyCheck", true)) {
|
||||||
Location safeLoc = LocationUtil.getSafeLocation(island.getLocation(IslandWorld.Normal, IslandEnvironment.Visitor));
|
Location isLoc = island.getLocation(IslandWorld.Normal, IslandEnvironment.Visitor);
|
||||||
|
|
||||||
|
if (isLoc != null) {
|
||||||
|
Location safeLoc = LocationUtil.getSafeLocation(isLoc);
|
||||||
if (safeLoc != null) {
|
if (safeLoc != null) {
|
||||||
to = safeLoc;
|
to = safeLoc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (to == null) {
|
if (to == null) {
|
||||||
to = LocationUtil.getSpawnLocation();
|
to = LocationUtil.getSpawnLocation();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user