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
|
@Override
|
||||||
public void payUser(final User reciever, final BigDecimal value) throws ChargeException, MaxMoneyException {
|
public void payUser(final User reciever, final BigDecimal value) throws Exception {
|
||||||
if (value.signum() == 0) {
|
if (value.compareTo(BigDecimal.ZERO) < 1) {
|
||||||
return;
|
throw new Exception(tl("payMustBePositive"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canAfford(value)) {
|
if (canAfford(value)) {
|
||||||
setMoney(getMoney().subtract(value));
|
setMoney(getMoney().subtract(value));
|
||||||
reciever.setMoney(reciever.getMoney().add(value));
|
reciever.setMoney(reciever.getMoney().add(value));
|
||||||
|
|
Loading…
Reference in a new issue