Interface GuiLayer


public interface GuiLayer
Represents a single layer of items in a layered GUI layout.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Gets the unique ID of the layer.
    @Nullable GuiItem
    getItem(int slot)
    Gets the interactive item in a specific slot on this layer.
    @NotNull Map<Integer,GuiItem>
    Gets all items configured on this layer.
    int
    Gets the priority of this layer.
    void
    removeItem(int slot)
    Removes the item from a specific slot on this layer.
    void
    setItem(int slot, @Nullable GuiItem item)
    Sets an interactive item in a specific slot on this layer.
  • Method Details

    • getId

      @NotNull @NotNull String getId()
      Gets the unique ID of the layer.
      Returns:
      the layer ID
    • getPriority

      int getPriority()
      Gets the priority of this layer. Layers with higher priority values override lower priority layers in slot conflicts.
      Returns:
      the layer priority
    • setItem

      void setItem(int slot, @Nullable @Nullable GuiItem item)
      Sets an interactive item in a specific slot on this layer.
      Parameters:
      slot - the inventory slot (0-indexed)
      item - the item, or null to clear the slot
    • getItem

      @Nullable @Nullable GuiItem getItem(int slot)
      Gets the interactive item in a specific slot on this layer.
      Parameters:
      slot - the inventory slot
      Returns:
      the item, or null if empty
    • removeItem

      void removeItem(int slot)
      Removes the item from a specific slot on this layer.
      Parameters:
      slot - the inventory slot
    • getItems

      @NotNull @NotNull Map<Integer,GuiItem> getItems()
      Gets all items configured on this layer.
      Returns:
      a map of slot to GuiItem