Skip to content

F3 调试界面集成

本页面记录了 速度计 (Speedometer) 如何使用 DebugScreenEntriesDebugScreenEntryList 接入 Minecraft 的客户端调试渲染流水线。


📊 F3 调试整合信息框

PropertyValue
Speedometer Registry KeyIdentifier.withDefaultNamespace("speedometer")
Native Vanilla KeyIdentifier.withDefaultNamespace("player_speed")
Interface Implementednet.minecraft.client.gui.components.debug.DebugScreenEntry
Mixin Target 1net.minecraft.client.gui.components.debug.DebugScreenEntries
Mixin Target 2net.minecraft.client.gui.components.debug.DebugScreenEntryList
Default Display StateDebugScreenEntryStatus.IN_OVERLAY

🏗 架构关系图解

+----------------------------------------------------------------+
|                     Minecraft F3 Debug Screen                   |
+----------------------------------------------------------------+
                               |
                   DebugScreenEntries.<clinit>()
                               |
                      DebugScreenEntriesMixin
                               |
        +-----------------------+-----------------------+
        |                                               |
   register()                                      put()
   Speedometer 标识符                              玩家速度标识符
        |                                               |
 DebugEntrySpeedometer                     DebugEntryPlayerSpeedWrapper
   (独立行)                                   (合并行)

⚙️ 注册生命周期流程

  1. 静态类加载注入 (DebugScreenEntriesMixin): 在 DebugScreenEntries 的类加载尾部 (<clinit>),速度计调用私有静态 register 方法将 speedometer 注册进原版条目表 (ENTRIES_BY_ID)。
  2. 默认状态初始化 (DebugScreenEntryListMixin): 当 DebugScreenEntryList.rebuildCurrentList() 执行时,速度计会检查 allStatuses 中是否存在 speedometer。若不存在,则默认自动将其注册为 DebugScreenEntryStatus.IN_OVERLAY 状态。
  3. Spy Wrapper Replacement: 若原版原生注册了 player_speed(例如在 Minecraft 26.3+ 中),DebugScreenEntriesMixin 会将 ENTRIES_BY_ID 中的原版对象替换为我们的 DebugEntryPlayerSpeedWrapper 拦截包装器。

🔗 相关页面

Official documentation & web portal for Dasik Igaijinn mods.