cloudnode-pro / BankAccounts

A Minecraft economy plugin that enables players to hold multiple bank accounts.
https://modrinth.com/plugin/bankaccounts
GNU General Public License v3.0
7 stars 3 forks source link

Add Vault support #113

Closed zefir-git closed 4 months ago

zefir-git commented 4 months ago

Adds support for Vault as an economy provider. This means that you can use your money in BankAccounts with 3rd party plugins that support Vault. If you already have a Vault Economy Provider plugin (e.g. Essentials), BankAccounts will attempt to take precedence over the Vault economy.

[!NOTE] You need to enable the Vault integration in the config. It's disabled by default. https://github.com/cloudnode-pro/BankAccounts/blob/dad253525b6bc3ee9647cd01c75e2c425a921f58/src/main/resources/config.yml#L38-L44

[!IMPORTANT] After enabling/disabling the Vault integration, the server needs to be restarted for the change to take effect.

Technical Details A new account type has been added (VAULT), limited to one per player. When a player joins, if they don't have an account, a new VAULT account is created for them. The starting balance is only given if the player has no vault account and no personal accounts. Vault transactions (e.g. from 3rd party plugins) will only use the VAULT account. To pay for something in another plugin, you will need to transfer funds to your VAULT account and payment is submitted from that account. And vice-versa, when receiving money via Vault, it will go into your VAULT account. All transactions to/from Vault will show as to/from the server account. Vault does not provide information to which player the money is being sent. The VAULT account can be used as a normal account and you can make and receive payments via `/bank pay`.
zefir-git commented 4 months ago

I might have forgotten to check if Vault account is frozen before letting Vault use it

zefir-git commented 4 months ago

When running /pay without the sufficient funds, the error message is not formatted properly. pay "You do not have sufficient funds."

This isn't from BankAccounts. We have no /pay command and no such message