mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Removed unused OfflinePlayer from PlayerProfile
This commit is contained in:
		@@ -60,7 +60,7 @@ public class InspectCommand implements CommandExecutor {
 | 
			
		||||
                    return true;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                profile = new PlayerProfile(target, false); //Temporary Profile
 | 
			
		||||
                profile = new PlayerProfile(target.getName(), false); //Temporary Profile
 | 
			
		||||
 | 
			
		||||
                if (!profile.isLoaded()) {
 | 
			
		||||
                    sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ public class MmoeditCommand implements CommandExecutor {
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                profile = new PlayerProfile(modifiedPlayer, false); //Temporary Profile
 | 
			
		||||
                profile = new PlayerProfile(modifiedPlayer.getName(), false); //Temporary Profile
 | 
			
		||||
 | 
			
		||||
                if (!profile.isLoaded()) {
 | 
			
		||||
                    sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
 | 
			
		||||
 
 | 
			
		||||
@@ -22,9 +22,10 @@ public class McMMOPlayer {
 | 
			
		||||
    private Party invite;
 | 
			
		||||
 | 
			
		||||
    public McMMOPlayer (Player player) {
 | 
			
		||||
        String playerName = player.getName();
 | 
			
		||||
        this.player = player;
 | 
			
		||||
        this.profile = new PlayerProfile(player, true);
 | 
			
		||||
        this.party = PartyManager.getInstance().getPlayerParty(player.getName());
 | 
			
		||||
        this.profile = new PlayerProfile(playerName, true);
 | 
			
		||||
        this.party = PartyManager.getInstance().getPlayerParty(playerName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -7,9 +7,6 @@ import java.io.FileWriter;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
 | 
			
		||||
import org.bukkit.OfflinePlayer;
 | 
			
		||||
import org.bukkit.entity.Player;
 | 
			
		||||
 | 
			
		||||
import com.gmail.nossr50.mcMMO;
 | 
			
		||||
import com.gmail.nossr50.config.Config;
 | 
			
		||||
import com.gmail.nossr50.config.SpoutConfig;
 | 
			
		||||
@@ -19,6 +16,8 @@ import com.gmail.nossr50.util.Misc;
 | 
			
		||||
 | 
			
		||||
public class PlayerProfile {
 | 
			
		||||
 | 
			
		||||
    private String playerName;
 | 
			
		||||
    
 | 
			
		||||
    /* HUD */
 | 
			
		||||
    private SpoutHud spoutHud;
 | 
			
		||||
 | 
			
		||||
@@ -51,14 +50,10 @@ public class PlayerProfile {
 | 
			
		||||
    HashMap<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>();
 | 
			
		||||
    HashMap<ToolType, Integer> toolATS = new HashMap<ToolType, Integer>();
 | 
			
		||||
 | 
			
		||||
    private OfflinePlayer player;
 | 
			
		||||
    private String playerName;
 | 
			
		||||
    private final static String location = mcMMO.usersFile;
 | 
			
		||||
 | 
			
		||||
    public PlayerProfile(OfflinePlayer player, boolean addNew) {
 | 
			
		||||
        this.player = player;
 | 
			
		||||
        this.playerName = player.getName();
 | 
			
		||||
 | 
			
		||||
    public PlayerProfile(String playerName, boolean addNew) {
 | 
			
		||||
        this.playerName = playerName;
 | 
			
		||||
        party = PartyManager.getInstance().getPlayerParty(playerName);
 | 
			
		||||
 | 
			
		||||
        for (AbilityType abilityType : AbilityType.values()) {
 | 
			
		||||
@@ -84,19 +79,10 @@ public class PlayerProfile {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//    public Player getPlayer() {
 | 
			
		||||
//        return player;
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    public String getPlayerName() {
 | 
			
		||||
        return playerName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPlayer(Player player) {
 | 
			
		||||
        this.player = player;
 | 
			
		||||
        this.playerName = player.getName();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean loadMySQL() {
 | 
			
		||||
        userId = mcMMO.database.getInt("SELECT id FROM " + Config.getInstance().getMySQLTablePrefix() + "users WHERE user = '" + playerName + "'");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user