mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 15:17:56 +01:00
Fix ArrayOutOfBoundsException in getSpawn
This commit is contained in:
parent
3f58dd54dd
commit
0b1b6617eb
@ -608,14 +608,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public Location getSpawnLocation(Player player) {
|
public Location getSpawnLocation(Player player) {
|
||||||
World world = player.getWorld();
|
World world = player.getWorld();
|
||||||
String[] spawnPriority = Settings.spawnPriority.split(",");
|
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();
|
Location spawnLoc = world.getSpawnLocation();
|
||||||
int i = 3;
|
for (int i = spawnPriority.length - 1; i >= 0; i--) {
|
||||||
for (i = 3; i >= 0; i--) {
|
|
||||||
String s = spawnPriority[i];
|
String s = spawnPriority[i];
|
||||||
if (s.equalsIgnoreCase("default") && getDefaultSpawn(world) != null)
|
if (s.equalsIgnoreCase("default") && getDefaultSpawn(world) != null)
|
||||||
spawnLoc = getDefaultSpawn(world);
|
spawnLoc = getDefaultSpawn(world);
|
||||||
|
Loading…
Reference in New Issue
Block a user