mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-03 04:21:37 +00:00
If we are modifying money, force transaction clear, this is important.
This commit is contained in:
parent
f726035660
commit
2ac1ce4f56
1 changed files with 5 additions and 4 deletions
|
@ -115,18 +115,19 @@ public abstract class UserData extends PlayerExtension implements IConf
|
|||
}
|
||||
|
||||
public void setMoney(BigDecimal value, boolean throwError) throws MaxMoneyException
|
||||
{
|
||||
{
|
||||
BigDecimal maxMoney = ess.getSettings().getMaxMoney();
|
||||
BigDecimal minMoney = ess.getSettings().getMinMoney();
|
||||
if (value.compareTo(maxMoney) > 0)
|
||||
{
|
||||
{
|
||||
if (throwError)
|
||||
{
|
||||
throw new MaxMoneyException();
|
||||
}
|
||||
money = maxMoney;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
money = value;
|
||||
}
|
||||
if (money.compareTo(minMoney) < 0)
|
||||
|
@ -134,7 +135,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
|||
money = minMoney;
|
||||
}
|
||||
config.setProperty("money", money);
|
||||
config.save();
|
||||
stopTransaction();
|
||||
}
|
||||
private Map<String, Object> homes;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue