[1.12.2] GE arbitrary enforceNonNegativeBalance config option
Caltinor opened this issue ยท 1 comments
Describe the bug
Changing the config value to false does not permit negative values. This is behavior was noticed when using the API for a mod compat implementation
To Reproduce
Steps to reproduce the behavior:
- set config option to false
- set GNC config tax rate to very short (eg. 100)
- set player balance to 5000
- create guild (survival mode for all)
- put remaining balance into guild account (E -> 3 -> enter value in center of screen and use "+" to transfer)
- claim one chunk
- claim outpost in non-adjacent chunk.
- claim land connected to the outpost but do not connect to first until only $100 remains in guild account.
- refresh guild menu to see account reduce by $30 each time taxes are applied.
- observe no more reduction in guild funds once it falls below $30.
Guild&Commerce-1.2.4d.zip
I think I found out why. The economyWrapper
does a check for the config value:
But when the takeFromBalance
method is invoked it still returns false if the balance outcome would be negative
Since you are checking the whether the balance is greater than the amount when you confirm the config is set to true, you could remove the two lines from takeFromBalance
entirely.
Logs/Screenshots/Videos
Versions (please complete the following information, do NOT say "latest"):
- Minecraft: [1.12.2]
- Mod Version: [1.12.2-2.0.0]
- Forge (If applicable) [Forge-1.12.2-14.23.5.2847]