Class PluginInventory

java.lang.Object
com.burchard36.api.inventory.PluginInventory

public class PluginInventory extends Object
The API class to create the APIs PluginInventorys
  • Field Details

  • Constructor Details

    • PluginInventory

      public PluginInventory(int slots, String name)
      Created a PluginInventory class
      Parameters:
      slots - amount of slots for the inventory to have, multiples of 9, no higher than 54
      name - name for inventory to have, supports ampersand color codes
  • Method Details

    • setDisplayName

      public PluginInventory setDisplayName(String displayName)
      Sets the inventory display name
      Parameters:
      displayName - Display name to re-name the inventory, supports ampersand color codes
      Returns:
      instance of this class
    • setInventorySize

      public PluginInventory setInventorySize(int size)
      Sets the inventory size of this Inventory, if setInventoryHolder gets called this method has no effect
      Parameters:
      size - Size of this inventory to set it to
      Returns:
      instance of this class
    • setInventoryType

      public PluginInventory setInventoryType(org.bukkit.event.inventory.InventoryType type)
      Sets the inventory type of this inventory, has priority over the inventory size
      Parameters:
      type - InventoryType to set this Inventory to
      Returns:
      instance of this class
    • onClose

      public PluginInventory onClose(GuiCloseAction closeAction)
      Lambda interface called when inventory gets closed
      Parameters:
      closeAction - GuiCloseAction method
      Returns:
      instance of this class
    • onOpen

      public PluginInventory onOpen(GuiOpenAction openAction)
      Lambda interface called when inventory gets opened
      Parameters:
      openAction - GuiOpenAction method
      Returns:
      instance of this class
    • onClick

      public PluginInventory onClick(GuiClickAction clickAction)
      Lambda interface called when inventory gets clicked
      Parameters:
      clickAction - GuiClickAction method
      Returns:
      instance of this class
    • setClickableItemAtSlot

      public PluginInventory setClickableItemAtSlot(int slot, ClickableItem item)
      Adds clickable items at a slot, gets overridden by addClickableItem(ClickableItem item)
      Parameters:
      slot - Slot to add item to
      item - ClickableItem to add
      Returns:
      instance of this class
    • addClickableItems

      public PluginInventory addClickableItems(List<ClickableItem> items)
      Parameters:
      items - A List of ClickableItem's
      Returns:
      instance of this PluginInventory
    • fillWith

      public PluginInventory fillWith(ClickableItem item, boolean overwrite)
      Fills an inventory with a specific ClickableItem
      Parameters:
      item - ClickableItem to click
      overwrite - if true, it will overwrite an existing item there if it exists
      Returns:
      instance of this class
    • fillWith

      public PluginInventory fillWith(List<ClickableItem> items, boolean overwrite)
      File this PluginInventory with a List of ClickableItem's
      Parameters:
      items - A List of ClickableItem's
      overwrite - A Boolean, if true all previously set ClickableItem's will be overwritten
      Returns:
      instance of this PluginInventory
    • open

      public void open(org.bukkit.entity.Player player)
      Opens an inventory to a Player
      Parameters:
      player - Player to open inventory to