Fix player null check in location runnable
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-11-11 23:29:15 +01:00
parent 500f7b33cb
commit dd1425863a
2 changed files with 8 additions and 2 deletions

View File

@ -32,9 +32,15 @@ public class LocationCheckRunnable implements Runnable
return;
}
Player player = playersToCheck.get(0);
// load the player
Player player = null;
while(player == null || !player.isOnline()) // check if player left and in case, move to next one
{
player = playersToCheck.get(0);
playersToCheck.remove(player);
}
Location playerLocation = player.getLocation();
playersToCheck.remove(player);
Coordinates playerIslandCoordinates = Cache.playerIslands.get(player.getName());

View File