Package com.burchard36.api.inventory
Class PluginInventory
java.lang.Object
com.burchard36.api.inventory.PluginInventory
The API class to create the APIs PluginInventorys
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe HashMap containing all theClickableItem
items of thisPluginInventory
, ordered by zero-based slot countsTheGuiClickAction
for this inventoryTheGuiCloseAction
for this inventoryorg.bukkit.inventory.InventoryHolder
TheInventoryHolder
of this inventoryTheGuiOpenAction
for this inventory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClickableItems(List<ClickableItem> items)
fillWith(ClickableItem item, boolean overwrite)
Fills an inventory with a specific ClickableItemfillWith(List<ClickableItem> items, boolean overwrite)
onClick(GuiClickAction clickAction)
Lambda interface called when inventory gets clickedonClose(GuiCloseAction closeAction)
Lambda interface called when inventory gets closedonOpen(GuiOpenAction openAction)
Lambda interface called when inventory gets openedvoid
open(org.bukkit.entity.Player player)
Opens an inventory to a PlayersetClickableItemAtSlot(int slot, ClickableItem item)
Adds clickable items at a slot, gets overridden by addClickableItem(ClickableItem item)setDisplayName(String displayName)
Sets the inventory display namesetInventorySize(int size)
Sets the inventory size of this Inventory, if setInventoryHolder gets called this method has no effectsetInventoryType(org.bukkit.event.inventory.InventoryType type)
Sets the inventory type of this inventory, has priority over the inventory size
-
Field Details
-
inventoryHolder
public final org.bukkit.inventory.InventoryHolder inventoryHolderTheInventoryHolder
of this inventory -
closeAction
TheGuiCloseAction
for this inventory -
openAction
TheGuiOpenAction
for this inventory -
clickAction
TheGuiClickAction
for this inventory -
clickableItems
The HashMap containing all theClickableItem
items of thisPluginInventory
, ordered by zero-based slot counts
-
-
Constructor Details
-
PluginInventory
Created a PluginInventory class- Parameters:
slots
- amount of slots for the inventory to have, multiples of 9, no higher than 54name
- name for inventory to have, supports ampersand color codes
-
-
Method Details
-
setDisplayName
Sets the inventory display name- Parameters:
displayName
- Display name to re-name the inventory, supports ampersand color codes- Returns:
- instance of this class
-
setInventorySize
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
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
Lambda interface called when inventory gets closed- Parameters:
closeAction
- GuiCloseAction method- Returns:
- instance of this class
-
onOpen
Lambda interface called when inventory gets opened- Parameters:
openAction
- GuiOpenAction method- Returns:
- instance of this class
-
onClick
Lambda interface called when inventory gets clicked- Parameters:
clickAction
- GuiClickAction method- Returns:
- instance of this class
-
setClickableItemAtSlot
Adds clickable items at a slot, gets overridden by addClickableItem(ClickableItem item)- Parameters:
slot
- Slot to add item toitem
- ClickableItem to add- Returns:
- instance of this class
-
addClickableItems
- Parameters:
items
- AList
ofClickableItem
's- Returns:
- instance of this
PluginInventory
-
fillWith
Fills an inventory with a specific ClickableItem- Parameters:
item
- ClickableItem to clickoverwrite
- if true, it will overwrite an existing item there if it exists- Returns:
- instance of this class
-
fillWith
- Parameters:
items
- AList
ofClickableItem
'soverwrite
- ABoolean
, if true all previously setClickableItem
'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
-