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
| 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 |
🏗 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
- Injection au chargement de classe statique (
DebugScreenEntriesMixin) : Lors de l'initialisation (<clinit>) deDebugScreenEntries, Speedometer appelle la méthode privéeregisterpour ajouterspeedometerau registre (ENTRIES_BY_ID). - Initialisation de l'état par défaut (
DebugScreenEntryListMixin) : LorsqueDebugScreenEntryList.rebuildCurrentList()s'exécute, Speedometer vérifie la présence despeedometeret l'enregistre par défaut enIN_OVERLAY. - Spy Wrapper Replacement: Si vanilla enregistre nativement
player_speed(ex. Minecraft 26.3+),DebugScreenEntriesMixinremplace l'objet vanilla par notreDebugEntryPlayerSpeedWrapper.
