ShadowUI 使用文档

Source block views v10

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

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

Decision: ADR-022(源码配套资料). Parent: framework v2(源码配套资料). Task and evidence status: delivery-tasks.json, R4 sourceBlockViewsSlice.

Use ModelPlan schemaVersion: 10 and capability model_source_blocks_v10 with the existing model_bindings_v2 / model_blocks_v8. Explicit v9 transforms also require model_block_profiles_v9. Existing older block profiles do not opt in automatically.

JSON
{
  "schemaVersion": 10,
  "bindings": [],
  "blocks": [{
    "id": "display",
    "priority": 10,
    "match": {"skullType": 1},
    "profile": {
      "renderer": "source_model",
      "modelResource": "example:models/block-view-bb.model.json",
      "scale": 0.7,
      "source": {"clip": "rise", "loop": false, "speed": 2, "renderHitbox": false}
    }
  }]
}

source is accepted only with a typed BBModel/Bedrock source_model entry. Fields are strict:

Field Meaning
clip omitted Exact idle, otherwise one unambiguous case-insensitive .idle suffix; no idle means rest. Ambiguity rejects preparation.
clip: null Explicit rest pose.
clip: "name" Exact existing clip, at most 128 characters. A missing clip rejects preparation.
loop Boolean, default true; false holds the final pose at duration.
speed Finite number in 0.05–16, default 1.
renderHitbox Boolean, default false. Hides geometry directly on names normalized to hitbox; child geometry remains visible. Does not affect world collision.

Each native block has an independent clock/variable session. An unchanged source/resource profile survives priority or placement-transform patches. Replacing source prepares a fresh runtime; changing only data used outside source does not reset it. Native block replacement, owner release, clear, disconnect, world/resource changes and the 600-tick unseen-instance lease release or restart its state. The limit is 128 native instances per rule plus the common resource memory/handle budgets. Unsupported query evaluation reports fallback and does not fabricate entity facts.

Consumers use ModelService.Owner.bindBlock, patchBlock, replace, unbindBlock and their existing observer receipts. PresentationProfile model templates use schema 10 and declare required capabilities before model:block_bind / model:block_patch scripts introduce this option. Existing scripts remain bounded and data updates retain their behavior instance.

Diagnostics include sourceInstances and actual floor/wall sourceDraws: native instance ID, position, clip, elapsed time, samples, vertex count, geometry checksum, visibility and game time. These count successful deferred geometry emissions, not GPU display completion. Empty views intentionally draw no geometry and do not count a fabricated draw.

Neutral fixtures: examples/presentation/models-source-blocks-{base,alt,profile}.json. Isolated acceptance uses the ordinary block fixture with -Dframework.blockModels=true -Dframework.sourceBlocks=true on both clients, and -Dframework.font=true -Dframework.sourceBlocks=true on the local Paper server. The same candidate without sourceBlocks runs the prior v9 fixture with blockProfiles=true.

Position-command actions, queues, parallel layers, transitions, authored events and migration are still tracked separately. This contract is not a full R4 completion statement.