mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Fixed Party class not being a real singleton
This commit is contained in:
parent
4fa3708c2f
commit
0234b0f6ce
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user