Package studio.magemonkey.genesis.api
Class GenesisAPI
java.lang.Object
studio.magemonkey.genesis.api.GenesisAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEnabledAddon(GenesisAddon addon) Add an addon to the pluginvoidaddItemToShop(org.bukkit.inventory.ItemStack menuItem, GenesisBuy shopItem, GenesisShop shop) Add a new item to a shopvoidaddShop(GenesisShop shop) Add a shop to the plugincreateGenesisBuy(String name, GenesisRewardType rewardType, GenesisPriceType priceType, Object reward, Object price, String msg, int location, String permission) Create a new itemcreateGenesisBuy(GenesisRewardType rewardType, GenesisPriceType priceType, Object reward, Object price, String msg, int location, String permission) Create a buy itemcreateGenesisBuyCustom(String name, GenesisRewardType rewardType, GenesisPriceType priceType, GenesisCustomLink reward, Object price, String msg, int location, String permission) Creates a custom itemcreateGenesisBuyCustom(GenesisRewardType rewardType, GenesisPriceType priceType, GenesisCustomLink reward, Object price, String msg, int location, String permission) createGenesisCustomLink(GenesisCustomActions actions, int actionId) intCreate the next id of a shopvoidAdd items to shopGets the name of the addon for GenesisGet all items in all shopsgetAllShopItems(String configOption) Get all items from configGet a Genesis ShopGet the managers for the shopbooleanCheck if a shop is validbooleanisValidShop(org.bukkit.inventory.Inventory i) Check if a shop is validvoidOpen a shop for a player by the name of the shopvoidopenShop(org.bukkit.entity.Player p, GenesisShop shop) Opens a shop for a player by the shop instancevoidRegister a condition typevoidRegister an item data partvoidRegister a price typevoidRegister a reward typevoidupdateInventory(org.bukkit.entity.Player p) Updates the inventory for a playervoidupdateInventory(org.bukkit.entity.Player p, boolean forceNewCreation) Updates the inventory
-
Constructor Details
-
GenesisAPI
-
-
Method Details
-
getAddon
Gets the name of the addon for Genesis- Parameters:
addonname- the name of the addon- Returns:
- addon
-
isValidShop
Check if a shop is valid- Parameters:
v- the inventory to check- Returns:
- valid shop or not
-
isValidShop
public boolean isValidShop(org.bukkit.inventory.Inventory i) Check if a shop is valid- Parameters:
i- inventory- Returns:
- valid or not
-
getShop
Get a Genesis Shop- Parameters:
name- the name of the shop- Returns:
- shop
-
openShop
Open a shop for a player by the name of the shop- Parameters:
p- the player to open the shop forname- the name of the shop
-
openShop
Opens a shop for a player by the shop instance- Parameters:
p- the player to open forshop- the shop to open
-
updateInventory
public void updateInventory(org.bukkit.entity.Player p) Updates the inventory for a player- Parameters:
p- player to update for
-
updateInventory
public void updateInventory(org.bukkit.entity.Player p, boolean forceNewCreation) Updates the inventory- Parameters:
p- the player to update forforceNewCreation- should it be forced
-
getShopHandler
Get the managers for the shop- Returns:
- managers
-
addShop
Add a shop to the plugin- Parameters:
shop- the shop to add
-
createNextShopId
public int createNextShopId()Create the next id of a shop- Returns:
- the id
-
addItemToShop
public void addItemToShop(org.bukkit.inventory.ItemStack menuItem, GenesisBuy shopItem, GenesisShop shop) Add a new item to a shop- Parameters:
menuItem- the item to addshopItem- shop itemshop- the shop to add to
-
finishedAddingItemsToShop
Add items to shop- Parameters:
shop- the shop to add to
-
registerConditionType
Register a condition type- Parameters:
type- the type of condition to register
-
registerPriceType
Register a price type- Parameters:
type- the price type to register
-
registerRewardType
Register a reward type- Parameters:
type- the reward type to register
-
registerItemDataPart
Register an item data part- Parameters:
part- part to add
-
createGenesisBuy
public GenesisBuy createGenesisBuy(String name, GenesisRewardType rewardType, GenesisPriceType priceType, Object reward, Object price, String msg, int location, String permission) Create a new item- Parameters:
name- the name of the itemrewardType- the reward type of the itempriceType- the price type of the itemreward- the reward of the itemprice- the price of the itemmsg- the message of the itemlocation- the location of the itempermission- the permission of the item- Returns:
- created item
-
createGenesisBuyCustom
public GenesisBuy createGenesisBuyCustom(String name, GenesisRewardType rewardType, GenesisPriceType priceType, GenesisCustomLink reward, Object price, String msg, int location, String permission) Creates a custom item- Parameters:
name- name of itemrewardType- reward typepriceType- price typereward- rewardprice- pricemsg- msglocation- locationpermission- permission- Returns:
- custom item
-
createGenesisBuy
public GenesisBuy createGenesisBuy(GenesisRewardType rewardType, GenesisPriceType priceType, Object reward, Object price, String msg, int location, String permission) Create a buy item- Parameters:
rewardType- reward typepriceType- price typereward- rewardprice- pricemsg- msglocation- locationpermission- permission- Returns:
- buy item
-
createGenesisBuyCustom
public GenesisBuy createGenesisBuyCustom(GenesisRewardType rewardType, GenesisPriceType priceType, GenesisCustomLink reward, Object price, String msg, int location, String permission) -
createGenesisCustomLink
-
getAllShopItems
Get all items in all shops- Returns:
- list of all items
-
getAllShopItems
Get all items from config- Parameters:
configOption-- Returns:
-
addEnabledAddon
Add an addon to the plugin- Parameters:
addon- the addon to add
-