Class ChestGui
java.lang.Object
io.github.somesourcecode.someguiapi.scene.gui.Gui
io.github.somesourcecode.someguiapi.scene.gui.ChestGui
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
Represents a GUI that can be shown to players.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionChestGui(net.kyori.adventure.text.Component title, int rows) Constructs a new ChestGui with the specified title and number of rows. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.inventory.InventoryintgetRows()Returns the number of rows of this GUI.getScene()Returns theSceneof this GUI.net.kyori.adventure.text.ComponentgetTitle()Returns the title of this GUI.List<org.bukkit.entity.Player>Returns a list of players that are currently viewing this GUI.voidsetRows(int rows) Sets the number of rows of this GUI.voidSets theSceneof this GUI.voidsetTitle(net.kyori.adventure.text.Component title) Sets the title of this GUI.voidshow(org.bukkit.entity.Player player) Shows this GUI to the specified player.
-
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 titlerows- the number of rows
-
-
Method Details
-
show
public void show(org.bukkit.entity.Player player) Description copied from class:GuiShows this GUI to the specified player. -
getScene
Returns theSceneof this GUI.- Returns:
- the scene
-
setScene
Sets theSceneof this GUI.- Parameters:
scene- the scene
-
getTitle
public net.kyori.adventure.text.Component getTitle()Returns the title of this GUI.- Returns:
- the title
-
setTitle
public void setTitle(net.kyori.adventure.text.Component title) Sets the title of this GUI.- Parameters:
title- the title
-
getRows
public int getRows()Returns the number of rows of this GUI.- Returns:
- the number of rows
-
setRows
public void setRows(int rows) Sets the number of rows of this GUI.- Parameters:
rows- the number of rows
-
getInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()- Specified by:
getInventoryin interfaceorg.bukkit.inventory.InventoryHolder
-
getViewers
Description copied from class:GuiReturns a list of players that are currently viewing this GUI.- Specified by:
getViewersin classGui- Returns:
- a list of players viewing this GUI
-