Interface SlotGroupLike
- All Known Implementing Classes:
SlotGroup, VirtualSlotGroup
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 TypeMethodDescriptiongetId()Returns this group's identifier.intReturns 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. ForVirtualSlotGroups, this is a read-only adapter —setStackis 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 allowsSlotGroupto returnList<MKCSlot>andVirtualSlotGroupto returnList<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
-