F3 除錯界面整合
本頁面記錄了 速度計 (Speedometer) 如何使用 DebugScreenEntries 與 DebugScreenEntryList 接入 Minecraft 的客戶端除錯渲染流水線。
📊 F3 除錯整合資訊框
| Property | Value |
|---|---|
| Speedometer Registry Key | Identifier.withDefaultNamespace("speedometer") |
| Native Vanilla Key | Identifier.withDefaultNamespace("player_speed") |
| Interface Implemented | net.minecraft.client.gui.components.debug.DebugScreenEntry |
| Mixin Target 1 | net.minecraft.client.gui.components.debug.DebugScreenEntries |
| Mixin Target 2 | net.minecraft.client.gui.components.debug.DebugScreenEntryList |
| Default Display State | DebugScreenEntryStatus.IN_OVERLAY |
🏗 架構關係圖解
+----------------------------------------------------------------+
| Minecraft F3 Debug Screen |
+----------------------------------------------------------------+
|
DebugScreenEntries.<clinit>()
|
DebugScreenEntriesMixin
|
+-----------------------+-----------------------+
| |
register() put()
Speedometer 識別碼 玩家速度識別碼
| |
DebugEntrySpeedometer DebugEntryPlayerSpeedWrapper
(獨立行) (合併行)⚙️ 註冊生命週期流程
- 靜態類別載入注入 (
DebugScreenEntriesMixin): 在DebugScreenEntries的類別載入尾部 (<clinit>),速度計調用私有靜態register方法將speedometer註冊進原版條目表 (ENTRIES_BY_ID)。 - 預設狀態初始化 (
DebugScreenEntryListMixin): 當DebugScreenEntryList.rebuildCurrentList()執行時,速度計會檢查allStatuses中是否存在speedometer。若不存在,則預設自動將其註冊為DebugScreenEntryStatus.IN_OVERLAY狀態。 - Spy Wrapper Replacement: 若原版原生註冊了
player_speed(例如在 Minecraft 26.3+ 中),DebugScreenEntriesMixin會將ENTRIES_BY_ID中的原版物件替換為我們的DebugEntryPlayerSpeedWrapper攔截包裝器。
