mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 18:43:43 +01:00 
			
		
		
		
	Fixed Party class not being a real singleton
This commit is contained in:
		@@ -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;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user