Class BukkitGUIHolder
java.lang.Object
me.hsgamer.hscore.minecraft.gui.holder.GUIHolder<BukkitInventoryContext>
me.hsgamer.hscore.bukkit.gui.holder.BukkitGUIHolder
- All Implemented Interfaces:
GUIElement
The
GUIHolder for Bukkit-
Constructor Summary
ConstructorsConstructorDescriptionBukkitGUIHolder(UUID viewerID, Function<BukkitGUIHolder, org.bukkit.inventory.Inventory> inventoryFunction) Create a new holder -
Method Summary
Modifier and TypeMethodDescriptionprotected BukkitInventoryContextCreate the inventory contextvoidhandleClick(ClickEvent event) Override this method to add custom behavior.voidhandleDrag(BukkitDragEvent event) Handle the drag eventvoidOpen the inventoryvoidsetCancelDragEvent(boolean cancelDragEvent) Set whether to cancel the drag eventprotected voidsetItem(int slot, @Nullable ActionItem item) Set the item in the slotvoidsetMoveItemOnBottom(boolean moveItemOnBottom) Set whether to allow moving items in the bottom inventoryMethods inherited from class me.hsgamer.hscore.minecraft.gui.holder.GUIHolder
canSetItem, getButtonMap, getInventoryContext, getItem, getItemMap, getViewerID, handleClose, handleOpen, init, open, setButtonMap, stop, update
-
Constructor Details
-
BukkitGUIHolder
public BukkitGUIHolder(UUID viewerID, Function<BukkitGUIHolder, org.bukkit.inventory.Inventory> inventoryFunction) Create a new holder- Parameters:
viewerID- the unique ID of the viewerinventoryFunction- the function to create the inventory
-
-
Method Details
-
setMoveItemOnBottom
public void setMoveItemOnBottom(boolean moveItemOnBottom) Set whether to allow moving items in the bottom inventory- Parameters:
moveItemOnBottom- true to allow
-
setCancelDragEvent
public void setCancelDragEvent(boolean cancelDragEvent) Set whether to cancel the drag event- Parameters:
cancelDragEvent- true to cancel
-
createInventoryContext
Description copied from class:GUIHolderCreate the inventory context- Specified by:
createInventoryContextin classGUIHolder<BukkitInventoryContext>- Returns:
- the inventory context
-
setItem
Description copied from class:GUIHolderSet the item in the slot- Specified by:
setItemin classGUIHolder<BukkitInventoryContext>- Parameters:
slot- the slotitem- the item
-
open
Description copied from class:GUIHolderOpen the inventory- Specified by:
openin classGUIHolder<BukkitInventoryContext>- Parameters:
uuid- the unique ID of the player
-
handleClick
Description copied from class:GUIHolderOverride this method to add custom behavior.- Overrides:
handleClickin classGUIHolder<BukkitInventoryContext>
-
handleDrag
Handle the drag event- Parameters:
event- the event
-