Package me.hsgamer.hscore.bukkit.gui
Class BukkitGUIHolder
java.lang.Object
me.hsgamer.hscore.ui.BaseHolder<D>
me.hsgamer.hscore.minecraft.gui.GUIHolder<BukkitGUIDisplay>
me.hsgamer.hscore.bukkit.gui.BukkitGUIHolder
- All Implemented Interfaces:
Holder<BukkitGUIDisplay>
,Initializable
,Updatable
The
GUIHolder
for Bukkit-
Field Summary
Fields inherited from class me.hsgamer.hscore.ui.BaseHolder
displayMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeAll
(List<BukkitGUIDisplay> displays) Close all displaysFunction<BukkitGUIDisplay,
org.bukkit.inventory.Inventory> Get the inventory functionorg.bukkit.event.inventory.InventoryType
Get the inventory typeorg.bukkit.plugin.Plugin
Get the pluginint
getSize()
Get the size of the inventoryvoid
init()
Initialize some properties for the objectprotected @NotNull BukkitGUIDisplay
newDisplay
(UUID uuid) Make a new displayprotected void
onDrag
(BukkitDragEvent event) Handle drag eventvoid
setInventoryFunction
(Function<BukkitGUIDisplay, org.bukkit.inventory.Inventory> inventoryFunction) Set the inventory functionvoid
setInventoryType
(org.bukkit.event.inventory.InventoryType inventoryType) Set the inventory typevoid
setSize
(int size) Set the sizevoid
Set the titlevoid
setTitleFunction
(Function<UUID, String> titleFunction) Set the title functionMethods inherited from class me.hsgamer.hscore.minecraft.gui.GUIHolder
getButtonMap, onClick, onClose, onOpen, setButtonMap, stop
Methods inherited from class me.hsgamer.hscore.ui.BaseHolder
addEventConsumer, clearAllEventConsumer, clearEventConsumer, createDisplay, getDisplay, handleEvent, handleEvent, onRemoveDisplay, removeAllDisplay, removeDisplay, update
-
Constructor Details
-
BukkitGUIHolder
public BukkitGUIHolder(org.bukkit.plugin.Plugin plugin) Create a new holder- Parameters:
plugin
- the plugin
-
-
Method Details
-
getPlugin
public org.bukkit.plugin.Plugin getPlugin()Get the plugin- Returns:
- the plugin
-
getInventoryType
public org.bukkit.event.inventory.InventoryType getInventoryType()Get the inventory type- Returns:
- the inventory type
-
setInventoryType
public void setInventoryType(org.bukkit.event.inventory.InventoryType inventoryType) Set the inventory type- Parameters:
inventoryType
- the inventory type
-
getSize
public int getSize()Get the size of the inventory- Returns:
- the size
-
setSize
public void setSize(int size) Set the size- Parameters:
size
- the size
-
getInventoryFunction
Get the inventory function- Returns:
- the inventory function
-
setInventoryFunction
public void setInventoryFunction(Function<BukkitGUIDisplay, org.bukkit.inventory.Inventory> inventoryFunction) Set the inventory function- Parameters:
inventoryFunction
- the inventory function
-
setTitleFunction
Set the title function- Parameters:
titleFunction
- the title function
-
setTitle
Set the title- Parameters:
title
- the title- See Also:
-
newDisplay
Description copied from class:BaseHolder
Make a new display- Specified by:
newDisplay
in classBaseHolder<BukkitGUIDisplay>
- Parameters:
uuid
- the unique id- Returns:
- the display
-
init
public void init()Description copied from interface:Initializable
Initialize some properties for the object- Specified by:
init
in interfaceInitializable
- Overrides:
init
in classGUIHolder<BukkitGUIDisplay>
-
closeAll
Description copied from class:GUIHolder
Close all displays- Overrides:
closeAll
in classGUIHolder<BukkitGUIDisplay>
- Parameters:
displays
- the list of closed displays to be closed
-
onDrag
Handle drag event- Parameters:
event
- the event
-