mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-16 07:45:12 +01:00
Modified file to avoid an NPE.
This commit is contained in:
parent
b2c4a2d929
commit
8d9a2597a0
@ -118,12 +118,10 @@ public class AdminTeleportCommand extends CompositeCommand {
|
|||||||
|
|
||||||
private Location getSpot(World world) {
|
private Location getSpot(World world) {
|
||||||
Island island = getIslands().getIsland(world, targetUUID);
|
Island island = getIslands().getIsland(world, targetUUID);
|
||||||
if (island != null && island.getSpawnPoint(world.getEnvironment()) != null) {
|
if (island == null) {
|
||||||
// Return the defined spawn point
|
return null;
|
||||||
return island.getSpawnPoint(world.getEnvironment());
|
|
||||||
}
|
}
|
||||||
// Return the default island protection center
|
return island.getSpawnPoint(world.getEnvironment()) != null ? island.getSpawnPoint(world.getEnvironment()) : island.getProtectionCenter().toVector().toLocation(world);
|
||||||
return island.getProtectionCenter().toVector().toLocation(world);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user