From 98bb865062d9cca9dc368d0b1fc1f26d078d946c Mon Sep 17 00:00:00 2001 From: bm01 Date: Sat, 9 Feb 2013 15:42:02 +0100 Subject: [PATCH] Load parties before trying to do anything with them --- src/main/java/com/gmail/nossr50/mcMMO.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 69ff415af..6212eff54 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -309,6 +309,9 @@ public class mcMMO extends JavaPlugin { private void scheduleTasks() { BukkitScheduler scheduler = getServer().getScheduler(); + // Parties are loaded at the end of first server tick otherwise Server.getOfflinePlayer throws an IndexOutOfBoundsException + scheduler.scheduleSyncDelayedTask(this, new PartiesLoader(), 0); + // Periodic save timer (Saves every 10 minutes by default) scheduler.scheduleSyncRepeatingTask(this, new SaveTimer(), 0, Config.getInstance().getSaveInterval() * 1200L); // Regen & Cooldown timer (Runs every second) @@ -335,9 +338,6 @@ public class mcMMO extends JavaPlugin { else if (kickInterval > 0) { scheduler.scheduleSyncRepeatingTask(this, new PartyAutoKick(), 0, kickInterval * 60L * 60L * 20L); } - - // Parties are loaded at the end of first server tick otherwise Server.getOfflinePlayer throws an IndexOutOfBoundsException - scheduler.scheduleSyncDelayedTask(this, new PartiesLoader(), 0); } private void setupMetrics() {