Interface SlotGroupLike

All Known Implementing Classes:
SlotGroup, VirtualSlotGroup

public interface SlotGroupLike
The uniform abstraction for slot groups. Consumer code programs against this interface and never needs to know whether the underlying screen is MenuKit-native (SlotGroup) or a vanilla/observed screen (VirtualSlotGroup).

Exposes the consumer query surface only — no layout metadata, no panel references, no flat-index internals. Those are MenuKit-native concepts that don't translate to observed screens.

The wildcard return type on getSlots(AbstractContainerMenu) is deliberate: SlotGroup returns List<MKCSlot> (a valid covariant override), while VirtualSlotGroup returns List<Slot>. Consumers writing group-level behavior work with Slot directly; consumers needing MKCSlot-specific behavior do an instanceof check after the call. See SlotGroup MenuKit-native implementation

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns this group's identifier.
    int
    Returns the numeric shift-click priority (higher = tried first).
    List<? extends net.minecraft.world.inventory.Slot>
    getSlots(net.minecraft.world.inventory.AbstractContainerMenu handler)
    Returns this group's slots.
    Returns where items live.
  • Method Details

    • getId

      String getId()
      Returns this group's identifier.
    • getStorage

      Storage getStorage()
      Returns where items live. For VirtualSlotGroups, this is a read-only adapter — setStack is a no-op because MenuKit doesn't mutate handlers it doesn't own.
    • getShiftClickPriority

      int getShiftClickPriority()
      Returns the numeric shift-click priority (higher = tried first).
    • getSlots

      @Internal List<? extends net.minecraft.world.inventory.Slot> getSlots(net.minecraft.world.inventory.AbstractContainerMenu handler)
      Returns this group's slots. The wildcard allows SlotGroup to return List<MKCSlot> and VirtualSlotGroup to return List<Slot>.

      Internal plumbing. Hands back raw vanilla Slots, used by the grouping engine (shift-click routing, contract verification) — no consumer caller. Consumers query a group's identity/storage/priority through the address world, not its raw slot list.

      Parameters:
      handler - the handler whose slot list contains this group's slots
      Returns:
      unmodifiable list of slots in this group