java.lang.Object
io.github.somesourcecode.someguiapi.scene.gui.Gui
io.github.somesourcecode.someguiapi.scene.gui.ChestGui
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public class ChestGui extends Gui implements org.bukkit.inventory.InventoryHolder
Represents a GUI that can be shown to players.
Since:
1.0.0
  • Constructor Details

    • ChestGui

      public ChestGui(net.kyori.adventure.text.Component title, int rows)
      Constructs a new ChestGui with the specified title and number of rows.
      Parameters:
      title - the title
      rows - the number of rows (in range 1-6)
      Since:
      1.0.0
  • Method Details

    • show

      public void show(org.bukkit.entity.HumanEntity humanEntity)
      Description copied from class: Gui
      Shows this GUI to the specified human entity.
      Specified by:
      show in class Gui
      Parameters:
      humanEntity - the human entity
    • requestRender

      public void requestRender()
      Requests a render of this GUI. This will happen automatically when layout changes. However, this method must be called whenever a change occurs that can't be picked up by the system, e.g. the change of a lore. Note that the display won't be updated until Gui.update() is called.
      Since:
      2.0.0
      See Also:
    • requestRender

      public void requestRender(boolean update)
      Requests a render of this GUI. This will happen automatically when layout changes. However, this method must be called whenever a change occurs that can't be picked up by the system, e.g. the change of a lore.
      Parameters:
      update - whether to update the GUI after requesting the render
      Since:
      2.0.0
      See Also:
    • getScene

      public Scene getScene()
      Returns the Scene of this GUI.
      Returns:
      the scene
      Since:
      1.0.0
    • setScene

      public void setScene(Scene scene)
      Sets the Scene of this GUI.
      Parameters:
      scene - the scene
      Since:
      1.0.0
    • getTitle

      public net.kyori.adventure.text.Component getTitle()
      Returns the title of this GUI.
      Returns:
      the title
      Since:
      1.0.0
    • setTitle

      public void setTitle(net.kyori.adventure.text.Component title)
      Sets the title of this GUI.
      Parameters:
      title - the title
      Since:
      1.0.0
    • getRows

      public int getRows()
      Returns the number of rows of this GUI.
      Returns:
      the number of rows
      Since:
      1.0.0
    • setRows

      public void setRows(int rows)
      Sets the number of rows of this GUI.
      Parameters:
      rows - the number of rows (in range 1-6)
      Since:
      1.0.0
    • getInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
    • getViewers

      public List<org.bukkit.entity.HumanEntity> getViewers()
      Description copied from class: Gui
      Returns a list of human entities that are currently viewing this GUI.
      Specified by:
      getViewers in class Gui
      Returns:
      a list of human entities viewing this GUI