Architecture et Mixins
Cette référence technique détaille la hiérarchie des packages, l'organisation du code et les points d'injection Mixin.
📊 Diagramme d'architecture des packages
text
net.vanillaoutsider.speedometer
├── SpeedometerMod.java <-- Constants & Identifier definitions
├── client
│ ├── SpeedometerClient.java <-- ClientModInitializer entrypoint
│ ├── DebugEntrySpeedometer.java <-- Custom DebugScreenEntry implementation
│ └── DebugEntryPlayerSpeedWrapper.java <-- Interceptor spy-wrapper for player_speed
└── mixin
├── DebugScreenEntriesMixin.java <-- Hooks into DebugScreenEntries static init
└── DebugScreenEntryListMixin.java <-- Enforces default IN_OVERLAY status🧩 Tableau détaillé des cibles Mixin
| Classe Mixin | Classe Minecraft cible | Méthode / Point cible | Type d'injection | Objectif |
|---|---|---|---|---|
DebugScreenEntriesMixin | net.minecraft.client.gui.components.debug.DebugScreenEntries | <clinit> @At("TAIL") | @Inject | Enregistre l'ID d'entrée speedometer et enveloppe l'entrée native player_speed si présente. |
DebugScreenEntriesMixin | net.minecraft.client.gui.components.debug.DebugScreenEntries | register | @Invoker | Appelle la méthode privée vanilla register(Identifier, DebugScreenEntry). |
DebugScreenEntryListMixin | net.minecraft.client.gui.components.debug.DebugScreenEntryList | rebuildCurrentList @At("HEAD") | @Inject | Garantit que le statut de speedometer est par défaut DebugScreenEntryStatus.IN_OVERLAY. |
🔒 Sécurité des threads et garantie non bloquante
- Toutes les injections Mixin s'exécutent exclusivement sur le thread de rendu client de Minecraft.
- L'implémentation non bloquante sans verrou garantit zéro baisse de framerate ($<0.001\text{ ms}$).
