From 0b1b6617eb3ed1ad49b85b8188feebd27df3f8d2 Mon Sep 17 00:00:00 2001 From: Xephi Date: Mon, 25 Aug 2014 03:31:55 +0200 Subject: [PATCH] Fix ArrayOutOfBoundsException in getSpawn --- src/main/java/fr/xephi/authme/AuthMe.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index a362b2c3c..ae5163126 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -608,14 +608,8 @@ public class AuthMe extends JavaPlugin { public Location getSpawnLocation(Player player) { World world = player.getWorld(); String[] spawnPriority = Settings.spawnPriority.split(","); - if (spawnPriority.length < 4) { - ConsoleLogger.showError("Check your config for spawnPriority, you need to put all of 4 spawn priorities"); - ConsoleLogger.showError("Defaulting Spawn to world's one"); - return world.getSpawnLocation(); - } Location spawnLoc = world.getSpawnLocation(); - int i = 3; - for (i = 3; i >= 0; i--) { + for (int i = spawnPriority.length - 1; i >= 0; i--) { String s = spawnPriority[i]; if (s.equalsIgnoreCase("default") && getDefaultSpawn(world) != null) spawnLoc = getDefaultSpawn(world);