Skip to content

Intégration à l'écran de débogage F3

Cette page documente comment le Compteur de vitesse s'intègre au pipeline de débogage F3 via DebugScreenEntries et DebugScreenEntryList.


📊 Fiche d'intégration au menu 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

🏗 Diagramme d'architecture

+----------------------------------------------------------------+
|                     Minecraft F3 Debug Screen                   |
+----------------------------------------------------------------+
                               |
                   DebugScreenEntries.<clinit>()
                               |
                      DebugScreenEntriesMixin
                               |
        +-----------------------+-----------------------+
        |                                               |
   register()                                      put()
   ID Speedometer                                  ID de vitesse du joueur
        |                                               |
 DebugEntrySpeedometer                     DebugEntryPlayerSpeedWrapper
   (Ligne autonome)                          (Ligne fusionnée)

⚙️ Flux de travail d'enregistrement

  1. Injection au chargement de classe statique (DebugScreenEntriesMixin) : Lors de l'initialisation (<clinit>) de DebugScreenEntries, Speedometer appelle la méthode privée register pour ajouter speedometer au registre (ENTRIES_BY_ID).
  2. Initialisation de l'état par défaut (DebugScreenEntryListMixin) : Lorsque DebugScreenEntryList.rebuildCurrentList() s'exécute, Speedometer vérifie la présence de speedometer et l'enregistre par défaut en IN_OVERLAY.
  3. Spy Wrapper Replacement: Si vanilla enregistre nativement player_speed (ex. Minecraft 26.3+), DebugScreenEntriesMixin remplace l'objet vanilla par notre DebugEntryPlayerSpeedWrapper.

🔗 Pages associées

Official documentation & web portal for Dasik Igaijinn mods.