Fixed Party class not being a real singleton

This commit is contained in:
bm01 2012-04-27 07:11:13 +02:00
parent 4fa3708c2f
commit 0234b0f6ce
2 changed files with 4 additions and 6 deletions

View File

@ -12,7 +12,6 @@ import com.gmail.nossr50.listeners.BlockListener;
import com.gmail.nossr50.listeners.EntityListener;
import com.gmail.nossr50.listeners.PlayerListener;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
import java.io.File;
import java.io.IOException;
@ -74,8 +73,6 @@ public class mcMMO extends JavaPlugin {
this.config2 = new LoadTreasures(this);
this.config2.load();
new Party(this).loadParties();
if (!Config.getInstance().getUseMySQL()) {
Users.loadUsers();
}

View File

@ -32,18 +32,19 @@ public class Party {
private static mcMMO plugin;
private static volatile Party instance;
public Party(mcMMO instance) {
plugin = instance;
private Party() {
plugin = mcMMO.p;
pluginPath = plugin.getDataFolder().getPath();
partyPlayersFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPlayers";
partyLocksFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyLocks";
partyPasswordsFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPasswords";
new File(pluginPath + File.separator + "FlatFileStuff").mkdir();
loadParties();
}
public static Party getInstance() {
if (instance == null) {
instance = new Party(plugin);
instance = new Party();
}
return instance;
}