diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandrealname.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandrealname.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index 5ed4ef9e6..b48ac5bcb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -1,11 +1,12 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; +import java.util.Locale; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.earth2me.essentials.User; -import com.earth2me.essentials.Util; -import org.bukkit.ChatColor; public class Commandrealname extends EssentialsCommand @@ -16,28 +17,28 @@ public class Commandrealname extends EssentialsCommand } @Override - protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } - final String whois = args[0].toLowerCase(); - for (Player p : server.getOnlinePlayers()) + final String whois = args[0].toLowerCase(Locale.ENGLISH); + for (Player onlinePlayer : server.getOnlinePlayers()) { - final User u = ess.getUser(p); + final User u = ess.getUser(onlinePlayer); if (u.isHidden()) { continue; } - final String displayName = ChatColor.stripColor(u.getDisplayName()).toLowerCase(); + final String displayName = Util.stripColor(u.getDisplayName()).toLowerCase(Locale.ENGLISH); if (!whois.equals(displayName) - && !displayName.equals(ChatColor.stripColor(ess.getSettings().getNicknamePrefix()) + whois) + && !displayName.equals(Util.stripColor(ess.getSettings().getNicknamePrefix()) + whois) && !whois.equalsIgnoreCase(u.getName())) { continue; } - sender.sendMessage(u.getDisplayName() + " " + Util.i18n("is") + " " + u.getName()); + sender.sendMessage(u.getDisplayName() + " " + _("is") + " " + u.getName()); } } } |