Class InventoryGUIDisplay<H extends GUIHolder<?>>

java.lang.Object
me.hsgamer.hscore.ui.BaseDisplay<H>
me.hsgamer.hscore.minecraft.gui.GUIDisplay<H>
me.hsgamer.hscore.minecraft.gui.InventoryGUIDisplay<H>
Type Parameters:
H - the type of the holder
All Implemented Interfaces:
Display, Initializable, Updatable
Direct Known Subclasses:
BukkitGUIDisplay, MinestomGUIDisplay

public abstract class InventoryGUIDisplay<H extends GUIHolder<?>> extends GUIDisplay<H>
An implementation of GUIDisplay for Inventory-based GUI
  • Constructor Details

    • InventoryGUIDisplay

      protected InventoryGUIDisplay(@NotNull @NotNull UUID uuid, @NotNull H holder)
      Create a new display
      Parameters:
      uuid - the unique id
      holder - the holder
  • Method Details

    • initInventory

      protected abstract void initInventory()
      Initialize the inventory
    • clearInventory

      protected abstract void clearInventory()
      Clear the inventory
    • getInventorySize

      protected abstract InventorySize getInventorySize()
      Get the size of the inventory
      Returns:
      the size
    • setButton

      protected abstract void setButton(int slot, @Nullable @Nullable Item item)
      Get the title of the inventory
      Parameters:
      slot - the slot
      item - the item
    • handleEvent

      public void handleEvent(ViewerEvent event)
      Description copied from class: GUIDisplay
      Handle the event
      Specified by:
      handleEvent in class GUIDisplay<H extends GUIHolder<?>>
      Parameters:
      event - the event
    • init

      public void init()
      Description copied from interface: Initializable
      Initialize some properties for the object
    • stop

      public void stop()
      Description copied from interface: Initializable
      Stop the object
    • update

      public void update()
      Description copied from interface: Updatable
      Update the updatable object
    • getViewedButton

      public Optional<DisplayButton> getViewedButton(int slot)
      Get the viewed button at the slot
      Parameters:
      slot - the slot
      Returns:
      the viewed button
    • getViewedButtons

      public Map<Integer,DisplayButton> getViewedButtons()
      Get the viewed buttons
      Returns:
      the viewed buttons