Fix IllegalArgumentException with UtilPlayer method
This commit is contained in:
parent
1f92564ea1
commit
b2bdfe384b
@ -620,7 +620,7 @@ public class UtilPlayer
|
||||
public static Player getRandomTarget(Location location, double maxDist)
|
||||
{
|
||||
List<Player> nearby = getNearby(location, maxDist);
|
||||
return nearby.get(RANDOM.nextInt(nearby.size()));
|
||||
return nearby.size() > 0 ? nearby.get(RANDOM.nextInt(nearby.size())) : null;
|
||||
}
|
||||
|
||||
public static boolean isSpectator(Entity player)
|
||||
|
Loading…
Reference in New Issue
Block a user