mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-06-10 10:14:03 +00:00
Fix /realname
This commit is contained in:
parent
674128b3f7
commit
8afde1ccc0
1 changed files with 7 additions and 6 deletions
|
@ -4,6 +4,7 @@ import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.Util;
|
import com.earth2me.essentials.Util;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
|
||||||
public class Commandrealname extends EssentialsCommand
|
public class Commandrealname extends EssentialsCommand
|
||||||
|
@ -20,15 +21,15 @@ public class Commandrealname extends EssentialsCommand
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
String whois = args[0].toLowerCase();
|
final String whois = args[0].toLowerCase();
|
||||||
charge(user);
|
charge(user);
|
||||||
for (Player p : server.getOnlinePlayers())
|
for (Player p : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
User u = ess.getUser(p);
|
final User u = ess.getUser(p);
|
||||||
String dn = u.getDisplayName().toLowerCase();
|
final String displayName = ChatColor.stripColor(u.getDisplayName()).toLowerCase();
|
||||||
if (!whois.equals(dn)
|
if (!whois.equals(displayName)
|
||||||
&& !whois.equals(ess.getSettings().getNicknamePrefix() + dn)
|
&& !displayName.equals(ChatColor.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
|
||||||
&& !whois.equals(u.getName().toLowerCase()))
|
&& !whois.equalsIgnoreCase(u.getName()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue