Changed AbilityTypes from enum to constants

This commit is contained in:
ile123ile
2014-08-24 10:41:55 -07:00
parent 3d7b6e13c9
commit 5e83632004
42 changed files with 913 additions and 225 deletions

View File

@ -98,7 +98,7 @@ public abstract class ExperienceCommand implements TabExecutor {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.skillNames, new ArrayList<String>(SkillType.skillNames.size()));
return StringUtil.copyPartialMatches(args[1], SkillType.getSkillNames(), new ArrayList<String>(SkillType.getSkillNames().size()));
default:
return ImmutableList.of();
}
@ -125,7 +125,7 @@ public abstract class ExperienceCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) {
for (SkillType skillType : SkillType.getNonChildSkills()) {
handleCommand(player, profile, skillType, value);
}

View File

@ -97,7 +97,7 @@ public class SkillresetCommand implements TabExecutor {
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], SkillType.skillNames, new ArrayList<String>(SkillType.skillNames.size()));
return StringUtil.copyPartialMatches(args[1], SkillType.getSkillNames(), new ArrayList<String>(SkillType.getSkillNames().size()));
default:
return ImmutableList.of();
}
@ -148,7 +148,7 @@ public class SkillresetCommand implements TabExecutor {
protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) {
for (SkillType skillType : SkillType.getNonChildSkills()) {
handleCommand(player, profile, skillType);
}

View File

@ -22,7 +22,7 @@ public class HardcoreCommand extends HardcoreModeCommand {
@Override
protected boolean checkEnabled(SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.skillList) {
for (SkillType skillType : SkillType.getSkillList()) {
if (!skillType.getHardcoreStatLossEnabled()) {
return false;
}
@ -52,7 +52,7 @@ public class HardcoreCommand extends HardcoreModeCommand {
private void toggle(boolean enable, SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) {
for (SkillType skillType : SkillType.getNonChildSkills()) {
skillType.setHardcoreStatLossEnabled(enable);
}
}

View File

@ -22,7 +22,7 @@ public class VampirismCommand extends HardcoreModeCommand {
@Override
protected boolean checkEnabled(SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.skillList) {
for (SkillType skillType : SkillType.getSkillList()) {
if (!skillType.getHardcoreVampirismEnabled()) {
return false;
}
@ -52,7 +52,7 @@ public class VampirismCommand extends HardcoreModeCommand {
private void toggle(boolean enable, SkillType skill) {
if (skill == null) {
for (SkillType skillType : SkillType.nonChildSkills) {
for (SkillType skillType : SkillType.getNonChildSkills()) {
skillType.setHardcoreVampirismEnabled(enable);
}
}

View File

@ -53,17 +53,17 @@ public class InspectCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName));
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
for (SkillType skill : SkillType.gatheringSkills) {
for (SkillType skill : SkillType.getGatheringSkills()) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
}
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
for (SkillType skill : SkillType.combatSkills) {
for (SkillType skill : SkillType.getCombatSkills()) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
}
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
for (SkillType skill : SkillType.miscSkills) {
for (SkillType skill : SkillType.getMiscSkills()) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
}

View File

@ -45,7 +45,7 @@ public class MccooldownCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
for (AbilityType ability : AbilityType.values()) {
for (AbilityType ability : AbilityType.getAbilities()) {
if (!ability.getPermissions(player)) {
continue;
}

View File

@ -70,7 +70,7 @@ public class MctopCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], SkillType.skillNames, new ArrayList<String>(SkillType.skillNames.size()));
return StringUtil.copyPartialMatches(args[0], SkillType.getSkillNames(), new ArrayList<String>(SkillType.getSkillNames().size()));
default:
return ImmutableList.of();
}