Fixed parties not being loaded at startup

+ minor cleanup
This commit is contained in:
bm01 2013-01-27 01:32:41 +01:00
parent 5151be05b9
commit a8fa625b5c
2 changed files with 37 additions and 38 deletions

View File

@ -104,7 +104,7 @@ public class mcMMO extends JavaPlugin {
public static ChunkManager placeStore;
public static RepairManager repairManager;
/* Jar Stuff */
// Jar Stuff
public static File mcmmo;
// File Paths
@ -132,6 +132,7 @@ public class mcMMO extends JavaPlugin {
TreasuresConfig.getInstance();
HiddenConfig.getInstance();
AdvancedConfig.getInstance();
PartyManager.loadParties();
List<Repairable> repairables = new ArrayList<Repairable>();
@ -207,6 +208,7 @@ public class mcMMO extends JavaPlugin {
// Old & Powerless User remover
int purgeInterval = Config.getInstance().getPurgeInterval();
if (purgeInterval == 0) {
scheduler.scheduleSyncDelayedTask(this, new UserPurgeTask(), 40); // Start 2 seconds after startup.
}
@ -219,7 +221,6 @@ public class mcMMO extends JavaPlugin {
if (configInstance.getStatsTrackingEnabled()) {
try {
Metrics metrics = new Metrics(this);
Graph graph = metrics.createGraph("Percentage of servers using timings");
if (pluginManager.useTimings()) {
@ -246,14 +247,10 @@ public class mcMMO extends JavaPlugin {
}
}
// Get our ChunkletManager
placeStore = ChunkManagerFactory.getChunkManager();
placeStore = ChunkManagerFactory.getChunkManager(); // Get our ChunkletManager
// Automatically starts and stores itself
new MobStoreCleaner();
// Create Anniversary files
Anniversary.createAnniversaryFile();
new MobStoreCleaner(); // Automatically starts and stores itself
Anniversary.createAnniversaryFile(); // Create Anniversary files
}
/**

View File

@ -16,6 +16,8 @@ public final class PartyManager {
private static String partiesFilePath = mcMMO.p.getDataFolder().getPath() + File.separator + "FlatFileStuff" + File.separator + "parties.yml";
private static List<Party> parties = new ArrayList<Party>();
private PartyManager() {}
/**
* Check if two players are in the same party.
*
@ -414,7 +416,7 @@ public final class PartyManager {
/**
* Load party file.
*/
private static void loadParties() {
public static void loadParties() {
File file = new File(partiesFilePath);
if (!file.exists()) {