Fix OutOfBounds errors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-11-12 01:25:55 +01:00
parent 51c178ab4f
commit 8d4284138f
2 changed files with 3 additions and 5 deletions

View File

@ -26,8 +26,6 @@ public class LocationCheckRunnable implements Runnable
public void run() public void run()
{ {
// if we checked all players, refill the list and skip the check for this time (in case server is empty). // if we checked all players, refill the list and skip the check for this time (in case server is empty).
if(playersToCheck.isEmpty()) { if(playersToCheck.isEmpty()) {
playersToCheck.addAll(Bukkit.getServer().getOnlinePlayers()); playersToCheck.addAll(Bukkit.getServer().getOnlinePlayers());
return; return;
@ -37,8 +35,8 @@ public class LocationCheckRunnable implements Runnable
Player player = null; Player player = null;
while(player == null || !player.isOnline()) // check if player left and in case, move to next one while(player == null || !player.isOnline()) // check if player left and in case, move to next one
{ {
player = playersToCheck.get(0); if(!playersToCheck.isEmpty()) player = playersToCheck.get(0);
playersToCheck.remove(player); if(player != null) playersToCheck.remove(player);
} }
Location playerLocation = player.getLocation(); Location playerLocation = player.getLocation();

View File

@ -1,6 +1,6 @@
sizing: sizing:
island-distance: 500 island-distance: 500
allowed-range: 100 allowed-range: 50
island: island:
world-name: world world-name: world
spawn-offset: spawn-offset: