Class Gui
java.lang.Object
io.github.somesourcecode.someguiapi.scene.gui.Gui
- Direct Known Subclasses:
ChestGui
The base class for GUIs that can be shown to players.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ContextDataHolderprotected org.bukkit.inventory.Inventory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearDirtyFlag(DirtyFlag flag) Clears the specified dirty flag.protected voidClears all dirty flags.Returns theContextDataHolderof this GUI.Returns a set of dirty flags that indicate which parts of the GUI need to be updated.abstract List<org.bukkit.entity.HumanEntity>Returns a list of human entities that are currently viewing this GUI.final booleanisDirty()Returns whether this GUI is dirty.final booleanReturns whether the specified dirty flag is set.protected voidsetDirtyFlag(DirtyFlag flag) Sets the specified dirty flag.abstract voidshow(org.bukkit.entity.HumanEntity humanEntity) Shows this GUI to the specified human entity.voidupdate()Updates the GUI for all viewers.
-
Field Details
-
dataHolder
-
dirtyFlags
-
inventory
protected org.bukkit.inventory.Inventory inventory
-
-
Constructor Details
-
Gui
public Gui()
-
-
Method Details
-
getDataHolder
Returns theContextDataHolderof this GUI.- Returns:
- the data holder
- Since:
- 2.0.0
-
getDirtyFlags
Returns a set of dirty flags that indicate which parts of the GUI need to be updated.- Returns:
- the dirty flags
- Since:
- 2.0.0
-
setDirtyFlag
Sets the specified dirty flag.- Parameters:
flag- the dirty flag- Since:
- 2.0.0
-
clearDirtyFlag
Clears the specified dirty flag.- Parameters:
flag- the dirty flag- Since:
- 2.0.0
-
clearDirtyFlags
protected void clearDirtyFlags()Clears all dirty flags.- Since:
- 2.0.0
-
isDirty
public final boolean isDirty()Returns whether this GUI is dirty.- Returns:
- whether this GUI is dirty
- Since:
- 2.0.0
-
isDirty
Returns whether the specified dirty flag is set.- Parameters:
flag- the dirty flag- Returns:
- whether the dirty flag is set
- Since:
- 2.0.0
-
show
public abstract void show(org.bukkit.entity.HumanEntity humanEntity) Shows this GUI to the specified human entity.- Parameters:
humanEntity- the human entity- Since:
- 1.0.0
-
getViewers
Returns a list of human entities that are currently viewing this GUI.- Returns:
- a list of human entities viewing this GUI
- Since:
- 1.0.0
-
update
public void update()Updates the GUI for all viewers.- Since:
- 1.0.0
-