Package me.hsgamer.hscore.minestom.gui
Class GUIHolder
- All Implemented Interfaces:
Holder<GUIDisplay>,Initializable,Updatable
The base
Holder for UI in Minestom-
Field Summary
Fields inherited from class me.hsgamer.hscore.ui.BaseHolder
displayMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the button mapGet the close filternet.minestom.server.inventory.InventoryTypeGet the inventory typenet.kyori.adventure.text.ComponentGet the title for the unique idGet the title functionvoidinit()booleanCheck if the holder should remove the display on its closeprotected GUIDisplaynewDisplay(UUID uuid) protected voidonClick(net.minestom.server.event.inventory.InventoryClickEvent event) Handle click eventprotected voidonClick(net.minestom.server.event.inventory.InventoryPreClickEvent event) Handle click eventprotected voidonClose(net.minestom.server.event.inventory.InventoryCloseEvent event) Handle close eventprotected voidonOpen(net.minestom.server.event.inventory.InventoryOpenEvent event) Handle open eventvoidsetButtonMap(ButtonMap buttonMap) Set the button mapvoidsetCloseFilter(Predicate<UUID> closeFilter) Set the close filtervoidsetInventoryType(net.minestom.server.inventory.InventoryType inventoryType) Set the inventory typevoidsetRemoveDisplayOnClose(boolean removeDisplayOnClose) Set that the display should be removed on close eventvoidsetTitle(net.kyori.adventure.text.Component title) Set the titlevoidsetTitleFunction(Function<UUID, net.kyori.adventure.text.Component> titleFunction) Set the title functionMethods inherited from class me.hsgamer.hscore.ui.BaseHolder
addEventConsumer, clearAllEventConsumer, clearEventConsumer, createDisplay, getDisplay, handleEvent, onRemoveDisplay, removeAllDisplay, removeDisplay, stop, update
-
Constructor Details
-
GUIHolder
public GUIHolder()
-
-
Method Details
-
isRemoveDisplayOnClose
public boolean isRemoveDisplayOnClose()Check if the holder should remove the display on its close- Returns:
- true if it should
-
setRemoveDisplayOnClose
public void setRemoveDisplayOnClose(boolean removeDisplayOnClose) Set that the display should be removed on close event- Parameters:
removeDisplayOnClose- whether the display should be removed on close event
-
getInventoryType
public net.minestom.server.inventory.InventoryType getInventoryType()Get the inventory type- Returns:
- the inventory type
-
setInventoryType
public void setInventoryType(net.minestom.server.inventory.InventoryType inventoryType) Set the inventory type- Parameters:
inventoryType- the inventory type
-
getTitleFunction
Get the title function- Returns:
- the title function
-
setTitleFunction
Set the title function- Parameters:
titleFunction- the title function
-
getTitle
Get the title for the unique id- Parameters:
uuid- the unique id- Returns:
- the title
- See Also:
-
setTitle
public void setTitle(net.kyori.adventure.text.Component title) Set the title- Parameters:
title- the title- See Also:
-
getCloseFilter
Get the close filter- Returns:
- the close filter
-
setCloseFilter
Set the close filter- Parameters:
closeFilter- the close filter
-
getButtonMap
Get the button map- Returns:
- the button map
-
setButtonMap
Set the button map- Parameters:
buttonMap- the button map
-
newDisplay
- Specified by:
newDisplayin classBaseHolder<GUIDisplay>
-
init
public void init() -
onOpen
protected void onOpen(net.minestom.server.event.inventory.InventoryOpenEvent event) Handle open event- Parameters:
event- the event
-
onClick
protected void onClick(net.minestom.server.event.inventory.InventoryPreClickEvent event) Handle click event- Parameters:
event- the event
-
onClick
protected void onClick(net.minestom.server.event.inventory.InventoryClickEvent event) Handle click event- Parameters:
event- the event
-
onClose
protected void onClose(net.minestom.server.event.inventory.InventoryCloseEvent event) Handle close event- Parameters:
event- the event
-