Expand description
yog-inventory — real Minecraft Container/Menu screens for Yog mods.
Unlike yog-ui (a HUD-drawn overlay screen with no real item slots), this
crate describes actual vanilla-style inventory screens: a block’s own
slots plus, optionally, the player’s own inventory grid underneath —
backed by a real Minecraft BlockEntity/AbstractContainerMenu on the
Java side, with real drag-and-drop and network sync for free.
See DESIGN.md for the full architecture and phased plan. This crate
currently covers the data model (phase 2); the Java-side BlockEntity/
Menu/Screen plumbing lands in later phases.
Structs§
- Inventory
Def - 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).
- Slot
Layout - 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_SIZEspacing (also a vanilla convention). - SLOT_
SIZE - Vanilla spacing between adjacent slots in the default grid.
Functions§
- decode_
layout - Inverse of
encode_layout. Malformed entries are skipped. - encode_
layout - Encode an
InventoryDef’s slot layout as"x:y,x:y,..."— the wire format used when handing the layout to the Java host (mirrors howBlockDef::connect_groupsis comma-joined for its ABI struct).