Class CreatedSlots.Builder
java.lang.Object
com.trevlar.slotkit.api.slot.CreatedSlots.Builder
- Enclosing class:
CreatedSlots
Configures one group of slots. Ends with
register().-
Method Summary
Modifier and TypeMethodDescriptionactiveCount(IntSupplier count) Library use: slots from this count on are inert, on both sides (SlotSpec.activeCount).category(SlotGroupCategory category) What the group is, in the slot group registry's terms.Slot-group id within the panel.Display label for these slots' names.Panel id, unique per group.register()Builds the standaloneMenuPanelandCreatedSlotGroup, creates theCreatedSlots over aStorageContainerAdapter, and appends them to the menu through vanilla'saddSlot, which keeps the sync-tracking lists consistent.replacing(int flatStart) Library use: put the slots in place of the ones atflatStartonward (an on-demand instance reusing a removed one's), instead of appending them.revealWhen(BooleanSupplier clientReveal) Client-side reveal predicate.Where items live.
-
Method Details
-
panel
Panel id, unique per group. Used for inertness and render anchoring. -
group
Slot-group id within the panel. -
category
What the group is, in the slot group registry's terms. Required; seeSlotSpec.at(String, SlotGroupCategory)for why there is no default. The group is listed under it inSlotGroupCategories.of(menu)on every menu it sits on. -
storage
Where items live. Required. Use storage bound from aStorageAttachmentto persist content, or aKeyedStorage(which declares its ownPersistentContainerKey) to persist per-slot state as well. -
activeCount
Library use: slots from this count on are inert, on both sides (SlotSpec.activeCount). -
replacing
Library use: put the slots in place of the ones atflatStartonward (an on-demand instance reusing a removed one's), instead of appending them. -
revealWhen
Client-side reveal predicate. The panel, and so the whole group, is visible and usable on the client only while this returns true; the server keeps the slots syncing either way (see the class doc). Must be client-safe. If unset, the group is always visible on the client. -
label
Display label for these slots' names. Each slot is named"<label> <ordinal>", or just"<label>"for a single slot, registered against the slot's address soWindowSignals.hoveredName()and a consumer'sSlotNameslookup return it. Defaults to the capitalizedgroupId. A consumer can still set a specific name for one slot withSlotNames.override(address, name)afterwards. -
register
Builds the standaloneMenuPanelandCreatedSlotGroup, creates theCreatedSlots over aStorageContainerAdapter, and appends them to the menu through vanilla'saddSlot, which keeps the sync-tracking lists consistent. Returns the result.
-