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拦截包装器。
