nikosgram / gringotts

Gringotts is an item-based economy plugin for the Bukkit Minecraft server platform. Unlike earlier economy plugins, all currency value and money transactions are based on actual items in Minecraft, per default emeralds.
https://www.spigotmc.org/resources/gringotts.42071/
BSD 2-Clause "Simplified" License
42 stars 35 forks source link

Deposited amount not handled correctly on INSUFFICIENT_SPACE #175

Open Dutch-0 opened 2 months ago

Dutch-0 commented 2 months ago

This line seems to be incorrect, since amount is simply set to 0, but some funds may have been deposited: https://github.com/nikosgram/gringotts/blob/f7ade10cb7bee162dc4967eeaadca116d921ed71/src/main/java/org/gestern/gringotts/api/impl/VaultConnector.java#L161-L163

I would submit a PR, but what is the correct Vault approach here? Should amount be the actual deposited amount, or the remaining amount (which could not be deposited)? Also is ResponseType.FAILURE correct in this case?

The vault documentation is not really helpful here: http://milkbowl.github.io/VaultAPI/net/milkbowl/vault/economy/EconomyResponse.html#amount http://milkbowl.github.io/VaultAPI/net/milkbowl/vault/economy/EconomyResponse.html#type