Removed needs for SkillType.ALL

Also apparently made /Skillreset work on offline players and fixed
missing permissions check
This commit is contained in:
bm01
2013-02-04 16:33:34 +01:00
parent 458f7f5f5b
commit 35cdcb62b7
17 changed files with 379 additions and 346 deletions

View File

@ -275,23 +275,6 @@ public class SkillTools {
}
}
/**
* Check XP of all skills.
*
* @param player The player to check XP for.
* @param profile The profile of the player whose skill to check
*/
public static void xpCheckAll(Player player, PlayerProfile profile) {
for (SkillType skillType : SkillType.values()) {
//Don't want to do anything with this one
if (skillType == SkillType.ALL || skillType.isChildSkill()) {
continue;
}
xpCheckSkill(skillType, player, profile);
}
}
/**
* Get the skill represented by the given string
*

View File

@ -8,7 +8,6 @@ import com.gmail.nossr50.util.Users;
public enum SkillType {
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
ALL, //This one is just for convenience
ARCHERY(Config.getInstance().getLevelCapArchery(), Config.getInstance().getFormulaMultiplierArchery()),
AXES(AbilityType.SKULL_SPLIITER, Config.getInstance().getLevelCapAxes(), ToolType.AXE, Config.getInstance().getFormulaMultiplierAxes()),
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, Config.getInstance().getLevelCapExcavation(), ToolType.SHOVEL, Config.getInstance().getFormulaMultiplierExcavation()),
@ -120,10 +119,6 @@ public enum SkillType {
}
public static SkillType getSkill(String skillName) {
if (skillName.equalsIgnoreCase("powerlevel") || skillName.equalsIgnoreCase("all")) {
return SkillType.ALL;
}
for (SkillType type : SkillType.values()) {
if (type.name().equalsIgnoreCase(skillName)) {
return type;
@ -141,6 +136,7 @@ public enum SkillType {
* @return the player's skill level
*/
public int getSkillLevel(Player player) {
// TODO: Child skills aren't handled here
return Users.getPlayer(player).getProfile().getSkillLevel(this);
}