Closed Caltinor closed 4 years ago
This is intentional, grand economy's native currency is not allowed to be negative either way. the enforce non-negative values option is to deal with other plugins/mods that aren't designed to go below 0 but do so anyways.
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:
I think I found out why. The
economyWrapper
does a check for the config value: https://github.com/The-Fireplace-Minecraft-Mods/Grand-Economy/blob/93687402f39d7ccc20b32b7ed2caba225f5dab08/src/main/java/the_fireplace/grandeconomy/GrandEconomy.java#L65-L72But when the
takeFromBalance
method is invoked it still returns false if the balance outcome would be negative https://github.com/The-Fireplace-Minecraft-Mods/Grand-Economy/blob/93687402f39d7ccc20b32b7ed2caba225f5dab08/src/main/java/the_fireplace/grandeconomy/econhandlers/ge/GrandEconomyEconHandler.java#L42-L43Since 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"):