java.lang.Object
io.github.somesourcecode.someguiapi.scene.gui.Gui
Direct Known Subclasses:
ChestGui

public abstract class Gui extends Object
The base class for GUIs that can be shown to players.
Since:
1.0.0
  • Field Details

    • dataHolder

      protected final ContextDataHolder dataHolder
    • dirtyFlags

      protected final EnumSet<DirtyFlag> dirtyFlags
    • inventory

      protected org.bukkit.inventory.Inventory inventory
  • Constructor Details

    • Gui

      public Gui()
  • Method Details

    • getDataHolder

      public ContextDataHolder getDataHolder()
      Returns the ContextDataHolder of this GUI.
      Returns:
      the data holder
      Since:
      2.0.0
    • getDirtyFlags

      public EnumSet<DirtyFlag> 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

      protected void setDirtyFlag(DirtyFlag flag)
      Sets the specified dirty flag.
      Parameters:
      flag - the dirty flag
      Since:
      2.0.0
    • clearDirtyFlag

      protected void clearDirtyFlag(DirtyFlag flag)
      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

      public final boolean isDirty(DirtyFlag flag)
      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

      public abstract List<org.bukkit.entity.HumanEntity> 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