Curios slots rendering !

This commit is contained in:
2026-10-01 17:57:22 -03:00
parent ea9f3f61bb
commit f2c3cb8135
39 changed files with 1032 additions and 226 deletions
+24 -3
View File
@@ -30,11 +30,14 @@ ores), server scripts (components, events, commands, timers, storage, recipes, c
NeoForge's (menu types, slots, data, buttons and `still_valid` on the server, menu screens on the client, and the
player's inventory as menu 0, which mods can add slots to), client scripts (item and recipe lookups, plain screens,
inventory overlays, `Graphics` in GUI pixels), mod channels, worldgen features and ores, the base game's block behavior
and screens as a mod, and world time. See [Menus](modding/inventories/menus.md) and [Screens](modding/gui/index.md).
and screens as a mod, world time, and worn items (an item's `worn` model, `player.set_worn`, synced to every client and
drawn on other players and on the first person arm). See [Menus](modding/inventories/menus.md),
[Screens](modding/gui/index.md) and [Worn Models](modding/items/index.md#worn-models).
The code is in `common/mod_loader.ts`, `common/mod_data.ts`, `common/mod_check.ts`, `common/bmod.ts`,
`server/game/mod_runtime.ts`, `server/game/menu.ts`, `server/load_bmods.ts`, `client/mods.ts`, `client/menu.ts` and
`common/worldgen_loader.ts`.
`server/game/mod_runtime.ts`, `server/game/menu.ts`, `server/load_bmods.ts`, `client/mods.ts`, `client/menu.ts`,
`common/worldgen_loader.ts`, and for worn items `client/rendering/worn_renderer.ts`, `player_model.ts` and
`model_math.ts`.
**In the API types but throwing:** forms, HUD elements, keybinds, `g.slider`, `register_terrain`.
@@ -47,6 +50,10 @@ The code is in `common/mod_loader.ts`, `common/mod_data.ts`, `common/mod_check.t
API, so a mod's bundled copy is a different class. Export it from `bworld/server`, or recognize it by `name`.
- Tools only lose durability when their owner dies. Nothing else uses it.
- The GUI scale is always 3: screens work in GUI pixels like NeoForge's, but there's no option to change it yet.
- Worn models haven't been looked at in the game yet, only tested: Artifacts' power glove and feral claws and the giant
chestplate on other players, wide and slim, and on the first person arm with its equip and swing.
- Blockbench's `mirror` isn't supported in entity models, so the giant chestplate's left sleeve has the right one's
texture unflipped.
## Planned API
@@ -222,6 +229,20 @@ if (!result.canceled && result.selection === 0) player.teleport(0, 100, 0);
- The engine checks every response against the form's definition (types, ranges, option counts, text length) before mod
code sees it.
### More Worn Items
Worn items are drawn by `render_worn`, which puts an item's `worn` model on a player's parts. The same can show more:
- **Mobs' equipment.** `EntityData.equipment` is already synced but never drawn. `render_worn` can draw it on mod
entities whose bones are named like a humanoid's, and held items in their `right_arm`, like Minecraft's
`ItemInHandLayer`.
- **Other players' held items**, in their right hand the same way.
- **Hiding curio slots**, like Curios' render toggles, sent by the client and kept by the curios script.
- **A third person view.** Players would see what they wear themselves with nothing else to change, the local player has
`worn` too.
- **Glint and glowing overlays**, as `glint` and a full bright `overlay_texture` in `worn`, once the renderer has a
glint pass.
### HUD, Keybinds and Mod Channels
- `ctx.hud.register(id, { on_render(g) })` draws every frame after the world, under open screens.