パッケージ構成と Mixin
この技術リファレンスでは、パッケージ構造、コード配置、Mixin 注入先の一覧を解説します。
📊 パッケージアーキテクチャ図
text
net.vanillaoutsider.speedometer
├── SpeedometerMod.java <-- Constants & Identifier definitions
├── client
│ ├── SpeedometerClient.java <-- ClientModInitializer entrypoint
│ ├── DebugEntrySpeedometer.java <-- Custom DebugScreenEntry implementation
│ └── DebugEntryPlayerSpeedWrapper.java <-- Interceptor spy-wrapper for player_speed
└── mixin
├── DebugScreenEntriesMixin.java <-- Hooks into DebugScreenEntries static init
└── DebugScreenEntryListMixin.java <-- Enforces default IN_OVERLAY status🧩 Mixin 注入ターゲット一覧表
| Mixin クラス | 対象 Minecraft クラス | 対象メソッド / ポイント | 注入タイプ | 目的 |
|---|---|---|---|---|
DebugScreenEntriesMixin | net.minecraft.client.gui.components.debug.DebugScreenEntries | <clinit> @At("TAIL") | @Inject | speedometer エントリ ID を登録し、ネイティブの player_speed が存在する場合はラッパーで保護します。 |
DebugScreenEntriesMixin | net.minecraft.client.gui.components.debug.DebugScreenEntries | register | @Invoker | プライベートなバニラメソッド register(Identifier, DebugScreenEntry) を呼び出します。 |
DebugScreenEntryListMixin | net.minecraft.client.gui.components.debug.DebugScreenEntryList | rebuildCurrentList @At("HEAD") | @Inject | speedometer の状態がデフォルトで DebugScreenEntryStatus.IN_OVERLAY になるよう強制します。 |
🔒 スレッドセーフと非ブロッキング保証
- すべての Mixin 注入は Minecraft のクライアント描画スレッドでのみ実行されます。
- ロックを使用しない非ブロッキング実装により、フレームドロップ皆無 ($<0.001\text{ ms}$) を保証します。
