From d14821e3853bc2f97dfaff5dd6588028e79f2823 Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 15 Feb 2013 13:30:39 -0500 Subject: [PATCH] Fix a few more missing localized names. --- .../com/gmail/nossr50/commands/CommandRegistrationHelper.java | 3 ++- src/main/java/com/gmail/nossr50/listeners/PlayerListener.java | 3 ++- .../java/com/gmail/nossr50/spout/commands/XplockCommand.java | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java b/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java index 48932c5b4..56972c98c 100644 --- a/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java +++ b/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java @@ -42,6 +42,7 @@ import com.gmail.nossr50.skills.smelting.SmeltingCommand; import com.gmail.nossr50.skills.swords.SwordsCommand; import com.gmail.nossr50.skills.taming.TamingCommand; import com.gmail.nossr50.skills.unarmed.UnarmedCommand; +import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.skills.woodcutting.WoodcuttingCommand; import com.gmail.nossr50.spout.commands.MchudCommand; @@ -55,7 +56,7 @@ public final class CommandRegistrationHelper { public static void registerSkillCommands() { for (SkillType skill : SkillType.values()) { String commandName = skill.toString().toLowerCase(); - String localizedName = LocaleLoader.getString(StringUtils.getCapitalized(commandName) + ".SkillName").toLowerCase(); + String localizedName = SkillTools.getSkillName(skill); PluginCommand command; diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 3c9c7c6f5..23e742c0c 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -449,9 +449,10 @@ public class PlayerListener implements Listener { String command = message.substring(1).split(" ")[0]; String lowerCaseCommand = command.toLowerCase(); + // Do these ACTUALLY have to be lower case to work properly? for (SkillType skill : SkillType.values()) { String skillName = skill.toString().toLowerCase(); - String localizedName = LocaleLoader.getString(StringUtils.getCapitalized(skillName) + ".SkillName").toLowerCase(); + String localizedName = SkillTools.getSkillName(skill).toLowerCase(); if (lowerCaseCommand.equals(localizedName)) { event.setMessage(message.replace(command, skillName)); diff --git a/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java b/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java index 1333078eb..1ef31e6d4 100644 --- a/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java +++ b/src/main/java/com/gmail/nossr50/spout/commands/XplockCommand.java @@ -6,7 +6,6 @@ import org.bukkit.command.CommandSender; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillType; -import com.gmail.nossr50.util.StringUtils; public class XplockCommand extends SpoutCommand { @Override @@ -53,7 +52,7 @@ public class XplockCommand extends SpoutCommand { spoutHud.setXpBarLocked(true); spoutHud.setSkillLock(skill); spoutHud.updateXpBar(); - sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", StringUtils.getCapitalized(skill.toString()))); + sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", SkillTools.getSkillName(skill))); } }