5.0.0: Slots now say what they are and what may be done to them, and placement names its parts. Three changes, one of them breaking.
Slot groups are a registry. Created slot groups appear next to the vanilla categories, and the registry answers without a menu open. `SlotGroupCategories.all()` lists every category that exists. `SlotGroupCategories.of(menu)` lists the slots in each category on an open menu. `SlotGroupCategories.categoriesBySlot(menu)` answers per slot. A mod mints its own category when no vanilla one fits.
Operations are a named, open vocabulary. An operation is a bulk or shortcut action on a slot. Vanilla ships three: shift-click (`QUICK_MOVE`), double-click collect (`COLLECT`), and drag-fill (`DRAG_FILL`). Any mod defines its own operation as a `BehaviorKey` and publishes it with `SlotOperations.define`, so other mods find it through `SlotOperations.all()`. A slot resolves an operation from its own declaration first, then its group, then the group's category, then the key's default. That order is specificity, not load order, so two mods declaring at different levels no longer depend on which loaded first. `SlotOperations.inherent(category, operation, value)` sets a category-wide answer once. `COLLECT` and `DRAG_FILL` are window keys on any slot kind; Containers enforces them at vanilla's own seams.
Placement has two named parts. A reference is the rectangle a panel is measured against. A region is where the panel sits relative to it. Four region enums are now two, named for the vocabulary instead of the reference they implied. `OutsideRegion` holds the eleven placements outside a rectangle. `InsideRegion` holds the nine spots on one. `Reference` replaces `ScreenBounds` and `SlotGroupBounds`, which were the same record.
A panel anchored to a slot group is measured from that one group, not from every slot sharing its category. A created group can no longer move a panel anchored to a vanilla one. `SlotGroupPanelAdapter.onGroup(SlotGroupId...)` anchors to a created group by id.
Breaking: `MenuRegion` and `SlotGroupRegion` are `OutsideRegion`. `HudRegion` and `ScreenRegion` are `InsideRegion`. `ScreenBounds` and `SlotGroupBounds` are `Reference`. `HudRegion.CENTER_CROSSHAIR_CLEARANCE` is `RegionConstants.CENTER_CROSSHAIR_CLEARANCE`. Replace the type names; the constant names inside each enum are unchanged. The registry and operations add API and break nothing on their own.
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }