-
Notifications
You must be signed in to change notification settings - Fork 14
Quickstart: Economy Provider
Daniel V edited this page Aug 19, 2023
·
3 revisions
This page is incomplete
and valid
as of Treasury v2.0.0
.
So, you've got a plugin which directly controls the virtual economy of a server? Something along the lines of Polyconomy, TheNewEconomy, or PlayerPoints?
Not the page you were looking for? Perhaps your plugin was just an Economy Consumer? Otherwise, click here to go back.
Let's get started integrating it with Treasury!
Basically, there are plugins which server admins may install that want to interact with your economy plugin through Treasury. What you'll need to do is implement the required economy provider code understood by Treasury (see the EconomyProvider interface).
Once you've implemented the EconomyProvider interface and hooked it into your economy provider's database, you'll need to register it so that Treasury knows it exists.
final EconomyProvider econProvider = /* instantiate your economy provider */;
// register the service with Treasury
ServiceRegistry.INSTANCE.registerService(
EconomyProvider.class,
econProvider,
"MyPluginNameHere",
ServicePriority.NORMAL
);
Please contact us if you need a help at all. :)