mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-13 10:04:51 +02:00
Permission essentials.balance.other is now essentials.balance.others
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1413 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
@@ -3,13 +3,11 @@ package com.earth2me.essentials.commands;
|
|||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.Util;
|
import com.earth2me.essentials.Util;
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
|
||||||
public class Commandbalance extends EssentialsCommand
|
public class Commandbalance extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private static DecimalFormat df = new DecimalFormat("0.##");
|
|
||||||
public Commandbalance()
|
public Commandbalance()
|
||||||
{
|
{
|
||||||
super("balance");
|
super("balance");
|
||||||
@@ -22,16 +20,18 @@ public class Commandbalance extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
sender.sendMessage(Util.format("balance",Util.formatCurrency(getPlayer(server, args, 0).getMoney())));
|
sender.sendMessage(Util.format("balance", Util.formatCurrency(getPlayer(server, args, 0).getMoney())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
charge(user);
|
charge(user);
|
||||||
double bal = (args.length < 1 || !user.isAuthorized("essentials.balance.other")
|
double bal = (args.length < 1
|
||||||
? user
|
|| !user.isAuthorized("essentials.balance.others")
|
||||||
: getPlayer(server, args, 0)).getMoney();
|
|| !user.isAuthorized("essentials.balance.other")
|
||||||
user.sendMessage(Util.format("balance",Util.formatCurrency(bal)));
|
? user
|
||||||
|
: getPlayer(server, args, 0)).getMoney();
|
||||||
|
user.sendMessage(Util.format("balance", Util.formatCurrency(bal)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user