mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
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:
@ -10,7 +10,6 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class McrankCommandDisplayTask extends BukkitRunnable {
|
||||
private final Map<String, Integer> skills;
|
||||
@ -31,13 +30,13 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName));
|
||||
|
||||
for (SkillType skill : SkillType.nonChildSkills()) {
|
||||
for (SkillType skill : SkillType.NON_CHILD_SKILLS) {
|
||||
if (player != null && !Permissions.skillEnabled(player, skill)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
rank = skills.get(skill.name());
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skill), (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", skill.getSkillName(), (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
|
||||
}
|
||||
|
||||
rank = skills.get("ALL");
|
||||
|
@ -52,7 +52,7 @@ public class FormulaConversionTask extends BukkitRunnable {
|
||||
private void editValues(PlayerProfile profile) {
|
||||
mcMMO.p.debug("========================================================================");
|
||||
mcMMO.p.debug("Conversion report for " + profile.getPlayerName() + ":");
|
||||
for (SkillType skillType : SkillType.nonChildSkills()) {
|
||||
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
|
||||
int oldLevel = profile.getSkillLevel(skillType);
|
||||
int oldXPLevel = profile.getSkillXpLevel(skillType);
|
||||
int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel);
|
||||
|
Reference in New Issue
Block a user