-
Notifications
You must be signed in to change notification settings - Fork 65
Developers
William Lebel edited this page Jun 25, 2015
·
3 revisions
To hook into Craftconomy it's really simple!
Javadoc: http://build.greatmancode.com/job/Craftconomy3/javadoc/
Simply get the plugin:
import com.greatmancode.craftconomy3.Common;
import com.greatmancode.craftconomy3.tools.interfaces.Loader;
Plugin plugin = Bukkit.getPluginmanager().getPlugin("Craftconomy3");
if (plugin != null) {
Common craftconomy = (Common) ((Loader)plugin).getCommon();
}
Craftconomy is first abstracted by a Loader because of it's multi-server support. The Common class contains all the functions you need http://build.greatmancode.com/job/Craftconomy3/javadoc/com/greatmancode/craftconomy3/Common.html to talk to the plugin.
To retrieve a account:
craftconomy.getAccountManager().getAccount("greatman321", false);
To retrieve a bank account:
craftconomy.getAccountManager().getAccount("awesomeaccount", true);
Within an Account, be sure to use the method with a Cause in it so it can be logged properly.