Class OpenGUI
java.lang.Object
me.tippie.tippieutils.v1_2_0.guis.OpenGUI
-
Method Summary
Modifier and TypeMethodDescriptionBiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI>The general click consumer for this open GUI.org.bukkit.inventory.InventoryThe inventory of the GUI.TheGuiManagertracking this GUI.@NotNull StringgetName()The name of this GUIBiConsumer<org.bukkit.event.inventory.InventoryCloseEvent,OpenGUI>The consumer ran when the inventory is closedHashMap<Integer,BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI>>getSlots()A hashmap containing the slot specific consumers for each slot set.org.bukkit.entity.PlayerThe player viewing this GUI.booleanWhether the generalClickConsumer of this OpenGUI must always run even when there is a slot specific consumer.booleanWhether the next time this inventory attempts to close it should be kept open or not.voidsetAlwaysRunGeneralConsumer(boolean alwaysRunGeneralConsumer)Whether the generalClickConsumer of this OpenGUI must always run even when there is a slot specific consumer.voidsetCancelNextClose(boolean cancelNextClose)Whether the next time this inventory attempts to close it should be kept open or not.voidsetGeneralClickConsumer(BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI> generalClickConsumer)The general click consumer for this open GUI.voidsetInventory(org.bukkit.inventory.Inventory inventory)The inventory of the GUI.voidThe name of this GUIvoidsetOnClose(BiConsumer<org.bukkit.event.inventory.InventoryCloseEvent,OpenGUI> onClose)The consumer ran when the inventory is closedvoidsetSlot(int slot, org.bukkit.inventory.ItemStack item, BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI> consumer)Sets the item in the slot to the item.voidSets the title of the open GUI.
-
Method Details
-
setSlot
public void setSlot(int slot, org.bukkit.inventory.ItemStack item, BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI> consumer)Sets the item in the slot to the item.- Parameters:
slot- The slot to set the item in.item- The item to set.consumer- The consumer to run when the item is clicked.- See Also:
GuiBuilder.setSlot(int, ItemStack, BiConsumer)
-
setTitle
Sets the title of the open GUI.- Parameters:
title- The title to set.
-
getName
The name of this GUI -
getInventory
public org.bukkit.inventory.Inventory getInventory()The inventory of the GUI. -
getViewer
public org.bukkit.entity.Player getViewer()The player viewing this GUI. -
getSlots
public HashMap<Integer,BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI>> getSlots()A hashmap containing the slot specific consumers for each slot set. -
getOnClose
The consumer ran when the inventory is closed -
getGeneralClickConsumer
public BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI> getGeneralClickConsumer()The general click consumer for this open GUI. -
isAlwaysRunGeneralConsumer
public boolean isAlwaysRunGeneralConsumer()Whether the generalClickConsumer of this OpenGUI must always run even when there is a slot specific consumer. -
getManager
TheGuiManagertracking this GUI. -
isCancelNextClose
public boolean isCancelNextClose()Whether the next time this inventory attempts to close it should be kept open or not.- Returns:
- if the next time this inventory attempts to close it should be kept open or not.
-
setName
The name of this GUI -
setInventory
public void setInventory(org.bukkit.inventory.Inventory inventory)The inventory of the GUI. -
setOnClose
public void setOnClose(BiConsumer<org.bukkit.event.inventory.InventoryCloseEvent,OpenGUI> onClose)The consumer ran when the inventory is closed -
setGeneralClickConsumer
public void setGeneralClickConsumer(BiConsumer<org.bukkit.event.inventory.InventoryClickEvent,OpenGUI> generalClickConsumer)The general click consumer for this open GUI. -
setAlwaysRunGeneralConsumer
public void setAlwaysRunGeneralConsumer(boolean alwaysRunGeneralConsumer)Whether the generalClickConsumer of this OpenGUI must always run even when there is a slot specific consumer. -
setCancelNextClose
public void setCancelNextClose(boolean cancelNextClose)Whether the next time this inventory attempts to close it should be kept open or not.- Parameters:
cancelNextClose- Whether the next time this inventory attempts to close it should be kept open or not.
-