Vault

Vault

7M Downloads

Economy Question

ldfuller01 opened this issue ยท 1 comments

commented

I was wondering how different economy-management plugins are able to share the same user balances through Vault. Since the plugins all store their own balances, how is it that they're all connected through Vault? Does Vault have some sort of listener for transactions for the plugins to stay updated with balance changes? If so, where would that be and how would I use it? I've studied Vault's code, and I haven't found any signs of this listener (if it exists); or rather, I haven't found any of its code that I can understand the complexity of.

Thanks in advance.

commented

Vault doesn't share multiple economy management plugins data. It allows plugins that want to interact with any available economy to do so without having to individually link into each economy plugin and figure out which one the server has loaded.

If you have multiple economy plugins Vault registers each one with a priority. when a plugin chooses to get an economy provider the register automatically returns the highest priority economy. Or a plugin could get all registered economies and choose to interact with all of them.