mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +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.EntityListener;
|
||||||
import com.gmail.nossr50.listeners.PlayerListener;
|
import com.gmail.nossr50.listeners.PlayerListener;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.mcLocale;
|
||||||
import com.gmail.nossr50.party.Party;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -74,8 +73,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
this.config2 = new LoadTreasures(this);
|
this.config2 = new LoadTreasures(this);
|
||||||
this.config2.load();
|
this.config2.load();
|
||||||
|
|
||||||
new Party(this).loadParties();
|
|
||||||
|
|
||||||
if (!Config.getInstance().getUseMySQL()) {
|
if (!Config.getInstance().getUseMySQL()) {
|
||||||
Users.loadUsers();
|
Users.loadUsers();
|
||||||
}
|
}
|
||||||
|
@ -32,18 +32,19 @@ public class Party {
|
|||||||
private static mcMMO plugin;
|
private static mcMMO plugin;
|
||||||
private static volatile Party instance;
|
private static volatile Party instance;
|
||||||
|
|
||||||
public Party(mcMMO instance) {
|
private Party() {
|
||||||
plugin = instance;
|
plugin = mcMMO.p;
|
||||||
pluginPath = plugin.getDataFolder().getPath();
|
pluginPath = plugin.getDataFolder().getPath();
|
||||||
partyPlayersFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPlayers";
|
partyPlayersFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPlayers";
|
||||||
partyLocksFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyLocks";
|
partyLocksFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyLocks";
|
||||||
partyPasswordsFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPasswords";
|
partyPasswordsFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPasswords";
|
||||||
new File(pluginPath + File.separator + "FlatFileStuff").mkdir();
|
new File(pluginPath + File.separator + "FlatFileStuff").mkdir();
|
||||||
|
loadParties();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Party getInstance() {
|
public static Party getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new Party(plugin);
|
instance = new Party();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user