mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
display syntax if more than one argument to avoid confusion with command purpose
more clearly, show syntax when people try to do /money give playername amount
This commit is contained in:
parent
cc1ae2c243
commit
0d9db22d81
1 changed files with 8 additions and 5 deletions
|
@ -30,17 +30,20 @@ public class Commandbalance extends EssentialsCommand
|
|||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
if (args.length < 1 || !user.isAuthorized("essentials.balance.others"))
|
||||
if (args.length == 1 && user.isAuthorized("essentials.balance.others"))
|
||||
{
|
||||
final User target = getPlayer(server, args, 0, true, true);
|
||||
final BigDecimal bal = target.getMoney();
|
||||
user.sendMessage(_("balanceOther", target.getDisplayName(), NumberUtil.displayCurrency(bal, ess)));
|
||||
}
|
||||
else if (args.length < 2)
|
||||
{
|
||||
final BigDecimal bal = user.getMoney();
|
||||
user.sendMessage(_("balance", NumberUtil.displayCurrency(bal, ess)));
|
||||
}
|
||||
else
|
||||
{
|
||||
final User target = getPlayer(server, args, 0, true, true);
|
||||
final BigDecimal bal = target.getMoney();
|
||||
user.sendMessage(_("balanceOther", target.getDisplayName(), NumberUtil.displayCurrency(bal, ess)));
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue