Skip to content
lokka30 edited this page Dec 15, 2021 · 19 revisions

Page Information

Page Completion Valid as of Notes
🟢 100% Pre-release None

About

Treasury Logo

Treasury acts as an intermediary between consumer and provider plugins on Minecraft servers by allowing them to easily hook using our modern, multi-platform APIs. We define provider plugins as those which offer a service to the server, such as, your Permissions plugin (e.g. LuckPerms), your Economy plugin (e.g. Essentials), your Chat plugin (e.g. VentureChat) and so on.

Mission

Vault has served us all well for a decade now, gathering more than 8 million downloads, and has been the choice for economy plugins. However, its APIs have increasingly become outdated and neglected, due to its stagnant development inflicted by the author's conservatism for the project. If your change breaks a plugin that hasn't been updated for 7 years, forget it.

Treasury was created to try offer a better alternative to Vault due to the ever growing demands of server owners and plugins to achieve more, which we believe Vault is bottlenecking. We are also interested in adding other APIs, such as for land protection.

Treasury is under constant development and review by its maintainers and various contributors from the community. Our hope is that we can improve the opportunity for all server owners using Treasury in some capacity to improve their server, by allowing plugins which implement it to interact with each other in a better way.

If you wish to see our comparison of Vault and Treasury, please click here.

Who made Treasury possible?

Please view the Credits page to see the list of individuals that made Treasury what it is today.

Major Features

Novice-Friendly

Through detailed documentation and straightforward design, we hope to ensure Treasury is accessible by the majority of plugin developers on this platform, just as Vault is.

Multi-Platform

We aim to make Treasury run on different server software. Treasury can currently run on Bukkit servers (CraftBukkit, Spigot, Paper, etc), although we aim to expand into offering compatibility with Sponge, Bungee, Velocity and so on. The code has been future-proofed via Maven modules and platform-independent classes to make it seamless to do so.

Improved Concurrency

If you're using Vault with an economy plugin that needs to query a database, your server will freeze whilst it waits for the request to arrive. With Treasury, we use a specialized interface, the EconomySubscriber, to significantly decrease the potential for a plugin to lock the main thread with an API call.

Multi-Currency

Treasury makes it very simple to create multiple currencies and convert between them. There are is also a utility to parse money amounts (e.g. $2500 as a command argument). The Currency class also contains other information and utilities such as its character (e.g. $) and an amount formatter (e.g. 5.2513516 -> 5 dollars and 25 cents)

Player Accounts

Each player is entitled to their own player account, where they can have balances in multiple different currencies, e.g. Notch has 5 VoteTokens and $200 billion dollars.

UUIDs

Treasury's Economy API utilizes UUIDs instead of player names or the OfflinePlayer class. This provides advantages such as platform independence, name change support, no pointless Mojang profile lookups (which lock the main thread), and being (realistically) impossible for ID duplication to occur, for better stability.

Bank Accounts

Like player accounts, bank accounts can have balances in multiple different currencies. However, bank accounts are not owned by any sole entity, rather, they can be controlled by bank members.

Bank accounts can have zero or more bank members within it, each bank member has their own set of Bank Permissions allocated to manage what they are allowed to do with the bank account. For example, Jeff could only have the CONSULT permission so he can view the bank account's balance, but Jane has all of the bank permissions so she can deposit, withdraw, etc.

Note that Treasury does not take any control over bank transactions and member permissions, it only makes these features available to the economy provider, which instead can choose to utilize this system.

Bank accounts are very useful for land protection plugins like Factions and Towny as bank accounts can store a pool of money.

Transactions

Transactions can store information about a specific transaction, e.g., the server deposits $50 in his account from reaching a new playtime goal, which later withdraws this amount after he buys some iron ingots from the Shop GUI.

Treasury offers Transaction Events which can be optionally made available by the economy provider. If utilized, this allows plugins to spy on transactions and cancel them from happening at their choice. Currently, Transaction Events are only available for the Bukkit implementation of Treasury, but we aim to support other platforms which also have events.

'Why do we need a Vault competitor?'

The ever-popular question: to that, we have answers! To avoid bloating this post with the answer, please view the Comparison Wiki page where I explain my own comparison of Treasury against Vault. 😃

What plugins can I use with Treasury?

I am speaking with some developers about the possibility of their plugin having Treasury support.

The following plugins plan to include Treasury support:

Economy Providers

Economy Consumers

License

The MIT License, which is a very popular choice for open source software like Treasury, bringing many freedoms to those who wish to utilize the resource.