Use a player's real name in /balance if they are vanished

This commit is contained in:
Chris Ward 2013-10-19 21:40:01 +11:00 committed by KHobbits
parent 3e9a2377a8
commit 4ea629628d

View File

@ -24,7 +24,7 @@ public class Commandbalance extends EssentialsCommand
} }
User target = getPlayer(server, args, 0, true, true); User target = getPlayer(server, args, 0, true, true);
sender.sendMessage(_("balanceOther", target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess))); sender.sendMessage(_("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess)));
} }
@Override @Override
@ -34,7 +34,7 @@ public class Commandbalance extends EssentialsCommand
{ {
final User target = getPlayer(server, args, 0, true, true); final User target = getPlayer(server, args, 0, true, true);
final BigDecimal bal = target.getMoney(); final BigDecimal bal = target.getMoney();
user.sendMessage(_("balanceOther", target.getDisplayName(), NumberUtil.displayCurrency(bal, ess))); user.sendMessage(_("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(bal, ess)));
} }
else if (args.length < 2) else if (args.length < 2)
{ {