Skip to main content

Module inventory

Module inventory 

Source
Expand description

Inventory framework — real Container/Menu screens (BlockEntity-backed), as opposed to ui’s HUD-drawn overlays. See yog-inventory’s DESIGN.md.

Structs§

InventoryDef
Describes one inventory-backed screen: how many slots a mod block has, where they sit, whether the player’s own inventory is appended below, and which background texture to draw (vanilla default, or a mod’s own).
Machine
A machine in an inventory: it makes recipes of kind from what’s in its places — each a slot of the inventory holding one ingredient of one of the kind’s slots — into its result slot.
MachinePlace
One ingredient’s place: the index-th of the kind’s slot slot, in the inventory’s slot inv.
SlotLayout
Pixel position of a single slot in vanilla GUI coordinate space (the same space vanilla screens use: origin at the panel’s top-left corner, one vanilla slot = 18×18px).

Constants§

DEFAULT_PLAYER_INV_OFFSET
Default position of the player’s main inventory (3×9) relative to the panel’s top-left corner — matches vanilla furnace/chest-style screens.
PLAYER_INV_TO_HOTBAR_GAP
Extra vertical gap between the player’s main inventory and their hotbar, on top of the normal per-row SLOT_SIZE spacing (also a vanilla convention).
SLOT_SIZE
Vanilla spacing between adjacent slots in the default grid.