Mod support for Delver's Tally
Delver’s Tally works out which slots of another mod’s screen to sort. When it gets a screen wrong, or the screen already sorts itself, a small file called a container profile tells it what to do. A mod author ships the file in the mod. A pack maker ships it in a resource pack, for any mod, without that mod’s help.
What happens with no profile
Section titled “What happens with no profile”- Any run of two or more of the game’s own plain slots over one container sorts and gets sort buttons, as a vanilla chest does. Iron Chests needs nothing for that reason.
- That holds whether or not the slots are storage. A machine whose input slots are plain slots gets sorted too, until a profile says otherwise.
- Slots of a mod’s own slot type are left unsorted, since such a slot may refuse items or hold more than a stack.
- The player’s inventory on the screen sorts and has its buttons either way.
What a profile can say
Section titled “What a profile can say”A profile names one menu type and sets any of three things:
| Key | What Delver’s Tally does |
|---|---|
excluded |
Leaves the whole screen alone: no sort buttons, and the sort key, middle-click, and the Alt shortcuts do nothing, over the player’s inventory too. For a screen that sorts itself, or that is not storage, such as a terminal. |
own_buttons |
Hides its sort buttons over the screen’s own slots, because the screen draws buttons there. The sort key and middle-click still sort those slots, and the buttons over the player’s inventory still show. |
regions |
Treats only the listed slots of kind container as sortable, each range on its own. The slots the screen has beyond the player’s that no range lists are left alone. |
Three things follow from how a profile is read:
- A profile that is not
excludedmakes Delver’s Tally try to sort slots of the mod’s own type as well. With noregions, that is every run of two or more slots that are not the player’s, a crafting grid, or a result slot, so fuel and upgrade slots are included. A screen with any slot that is not storage needsregions. - A slot in
regionsis counted from 0, in the order the menu adds its slots. Leave out slots that refuse items or hold more than a stack. - If the screen draws buttons where Delver’s Tally puts its own over the player’s inventory,
excludedis the only setting that removes them.
Examples
Section titled “Examples”This file sorts slots 0 to 26 of the menu type mymod:crate and hides Delver’s Tally’s
buttons over them:
{ "menu": "mymod:crate", "own_buttons": true, "regions": [ { "kind": "container", "first": 0, "last": 26 } ]}This one has a screen left alone:
{ "menu": "mymod:terminal", "excluded": true}Profiles are a feature of Stope, the library Delver’s Tally is built on. Stope’s container profile format page says where the files go, lists every key and region kind, and says which file wins when two name one menu type.
Two things that page does not cover:
menuis the menu type’s registry ID, which is the mod’s to know: a mod author has it, and a pack maker finds it in the mod’s source or asks its author. A file whosemenumatches no menu type does nothing and logs no warning, so check the spelling first when a profile seems ignored.- Only the player’s own game reads profiles. A server needs no copy, with or without Delver’s Tally on it.
A mod that already depends on Stope can set a profile in code instead, and can work out the regions of a menu whose size varies, such as a backpack with tiers. Stope’s slot regions page shows how. For a menu type that already has a profile in code, ship a file: a second profile in code for one menu type is refused.
Mods with a built-in profile
Section titled “Mods with a built-in profile”Delver’s Tally ships a profile for a few mods’ screens, each only while that mod is
installed. Every one is excluded. The player guide’s
other mods section lists
them.
A profile file for one of those menu types, in a resource pack or in a mod, replaces the built-in one, so a pack maker can try another setting.
Testing a profile
Section titled “Testing a profile”- Put the file in a resource pack, turn the pack on, and open the screen. Check that the sort buttons are where you expect, or gone.
- Fill the slots in a jumbled order and press the sort key over them. Every stack should end up in order in the same slots, with nothing left on the cursor.
- Do the same on a server that does not have Delver’s Tally, where a sort is sent as a series of clicks.
If a screen will not sort with any profile, open an issue and name the mod and the screen.