🐛 TSB 経路の outdated_rig と variant gate を修正し headless 検証基盤を追加 - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
v1.10.2 の取り込み作業中に見つかった TSB 経路のバグ 2 件を修正し、あわせて Blockbench と Minecraft サーバを起動せずに datapack の生成物を検査するテスト基盤を新設する。
主な変更点
バグ修正
dir remove/outdated_rigが古い locator / camera を削除できていなかった (1.20.4-tsb/global.mcb)3 つの誤りが重なっていた。
1 番目の時点で対象が空になり、直後の
execute store resultでカウンタが 0 に落ちるため、ループが一度も回らない状態だった。rig を更新しても前の export の locator / camera が残り続ける。default Variant のみの blueprint で root On-Apply Function が出力されない (
1.20.4-tsb/main.mcb,datapackCompiler/index.ts)variant の一覧には default が常に含まれるため、従来の「2 個以上」という条件は実質「カスタム variant がある」を意味していた。加えて variant metadata の生成が animation の有無で囲われており、animation を持たない blueprint では dispatch 用のフラグ自体が書かれていなかった。
needs_variant_functions(カスタム variant / On-Apply Function / variant keyframe のいずれかがある) を導入し、variant 関連の出力を animation の有無から独立させた。metadata は空でも毎回上書きし、出力しない構成では明示的に削除する (この経路は on_load で cleanup を呼ばない方針のため、上書きされない path が残り続ける)。発火は apply 時のみで、summon 直後の自動実行はしない。
テスト基盤
compileMcbProjectを Node から直接呼び、.mcbから生成された mcfunction の内容を検査する。plugin 本体の export 処理は Blockbench の runtime に依存して Node 上では動かないが、テンプレートのコンパイル部分は入力を自前で組めば回せる。動作確認
yarn test= 4 files passed / 1 skipped、43 passedyarn prod= 0 warnings / 0 errors実機 (Blockbench / Minecraft サーバ) での検証は未実施。
注意
テストで
deepslateの一部 subpath が解決できないため、vitest.config.tsに alias を追加している。production のビルドでは同等の解決を独自 plugin が行っており、参照先の実体は同一。未対応
作業中に見つかった以下はタスク管理へ記録し、本 PR のスコープ外とした。
テスト側では、variant 適用の呼び出し経路のうち wrapper 経由のみを検証しており、アニメーションのキーフレームから切り替わる経路は未整備。