mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-24 06:23:59 +00:00
Reformat
This commit is contained in:
parent
ad13062117
commit
dde0b20775
380 changed files with 38917 additions and 46821 deletions
|
@ -2,54 +2,47 @@ package com.earth2me.essentials.commands;
|
|||
|
||||
import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import java.math.BigDecimal;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
import org.bukkit.Server;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Commandpay extends EssentialsLoopCommand
|
||||
{
|
||||
BigDecimal amount;
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public Commandpay()
|
||||
{
|
||||
super("pay");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
public class Commandpay extends EssentialsLoopCommand {
|
||||
BigDecimal amount;
|
||||
|
||||
String stringAmount = args[1].replaceAll("[^0-9\\.]", "");
|
||||
public Commandpay() {
|
||||
super("pay");
|
||||
}
|
||||
|
||||
if (stringAmount.length() < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
|
||||
if (args.length < 2) {
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
amount = new BigDecimal(stringAmount);
|
||||
loopOnlinePlayers(server, user.getSource(), false, user.isAuthorized("essentials.pay.multiple"), args[0], args);
|
||||
}
|
||||
String stringAmount = args[1].replaceAll("[^0-9\\.]", "");
|
||||
|
||||
@Override
|
||||
protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) throws ChargeException
|
||||
{
|
||||
User user = ess.getUser(sender.getPlayer());
|
||||
try
|
||||
{
|
||||
user.payUser(player, amount);
|
||||
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
|
||||
}
|
||||
catch (MaxMoneyException ex)
|
||||
{
|
||||
sender.sendMessage(tl("maxMoney"));
|
||||
}
|
||||
}
|
||||
if (stringAmount.length() < 1) {
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
amount = new BigDecimal(stringAmount);
|
||||
loopOnlinePlayers(server, user.getSource(), false, user.isAuthorized("essentials.pay.multiple"), args[0], args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) throws ChargeException {
|
||||
User user = ess.getUser(sender.getPlayer());
|
||||
try {
|
||||
user.payUser(player, amount);
|
||||
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
|
||||
} catch (MaxMoneyException ex) {
|
||||
sender.sendMessage(tl("maxMoney"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue