Fix player null check in location runnable
continuous-integration/drone/push Build is passing Details

main
Bea 5 months ago
parent 500f7b33cb
commit dd1425863a

@ -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());

Loading…
Cancel
Save