mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
[Fix] When the minimum pay amount is zero, users are unable to pay zero.
This commit is contained in:
parent
5fda1d018b
commit
a6f1e305ef
1 changed files with 4 additions and 3 deletions
|
@ -147,10 +147,11 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
|||
}
|
||||
|
||||
@Override
|
||||
public void payUser(final User reciever, final BigDecimal value) throws ChargeException, MaxMoneyException {
|
||||
if (value.signum() == 0) {
|
||||
return;
|
||||
public void payUser(final User reciever, final BigDecimal value) throws Exception {
|
||||
if (value.compareTo(BigDecimal.ZERO) < 1) {
|
||||
throw new Exception(tl("payMustBePositive"));
|
||||
}
|
||||
|
||||
if (canAfford(value)) {
|
||||
setMoney(getMoney().subtract(value));
|
||||
reciever.setMoney(reciever.getMoney().add(value));
|
||||
|
|
Loading…
Reference in a new issue