Class GenesisAPI

java.lang.Object
studio.magemonkey.genesis.api.GenesisAPI

public class GenesisAPI extends Object
  • Constructor Details

    • GenesisAPI

      public GenesisAPI(Genesis plugin)
  • Method Details

    • getAddon

      public GenesisAddon getAddon(String addonname)
      Gets the name of the addon for Genesis
      Parameters:
      addonname - the name of the addon
      Returns:
      addon
    • isValidShop

      public boolean isValidShop(Object v)
      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

      public GenesisShop getShop(String name)
      Get a Genesis Shop
      Parameters:
      name - the name of the shop
      Returns:
      shop
    • openShop

      public void openShop(org.bukkit.entity.Player p, String name)
      Open a shop for a player by the name of the shop
      Parameters:
      p - the player to open the shop for
      name - the name of the shop
    • openShop

      public void openShop(org.bukkit.entity.Player p, GenesisShop shop)
      Opens a shop for a player by the shop instance
      Parameters:
      p - the player to open for
      shop - 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 for
      forceNewCreation - should it be forced
    • getShopHandler

      public GenesisShops getShopHandler()
      Get the managers for the shop
      Returns:
      managers
    • addShop

      public void addShop(GenesisShop shop)
      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 add
      shopItem - shop item
      shop - the shop to add to
    • finishedAddingItemsToShop

      public void finishedAddingItemsToShop(GenesisShop shop)
      Add items to shop
      Parameters:
      shop - the shop to add to
    • registerConditionType

      public void registerConditionType(GenesisConditionType type)
      Register a condition type
      Parameters:
      type - the type of condition to register
    • registerPriceType

      public void registerPriceType(GenesisPriceType type)
      Register a price type
      Parameters:
      type - the price type to register
    • registerRewardType

      public void registerRewardType(GenesisRewardType type)
      Register a reward type
      Parameters:
      type - the reward type to register
    • registerItemDataPart

      public void registerItemDataPart(ItemDataPart part)
      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 item
      rewardType - the reward type of the item
      priceType - the price type of the item
      reward - the reward of the item
      price - the price of the item
      msg - the message of the item
      location - the location of the item
      permission - 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 item
      rewardType - reward type
      priceType - price type
      reward - reward
      price - price
      msg - msg
      location - location
      permission - 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 type
      priceType - price type
      reward - reward
      price - price
      msg - msg
      location - location
      permission - permission
      Returns:
      buy item
    • createGenesisBuyCustom

      public GenesisBuy createGenesisBuyCustom(GenesisRewardType rewardType, GenesisPriceType priceType, GenesisCustomLink reward, Object price, String msg, int location, String permission)
    • createGenesisCustomLink

      public GenesisCustomLink createGenesisCustomLink(GenesisCustomActions actions, int actionId)
    • getAllShopItems

      public HashMap<GenesisShop,List<GenesisBuy>> getAllShopItems()
      Get all items in all shops
      Returns:
      list of all items
    • getAllShopItems

      public HashMap<GenesisConfigShop,List<GenesisBuy>> getAllShopItems(String configOption)
      Get all items from config
      Parameters:
      configOption -
      Returns:
    • addEnabledAddon

      protected void addEnabledAddon(GenesisAddon addon)
      Add an addon to the plugin
      Parameters:
      addon - the addon to add