ShadowUI 使用文档

Block actions v11

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

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

Decision: ADR-023(源码配套资料). Task status and evidence: R4 blockActionsSlice in the delivery ledger. ModelPlan v2-v10 bytes and digests are unchanged.

BlockAnimationCommand is platform-free. It addresses binding, a namespaced dimension and integer x/y/z. The binding must be a committed v10 source-block view. The client must currently have that native skull loaded and the binding must win its selector. No native block is created or changed.

JSON
{"operation":"play","binding":"bb","dimension":"minecraft:overworld","x":6,"y":145,"z":0,
 "playback":{"clip":"rise","loop":false,"speed":1,"transitionTicks":5,"restart":true,
             "queue":["idle"],"parallel":[],"conflicts":[]}}

stop replaces playback with optional transitionTicks (default 5). It returns to the configured default pose/clip with its original clock. Playback uses exact existing clip names. Unknown names reject preparation, including unused queued/parallel clips. speed is 0.05-16, transition is 0-200 ticks, queue at most 32 clips, parallel at most four clips and conflict set at most 32 names; names are nonblank strings of at most 128 characters without control characters.

The primary plays once through its queue; loop:true loops the final clip. Parallel clips loop while the primary program is active and override only authored local TRS channels, in array order. Nonloop programs finish using actual clip durations, then transition back to the configured default. Transitions last unscaled wall-clock ticks. A frame that crosses a queue boundary blends from the last successfully displayed pose. Zero-duration clips cannot cause an unbounded loop.

With restart:false, either current/incoming conflict list naming the other primary clip returns conflict without mutation. An identical non-restarting program returns unchanged; changing options on the same active primary preserves elapsed playback while using the new speed. Restart bypasses conflicts and begins at zero. A new command has independent expression variable sessions. Ordinary owner transform/data updates retain the native action instance. Resource/default source changes, native block replacement, owner close, clear, disconnect, world change and idle-instance expiry release it.

Use ModelService.Owner.blockAction(command) after observers report a committed, ready current revision. It returns a request ID. actionStatus(context,id) returns each observer's queued, sent, delivery_uncertain, applied, unchanged, conflict, failed or retired state. Maximum 16 pending commands per observer; the most recent 64 statuses remain queryable. Capability model_block_actions_v11 is required for every current observer. Unknown/retired observers, missing capabilities, non-ready revisions and budget violations fail before dispatch to any observer.

The presentation_models stream adds block_action / block_action_receipt, carrying the applied owner sequence/revision/digest/resource generation plus an independent action sequence. One in-flight command per observer retries the identical envelope. Client retries return a cached result and never restart animation. Owner revision changes and resync retire pending receipts. Applied actions are presentation side effects and are not undone by retiring a receipt; their native lifecycle or an explicit stop controls them. Resource failure does not mutate the preceding native action. A later observer/session does not replay commands.

Behavior scripts call the registered model:block_action with the same JSON. Their profile must declare the capability and have a ready versioned model domain. Budgets and instance lifecycle remain the existing behavior contract. Script actions cannot target another owner's binding. The legacy screen-preview model:play entry remains unchanged.

Diagnostics retain successful geometry observations and add selected clip, active action, primary queue segment, action elapsed time, parallel layer names and transition progress. Native acceptance, migration, human review and release are separately recorded in the ledger.

Native command timestamps may arrive before the world tick while the prior render already consumed that tick's partial time. The adapter aligns a command up to one tick behind to the last accepted pose time. Larger rewinds and nonfinite clocks still fail; frame sampling itself remains strictly monotonic.