mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Fixed parties and /reload not playing nice together.
This commit is contained in:
parent
fcc36ee5d7
commit
f0c937ad47
@ -38,7 +38,6 @@ import com.gmail.nossr50.party.PartyManager;
|
|||||||
import com.gmail.nossr50.runnables.SaveTimerTask;
|
import com.gmail.nossr50.runnables.SaveTimerTask;
|
||||||
import com.gmail.nossr50.runnables.database.UserPurgeTask;
|
import com.gmail.nossr50.runnables.database.UserPurgeTask;
|
||||||
import com.gmail.nossr50.runnables.party.PartyAutoKickTask;
|
import com.gmail.nossr50.runnables.party.PartyAutoKickTask;
|
||||||
import com.gmail.nossr50.runnables.party.PartyLoaderTask;
|
|
||||||
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
||||||
import com.gmail.nossr50.runnables.skills.SkillMonitorTask;
|
import com.gmail.nossr50.runnables.skills.SkillMonitorTask;
|
||||||
import com.gmail.nossr50.skills.child.ChildConfig;
|
import com.gmail.nossr50.skills.child.ChildConfig;
|
||||||
@ -116,6 +115,8 @@ public class mcMMO extends JavaPlugin {
|
|||||||
registerEvents();
|
registerEvents();
|
||||||
registerCustomRecipes();
|
registerCustomRecipes();
|
||||||
|
|
||||||
|
PartyManager.loadParties();
|
||||||
|
|
||||||
// Setup the leader boards
|
// Setup the leader boards
|
||||||
if (Config.getInstance().getUseMySQL()) {
|
if (Config.getInstance().getUseMySQL()) {
|
||||||
// TODO: Why do we have to check for a connection that hasn't be made yet?
|
// TODO: Why do we have to check for a connection that hasn't be made yet?
|
||||||
@ -367,9 +368,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleTasks() {
|
private void scheduleTasks() {
|
||||||
// Parties are loaded at the end of first server tick otherwise Server.getOfflinePlayer throws an IndexOutOfBoundsException
|
|
||||||
new PartyLoaderTask().runTaskLater(this, 0);
|
|
||||||
|
|
||||||
// Periodic save timer (Saves every 10 minutes by default)
|
// Periodic save timer (Saves every 10 minutes by default)
|
||||||
long saveIntervalTicks = Config.getInstance().getSaveInterval() * 1200;
|
long saveIntervalTicks = Config.getInstance().getSaveInterval() * 1200;
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.runnables.party.PartyLoaderTask;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
|
|
||||||
@ -438,6 +439,14 @@ public final class PartyManager {
|
|||||||
* Load party file.
|
* Load party file.
|
||||||
*/
|
*/
|
||||||
public static void loadParties() {
|
public static void loadParties() {
|
||||||
|
try {
|
||||||
|
mcMMO.p.getServer().getOfflinePlayer("nossr50"); // TODO: Find a less-hacky way to manage reloading.
|
||||||
|
}
|
||||||
|
catch (IndexOutOfBoundsException ex){
|
||||||
|
new PartyLoaderTask().runTaskLater(mcMMO.p, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
File file = new File(partiesFilePath);
|
File file = new File(partiesFilePath);
|
||||||
|
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user