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
@ -100,7 +100,7 @@ public class MoveListeners implements Listener {
|
|||||||
boolean keepItemsOnDeath;
|
boolean keepItemsOnDeath;
|
||||||
|
|
||||||
if (configLoad.getBoolean("Island.Settings.KeepItemsOnDeath.Enable")) {
|
if (configLoad.getBoolean("Island.Settings.KeepItemsOnDeath.Enable")) {
|
||||||
keepItemsOnDeath = permissionManager.hasPermission(island,"KeepItemsOnDeath", IslandRole.Owner);
|
keepItemsOnDeath = permissionManager.hasPermission(island, "KeepItemsOnDeath", IslandRole.Owner);
|
||||||
} else {
|
} else {
|
||||||
keepItemsOnDeath = configLoad.getBoolean("Island.KeepItemsOnDeath.Enable");
|
keepItemsOnDeath = configLoad.getBoolean("Island.KeepItemsOnDeath.Enable");
|
||||||
}
|
}
|
||||||
@ -206,17 +206,21 @@ public class MoveListeners implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
loc = island.getLocation(world, IslandEnvironment.Main);
|
loc = island.getLocation(world, IslandEnvironment.Main);
|
||||||
|
|
||||||
if(plugin.getConfiguration().getBoolean("Island.Teleport.RemoveWater", false)) {
|
if(plugin.getConfiguration().getBoolean("Island.Teleport.RemoveWater", false)) {
|
||||||
LocationUtil.removeWaterFromLoc(loc);
|
LocationUtil.removeWaterFromLoc(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} 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 (safeLoc != null) {
|
|
||||||
loc = safeLoc;
|
if (isLoc != null) {
|
||||||
|
Location safeLoc = LocationUtil.getSafeLocation(isLoc);
|
||||||
|
if (safeLoc != null) {
|
||||||
|
loc = safeLoc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -72,15 +72,19 @@ public class PortalPermission extends ListeningPermission {
|
|||||||
IslandManager islandManager = plugin.getIslandManager();
|
IslandManager islandManager = plugin.getIslandManager();
|
||||||
Island island = islandManager.getIslandAtLocation(from);
|
Island island = islandManager.getIslandAtLocation(from);
|
||||||
Location to = island.getLocation(IslandWorld.Normal, IslandEnvironment.Main);
|
Location to = island.getLocation(IslandWorld.Normal, IslandEnvironment.Main);
|
||||||
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 (safeLoc != null) {
|
|
||||||
to = safeLoc;
|
if (isLoc != null) {
|
||||||
|
Location safeLoc = LocationUtil.getSafeLocation(isLoc);
|
||||||
|
if (safeLoc != null) {
|
||||||
|
to = safeLoc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(to == null){
|
if (to == null) {
|
||||||
to = LocationUtil.getSpawnLocation();
|
to = LocationUtil.getSpawnLocation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user