mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-04 04:51:41 +00:00
Add minimum-pay-amount setting to limit how little you can /pay someone.
Add 'minimumPayAmount' translatable message. Create NumberUtil#displayCurrencyExactly(BigDecimal, IEssentials).
This commit is contained in:
parent
fc8ee7f25f
commit
0a876c33a7
6 changed files with 19 additions and 0 deletions
|
@ -4,6 +4,8 @@ import com.earth2me.essentials.ChargeException;
|
|||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
@ -32,6 +34,9 @@ public class Commandpay extends EssentialsLoopCommand {
|
|||
}
|
||||
|
||||
amount = new BigDecimal(stringAmount);
|
||||
if (amount.compareTo(ess.getSettings().getMinimumPayAmount()) < 0) { // Check if amount is less than minimum-pay-amount
|
||||
throw new Exception(tl("minimumPayAmount", NumberUtil.displayCurrencyExactly(ess.getSettings().getMinimumPayAmount(), ess)));
|
||||
}
|
||||
loopOnlinePlayers(server, user.getSource(), false, user.isAuthorized("essentials.pay.multiple"), args[0], args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue