From 8d6f151a54a91f31f0554b990221f17a86958c7d Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Wed, 9 Jul 2014 12:18:59 +0200 Subject: [PATCH] Deprecate PlayerProfiles relying on names --- .../datatypes/player/PlayerProfile.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index 1905b773d..d3434545a 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -32,6 +32,7 @@ public class PlayerProfile { private final Map skillsXp = new HashMap(); // Skill & XP private final Map abilityDATS = new HashMap(); // Ability & Cooldown + @Deprecated public PlayerProfile(String playerName) { this.playerName = playerName; @@ -47,11 +48,33 @@ public class PlayerProfile { } } + public PlayerProfile(UUID uuid) { + this.uuid = uuid; + this.playerName = null; + + mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); + + for (AbilityType abilityType : AbilityType.values()) { + abilityDATS.put(abilityType, 0); + } + + for (SkillType skillType : SkillType.NON_CHILD_SKILLS) { + skills.put(skillType, 0); + skillsXp.put(skillType, 0F); + } + } + + @Deprecated public PlayerProfile(String playerName, boolean isLoaded) { this(playerName); this.loaded = isLoaded; } + public PlayerProfile(String playerName, UUID uuid, boolean isLoaded) { + this(uuid); + this.loaded = isLoaded; + } + public PlayerProfile(String playerName, UUID uuid, Map levelData, Map xpData, Map cooldownData, MobHealthbarType mobHealthbarType) { this.playerName = playerName; this.uuid = uuid;