SETUP: Developer
The following page is for developers, that like to hook into DeluxeShop, to expand their plugin with an easy to use shop.
Import DeluxeShop into your IDE library
First thing you need to do is adding the DeluxeShop.jar to your library of your IDE. Please check the manual of your IDE to know, how you can do that.
Creating a ShopHook
Simply create a new class which you will expand by the ShopHook. After that, let your IDE insert all needed methods.
Here are the methods explained:
Method Name
Description
Type
removeCurrency(Player, Currency, Integer);
Method, that removes a certain amount of currency from a player
void
addCurrency(Player, Currency, Integer);
Method, that adds a certain amount of currency to a player
void
setCurrency(Player, Currency, Integer);
Method, that sets the amount of currency of a player
void
hasEnoughCurrency(Player, Currency, Integer);
Returns, if the player has enough amount of a certain currency
boolean
getCurrencies();
Returns a list of the type currency in which are all currencies listed, that the plugin has
List<Currency>
getRequirements();
Returns a list of the type string in which are all requirement types listed, that your plugin can check
List<String>
meetRequirement(Player, String requirement, String req_value);
Returns, if the player meets a certain requirement
boolean
The currency class
The currency class is a simple class which contains the name of the currency and two other strings, which represent the singular and the plural name of the currency such as DOLLAR and DOLLARS
Register the shop hook
After you have finished writing all methods, you can register the shop hook, so that you can hook into DeluxeShop.
For this go e.g to your onEnable() method and add following code block:
Please make sure to add DeluxeShop as a softdependency to your plugin.yml
Last updated