Package net.jeqo.bloons.gui
Class GUI
java.lang.Object
net.jeqo.bloons.gui.GUI
- Direct Known Subclasses:
- ExampleMenu
An abstract class that represents a GUI instance
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddItem(GUIClickableItem item) Adds an item to the GUIvoidaddItem(GUIClickableItem item, int slot) Adds an item to the GUI at a specific slotabstract GUIClickableItemborderItem(int slot) The border item that is used to create a border around the GUIabstract GUIClickableItemcantPickup(NBTItem item, int slot) The item that is displayed in the GUI but can't be picked upvoidFills all slots in the GUI with the filler itemvoidFills all empty slots in the GUI with the filler itemabstract GUIClickableItemfillerItem(int slot) The filler item that is used to fill empty slots in the GUIvoidgetItem(int slot) Gets the item in a specific slotabstract org.bukkit.inventory.InventoryThe inventory that is displayed to the playerabstract net.kyori.adventure.text.Componentname()The name that is displayed as the GUI titleabstract voidonClose(org.bukkit.entity.Player player) Determines what happens when the GUI is closedabstract voidopen(org.bukkit.entity.Player player) Determines what happens when the GUI is openedvoidSets a border around the GUI with a specific itemabstract intslots()The number of slots that are present within the GUI It should be a multiple of 9.voidstartUpdater(org.bukkit.plugin.java.JavaPlugin plugin) Starts the GUI updater to update the GUI every 20 ticks This should be executed upon the opening of the GUIvoidCancels the GUI updater to stop updating the GUI This should be executed upon the closing of the GUIThe event that is fired when the GUI is opened or triggeredabstract voidupdate()Determines what happens when the GUI is updated (this happens every 20 ticks)
- 
Constructor Details- 
GUIpublic GUI()
 
- 
- 
Method Details- 
inventorypublic abstract org.bukkit.inventory.Inventory inventory()The inventory that is displayed to the player- Returns:
- The inventory, type org.bukkit.inventory.Inventory
 
- 
namepublic abstract net.kyori.adventure.text.Component name()The name that is displayed as the GUI title- Returns:
- The name, type net.kyori.adventure.text.Component
 
- 
slotspublic abstract int slots()The number of slots that are present within the GUI It should be a multiple of 9. 27 and 54 are common values.- Returns:
- The number of slots contained within the GUI, type int
 
- 
fillerItemThe filler item that is used to fill empty slots in the GUI- Parameters:
- slot- The slot that the item is in, type int
- Returns:
- The filler item, type net.jeqo.bloons.gui.GUIClickableItem
 
- 
borderItemThe border item that is used to create a border around the GUI- Parameters:
- slot- The slot that the item is in, type int
- Returns:
- The border item, type net.jeqo.bloons.gui.GUIClickableItem
 
- 
cantPickupThe item that is displayed in the GUI but can't be picked up- Parameters:
- item- The item that can't be picked up, type net.jeqo.bloons.utils.NBTItem
- slot- The slot that the item is in, type int
- Returns:
- The item, type net.jeqo.bloons.gui.GUIClickableItem
 
- 
triggerEventThe event that is fired when the GUI is opened or triggered- Returns:
- The event, type net.jeqo.bloons.events.BloonsEvent
 
- 
onClosepublic abstract void onClose(org.bukkit.entity.Player player) Determines what happens when the GUI is closed- Parameters:
- player- The player that closed the GUI, type org.bukkit.entity.Player
 
- 
openpublic abstract void open(org.bukkit.entity.Player player) Determines what happens when the GUI is opened- Parameters:
- player- The player that opened the GUI, type org.bukkit.entity.Player
 
- 
updatepublic abstract void update()Determines what happens when the GUI is updated (this happens every 20 ticks)
- 
startUpdaterpublic void startUpdater(org.bukkit.plugin.java.JavaPlugin plugin) Starts the GUI updater to update the GUI every 20 ticks This should be executed upon the opening of the GUI- Parameters:
- plugin- The plugin that the GUI is being opened in
 
- 
stopUpdaterpublic void stopUpdater()Cancels the GUI updater to stop updating the GUI This should be executed upon the closing of the GUI
- 
addItemAdds an item to the GUI- Parameters:
- item- The item to add, type net.jeqo.bloons.gui.GUIClickableItem
 
- 
addItemAdds an item to the GUI at a specific slot- Parameters:
- item- The item to add, type net.jeqo.bloons.gui.GUIClickableItem
- slot- The slot to add the item to, type int
 
- 
getItempublic void getItem(int slot) Gets the item in a specific slot- Parameters:
- slot- The slot to get the item from, type int
 
- 
setBorderpublic void setBorder()Sets a border around the GUI with a specific item
- 
fillEmptySlotspublic void fillEmptySlots()Fills all empty slots in the GUI with the filler item
- 
fillAllSlotspublic void fillAllSlots()Fills all slots in the GUI with the filler item
 
-