mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-21 05:51:56 +02:00
If we are modifying money, force transaction clear, this is important.
This commit is contained in:
@@ -115,18 +115,19 @@ public abstract class UserData extends PlayerExtension implements IConf
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMoney(BigDecimal value, boolean throwError) throws MaxMoneyException
|
public void setMoney(BigDecimal value, boolean throwError) throws MaxMoneyException
|
||||||
{
|
{
|
||||||
BigDecimal maxMoney = ess.getSettings().getMaxMoney();
|
BigDecimal maxMoney = ess.getSettings().getMaxMoney();
|
||||||
BigDecimal minMoney = ess.getSettings().getMinMoney();
|
BigDecimal minMoney = ess.getSettings().getMinMoney();
|
||||||
if (value.compareTo(maxMoney) > 0)
|
if (value.compareTo(maxMoney) > 0)
|
||||||
{
|
{
|
||||||
if (throwError)
|
if (throwError)
|
||||||
{
|
{
|
||||||
throw new MaxMoneyException();
|
throw new MaxMoneyException();
|
||||||
}
|
}
|
||||||
money = maxMoney;
|
money = maxMoney;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
money = value;
|
money = value;
|
||||||
}
|
}
|
||||||
if (money.compareTo(minMoney) < 0)
|
if (money.compareTo(minMoney) < 0)
|
||||||
@@ -134,7 +135,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
|||||||
money = minMoney;
|
money = minMoney;
|
||||||
}
|
}
|
||||||
config.setProperty("money", money);
|
config.setProperty("money", money);
|
||||||
config.save();
|
stopTransaction();
|
||||||
}
|
}
|
||||||
private Map<String, Object> homes;
|
private Map<String, Object> homes;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user