Package org.yuemi.libs.api.gui
Interface GuiLayer
public interface GuiLayer
Represents a single layer of items in a layered GUI layout.
-
Method Summary
Modifier and TypeMethodDescription@NotNull StringgetId()Gets the unique ID of the layer.@Nullable GuiItemgetItem(int slot) Gets the interactive item in a specific slot on this layer.getItems()Gets all items configured on this layer.intGets the priority of this layer.voidremoveItem(int slot) Removes the item from a specific slot on this layer.voidSets an interactive item in a specific slot on this layer.
-
Method Details
-
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
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
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
Gets all items configured on this layer.- Returns:
- a map of slot to GuiItem
-