Class GUI

java.lang.Object
net.jeqo.bloons.gui.GUI
Direct Known Subclasses:
ExampleMenu

public abstract class GUI extends Object
An abstract class that represents a GUI instance
  • Constructor Summary

    Constructors
    Constructor
    Description
    GUI()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an item to the GUI
    void
    addItem(GUIClickableItem item, int slot)
    Adds an item to the GUI at a specific slot
    borderItem(int slot)
    The border item that is used to create a border around the GUI
    cantPickup(NBTItem item, int slot)
    The item that is displayed in the GUI but can't be picked up
    void
    Fills all slots in the GUI with the filler item
    void
    Fills all empty slots in the GUI with the filler item
    fillerItem(int slot)
    The filler item that is used to fill empty slots in the GUI
    void
    getItem(int slot)
    Gets the item in a specific slot
    abstract org.bukkit.inventory.Inventory
    The inventory that is displayed to the player
    abstract net.kyori.adventure.text.Component
    The name that is displayed as the GUI title
    abstract void
    onClose(org.bukkit.entity.Player player)
    Determines what happens when the GUI is closed
    abstract void
    open(org.bukkit.entity.Player player)
    Determines what happens when the GUI is opened
    void
    Sets a border around the GUI with a specific item
    abstract int
    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 GUI
    void
    Cancels the GUI updater to stop updating the GUI This should be executed upon the closing of the GUI
    The event that is fired when the GUI is opened or triggered
    abstract void
    Determines what happens when the GUI is updated (this happens every 20 ticks)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public abstract GUIClickableItem fillerItem(int slot)
      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

      public abstract GUIClickableItem borderItem(int slot)
      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

      public abstract GUIClickableItem cantPickup(NBTItem item, int slot)
      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.NBTItem
      slot - The slot that the item is in, type int
      Returns:
      The item, type net.jeqo.bloons.gui.GUIClickableItem
    • triggerEvent

      public BloonsEvent 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

      public void addItem(GUIClickableItem item)
      Adds an item to the GUI
      Parameters:
      item - The item to add, type net.jeqo.bloons.gui.GUIClickableItem
    • addItem

      public void addItem(GUIClickableItem item, int slot)
      Adds 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
    • 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