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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItem
(GUIClickableItem item) Adds an item to the GUIvoid
addItem
(GUIClickableItem item, int slot) Adds an item to the GUI at a specific slotabstract GUIClickableItem
borderItem
(int slot) The border item that is used to create a border around the GUIabstract GUIClickableItem
cantPickup
(NBTItem item, int slot) The item that is displayed in the GUI but can't be picked upvoid
Fills all slots in the GUI with the filler itemvoid
Fills all empty slots in the GUI with the filler itemabstract GUIClickableItem
fillerItem
(int slot) The filler item that is used to fill empty slots in the GUIvoid
getItem
(int slot) Gets the item in a specific slotabstract org.bukkit.inventory.Inventory
The inventory that is displayed to the playerabstract net.kyori.adventure.text.Component
name()
The name that is displayed as the GUI titleabstract void
onClose
(org.bukkit.entity.Player player) Determines what happens when the GUI is closedabstract void
open
(org.bukkit.entity.Player player) Determines what happens when the GUI is openedvoid
Sets a border around the GUI with a specific itemabstract int
slots()
The number of slots that are present within the GUI It should be a multiple of 9.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 GUIvoid
Cancels 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 void
update()
Determines what happens when the GUI is updated (this happens every 20 ticks)
-
Constructor Details
-
GUI
public GUI()
-
-
Method Details
-
inventory
public abstract org.bukkit.inventory.Inventory inventory()The inventory that is displayed to the player- Returns:
- The inventory, type org.bukkit.inventory.Inventory
-
name
public 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
-
slots
public 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
-
fillerItem
The 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
-
borderItem
The 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
-
cantPickup
The 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.NBTItemslot
- The slot that the item is in, type int- Returns:
- The item, type net.jeqo.bloons.gui.GUIClickableItem
-
triggerEvent
The event that is fired when the GUI is opened or triggered- Returns:
- The event, type net.jeqo.bloons.events.BloonsEvent
-
onClose
public 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
-
open
public 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
-
update
public abstract void update()Determines what happens when the GUI is updated (this happens every 20 ticks) -
startUpdater
public 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
-
stopUpdater
public void stopUpdater()Cancels the GUI updater to stop updating the GUI This should be executed upon the closing of the GUI -
addItem
Adds an item to the GUI- Parameters:
item
- The item to add, type net.jeqo.bloons.gui.GUIClickableItem
-
addItem
Adds an item to the GUI at a specific slot- Parameters:
item
- The item to add, type net.jeqo.bloons.gui.GUIClickableItemslot
- The slot to add the item to, type int
-
getItem
public void getItem(int slot) Gets the item in a specific slot- Parameters:
slot
- The slot to get the item from, type int
-
setBorder
public void setBorder()Sets a border around the GUI with a specific item -
fillEmptySlots
public void fillEmptySlots()Fills all empty slots in the GUI with the filler item -
fillAllSlots
public void fillAllSlots()Fills all slots in the GUI with the filler item
-