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