SkillUtils cleanup, EventUtils creation

Move some functions in SkillUtils to more relevant locations.

Begin work on utility class to handle all event calls.
This commit is contained in:
GJ
2013-10-15 13:03:33 -04:00
parent 309dfd50cd
commit 468fbdab56
32 changed files with 409 additions and 504 deletions

View File

@ -23,7 +23,6 @@ import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.PerksUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.google.common.collect.ImmutableList;
@ -46,7 +45,7 @@ public abstract class SkillCommand implements TabExecutor {
public SkillCommand(SkillType skill) {
this.skill = skill;
skillName = SkillUtils.getSkillName(skill);
skillName = skill.getSkillName();
skillGuideCommand = new SkillGuideCommand(skill);
}
@ -91,7 +90,7 @@ public abstract class SkillCommand implements TabExecutor {
Set<SkillType> parents = FamilyTree.getParents(skill);
for (SkillType parent : parents) {
player.sendMessage(SkillUtils.getSkillName(parent) + " - " + LocaleLoader.getString("Effects.Level", profile.getSkillLevel(parent), profile.getSkillXpLevel(parent), profile.getXpToLevel(parent)));
player.sendMessage(parent.getSkillName() + " - " + LocaleLoader.getString("Effects.Level", profile.getSkillLevel(parent), profile.getSkillXpLevel(parent), profile.getXpToLevel(parent)));
}
}

View File

@ -10,7 +10,6 @@ import org.bukkit.command.CommandSender;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
public class SkillGuideCommand implements CommandExecutor {
private String header;
@ -19,7 +18,7 @@ public class SkillGuideCommand implements CommandExecutor {
private String invalidPage;
public SkillGuideCommand(SkillType skillType) {
header = LocaleLoader.getString("Guides.Header", SkillUtils.getSkillName(skillType));
header = LocaleLoader.getString("Guides.Header", skillType.getSkillName());
guide = getGuide(skillType);
invalidPage = LocaleLoader.getString("Guides.Page.Invalid");