Modern source equipment, schema 36
本页目录
本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。
This additive contract connects the portable pose operations to public equipment/appearance services. Decision: ADR-052(源码配套资料).
Use EquipmentModelBinding with a namespace:profiles/name.sourcearmor.json profile, or AppearanceBinding.equipment(...) for an independently owned display stack. Model plans derive schema 36 and require model_source_equipment_v36 plus existing equipment/appearance and item-condition capabilities. Presentation profiles must declare them. Existing bind, patch, unbind, replace, observe and receipt APIs apply; model equipment/appearance script mutations use the same contract.
{
"schemaVersion": 1,
"renderer": "source_armor",
"slot": "chest",
"modelResource": "example:models/equipment-coat-bedrock.model.json",
"nativeBones": {"body":"body", "right":"rightArm", "left":"leftArm"},
"playerModel": "example:models/player-bedrock.model.json",
"playerBones": {"body":"body", "right":"right", "left":"left"},
"mode": "matrix"
}
Fields
slot:head,chest,legs,feet; actual equipment slot must agree.modelResource: prepared BBModel/Bedrock.model.jsonsource entry.nativeBones: optional source bone → native semantic map, 1–64 entries, restricted to the selected slot's semantics. Native armor copies V1 local rotations while retaining source translation/scale.playerModel/playerBones: supplied together for a custom source body. Map source bone → exact body bone (1–64 entries). The actual prepared body asset must match; no aliases or format guessing.- At least one native or custom map is required; both can coexist.
mode:rotation(default),matrix,exact; custom-body semantics follow the pose backend contract. Matrix/exact require an explicit body. For exact mode, Forge converts the target core jointGto V1's full geometry matrixG * T(-targetPivot)before calling the portable backend; the latter then restores the garment pivot. This avoids counting the target pivot twice. Matrix graft uses current/rest joints, whose equal pivot-return factors cancel.parts: optional 1–256 subtree roots, otherwise all geometry.boundaries: optional 1–256 cut points, requiring parts. Deeper selected roots restart selection. Empty resulting geometry is valid.animation: optional{ "clip":"idle", "loop":true, "speed":1 }. Speed is finite in 0.01–16, clip names exact. Uses wearer age and independent variables. Variables andquery.anim_timeare supported; other external queries reject before commit.
Unknown fields, duplicate keys, nulls, malformed UTF-8, noncanonical paths, missing bones/models/clips and budgets reject. Profiles are at most 64 KiB; shared model/texture budgets also apply.
Resources and lifetime
ModelResourceManifest accepts type: "armor_profile" and requires source entries/dependencies in the same candidate. Its scope appends source_equipment after model_sources. Both publishing and acknowledgements need the new capability plus existing manifest/session/armor/source capabilities. Old shapes and digests remain unchanged.
The adapter prepares definitions, maps, selections and GPU readiness before publishing. Missing resources or mismatches retain the same-session applied owner. Each wearer has charged snapshots and isolated variables; actual actor replacement, removal, disconnect, owner close and resource reload retire them. At most 64 wearers per profile, also limited by the shared resource pool. Synthetic display never writes native inventory.
This contract covers native biped and custom source player third-person/equipment preview paths. Glint needs depth-writing materials. Baby, outline, trim and dye combinations fall back. First-person sleeves, full-fashion body hiding and action synchronization remain subsequent parity work. Changing the declared model, mapping or selection requires configuration/resources, not recompiling the client.
Examples
examples/presentation/equipment-source-profile.json demonstrates data/script switching. Its resource pack contains gold Bedrock and blue BBModel garments with six mode profiles. The isolated consumer command is frameworkexample source-equipment-start; the separate Forge driver uses -Dframework.sourceEquipment=true and native inventory rendering. Fixtures are not core defaults. R4's delivery ledger holds progress and source/artifact/evidence identities.