ShadowUI 使用文档

Owned equipment v32

状态待核对Minecraft 1.21.10 · Forge / Bukkit
本页目录

本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。

ADR-047(源码配套资料). A PresentationProfile using native equipment declares model_bindings_v2, model_item_conditions_v6 and model_equipment_v32, then provides a versioned model domain:

JSON
{
  "schemaVersion": 32,
  "bindings": [],
  "equipment": [{
    "id": "coat",
    "priority": 10,
    "slot": "chest",
    "match": {"item": "minecraft:iron_chestplate"},
    "profile": "example:profiles/equipment-chest-gold.armor.json"
  }]
}

slot is head, chest, legs or feet; the prepared resource profile must declare the same slot. match uses the existing bounded item condition grammar over a copied native item snapshot. Empty conditions, unknown keys, noncanonical resources and noninteger priorities are rejected. Priority is −100000 through 100000. Limit: 32 rules per model owner, 128 applied rules per client session. IDs share their owner's model-binding namespace.

Resources use existing strict Forge profile formats:

  • profiles/*.armor.json: schemaVersion:1, renderer:"armor_texture", slot and an exact original-texture to replacement-PNG textures map. Native geometry, pose, trims and layers remain native.
  • profiles/*.bonearmor.json: rigid/skinned GLB armor, explicit native semantic bone mappings and existing optional animation, dye and custom-player bone settings. Preparation and native eligibility retain the backend's existing constraints and fallback.

The profiles and their referenced models/textures must be available through the active resource view. A new candidate prepares complete resources before commit. Resource profile paths and match values can use existing typed data bindings in an authored profile.

Public API:

JAVA
owner.bindEquipment(new EquipmentModelBinding("coat", 10, "chest", condition, profile));
owner.patchEquipment("coat", patch);
owner.equipment("coat");
owner.unbindEquipment("coat");

Observers use existing owner.observe(context) and owner.status(context) receipts. desired() may contain a rejected desired candidate; appliedDigest and appliedRevision identify the last acknowledged applied plan. Retiring an owner withdraws its observer scopes. Other consumers' rules remain active. Same-slot/same-priority overlapping conservative item claims are rejected across owners; a different priority is an explicit override.

Scripts call model:equipment_bind with value, model:equipment_patch with id and value, and model:equipment_unbind with id. Patch fields are priority, slot, match and profile; each is replaced completely. The ID is immutable. model:clear releases the entire profile's model domain, including equipment. Scripts require the same declared capabilities as public plans.

Failed candidates retain the applied lease. Rule-only updates reuse unchanged resources without stealing another owner's lifecycle. Invalid bound data suspends the affected profile domain; recovery re-prepares its current authored template. Reload, clear, disconnect and owner retirement release resources through the existing generation fence. Local authoring overrides retain precedence; absent owned rules preserve historical/native behavior. No item, damage, durability or business fact is written by these rules.

ModernFrameworkApi.modelDiagnostics() includes equipment selection/error snapshots and current model allocation counters for local diagnosis. Successful selection is not proof of visible rendering. Native, image-review, migration, user-acceptance and release evidence remain separate in delivery-tasks.json. AW wardrobe and synthetic appearance attachments are separate pending R4 capabilities, not implicit features of this schema.