summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-06 01:55:15 +0200
committersnowleo <schneeleo@gmail.com>2011-07-06 01:55:15 +0200
commit8afde1ccc0aaf089940c879fcbe3efb65e07a88f (patch)
tree8bc3052e93dc60bcce1fe45b0301ee99decb3747
parent674128b3f7e9f2bc9f1462d7313d32e259a3a9b7 (diff)
downloadEssentials-8afde1ccc0aaf089940c879fcbe3efb65e07a88f.tar
Essentials-8afde1ccc0aaf089940c879fcbe3efb65e07a88f.tar.gz
Essentials-8afde1ccc0aaf089940c879fcbe3efb65e07a88f.tar.lz
Essentials-8afde1ccc0aaf089940c879fcbe3efb65e07a88f.tar.xz
Essentials-8afde1ccc0aaf089940c879fcbe3efb65e07a88f.zip
Fix /realname
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandrealname.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
index 4d5ad8e9b..ce327b204 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
@@ -4,6 +4,7 @@ import org.bukkit.Server;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.ChatColor;
public class Commandrealname extends EssentialsCommand
@@ -20,15 +21,15 @@ public class Commandrealname extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- String whois = args[0].toLowerCase();
+ final String whois = args[0].toLowerCase();
charge(user);
for (Player p : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- String dn = u.getDisplayName().toLowerCase();
- if (!whois.equals(dn)
- && !whois.equals(ess.getSettings().getNicknamePrefix() + dn)
- && !whois.equals(u.getName().toLowerCase()))
+ final User u = ess.getUser(p);
+ final String displayName = ChatColor.stripColor(u.getDisplayName()).toLowerCase();
+ if (!whois.equals(displayName)
+ && !displayName.equals(ChatColor.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
+ && !whois.equalsIgnoreCase(u.getName()))
{
continue;
}