From 8b3e8947c096cadcd17311876bea44b0216b8a3c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 5 Aug 2011 20:44:33 -0700 Subject: [PATCH] I love when I think of a better way to write things --- .../com/gmail/nossr50/contrib/SpoutStuff.java | 67 +------------------ .../nossr50/datatypes/PlayerProfile.java | 43 +++--------- 2 files changed, 9 insertions(+), 101 deletions(-) diff --git a/mcMMO/com/gmail/nossr50/contrib/SpoutStuff.java b/mcMMO/com/gmail/nossr50/contrib/SpoutStuff.java index 6528d2792..dd74cda5b 100644 --- a/mcMMO/com/gmail/nossr50/contrib/SpoutStuff.java +++ b/mcMMO/com/gmail/nossr50/contrib/SpoutStuff.java @@ -332,72 +332,7 @@ public class SpoutStuff } public static String getUrlIcon(SkillType skillType) { - String url = "http://dl.dropbox.com/u/18212134/xpbar/"; - switch(skillType) - { - case SORCERY: - { - url+="Sorcery"; - break; - } - case TAMING: - { - url+="Taming"; - break; - } - case MINING: - { - url+="Mining"; - break; - } - case WOODCUTTING: - { - url+="Woodcutting"; - break; - } - case REPAIR: - { - url+="Repair"; - break; - } - case HERBALISM: - { - url+="Herbalism"; - break; - } - case ACROBATICS: - { - url+="Acrobatics"; - break; - } - case SWORDS: - { - url+="Swords"; - break; - } - case ARCHERY: - { - url+="Archery"; - break; - } - case UNARMED: - { - url+="Unarmed"; - break; - } - case EXCAVATION: - { - url+="Excavation"; - break; - } - case AXES: - { - url+="Axes"; - break; - } - } - url+=".png"; - return url; + return "http://dl.dropbox.com/u/18212134/xpbar/+"+m.getCapitalized(skillType.toString())+".png"; } public static boolean shouldBeFilled(PlayerProfile PP) { diff --git a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java index 1dbf43d9a..303c0be8d 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -61,41 +61,14 @@ public class PlayerProfile { //Setup the HashMap for the skills - skills.put(SkillType.SORCERY, 0); - skillsXp.put(SkillType.SORCERY, 0); - - skills.put(SkillType.UNARMED, 0); - skillsXp.put(SkillType.UNARMED, 0); - - skills.put(SkillType.TAMING, 0); - skillsXp.put(SkillType.TAMING, 0); - - skills.put(SkillType.MINING, 0); - skillsXp.put(SkillType.MINING, 0); - - skills.put(SkillType.WOODCUTTING, 0); - skillsXp.put(SkillType.WOODCUTTING, 0); - - skills.put(SkillType.REPAIR, 0); - skillsXp.put(SkillType.REPAIR, 0); - - skills.put(SkillType.HERBALISM, 0); - skillsXp.put(SkillType.HERBALISM, 0); - - skills.put(SkillType.EXCAVATION, 0); - skillsXp.put(SkillType.EXCAVATION, 0); - - skills.put(SkillType.ARCHERY, 0); - skillsXp.put(SkillType.ARCHERY, 0); - - skills.put(SkillType.SWORDS, 0); - skillsXp.put(SkillType.SWORDS, 0); - - skills.put(SkillType.AXES, 0); - skillsXp.put(SkillType.AXES, 0); - - skills.put(SkillType.ACROBATICS, 0); - skillsXp.put(SkillType.ACROBATICS, 0); + for(SkillType skillType : SkillType.values()) + { + if(skillType != SkillType.ALL) + { + skills.put(skillType, 0); + skillsXp.put(skillType, 0); + } + } mana = getMaxMana();