Arquitetura e Mixins
Esta referência técnica detalha a hierarquia de pacotes, organização do código e tabela de injeção Mixin.
📊 Diagrama de arquitetura de pacotes
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🧩 Tabela de detalhamento de alvos Mixin
| Classe Mixin | Classe Minecraft de destino | Método / Ponto de destino | Tipo de injeção | Propósito |
|---|---|---|---|---|
DebugScreenEntriesMixin | net.minecraft.client.gui.components.debug.DebugScreenEntries | <clinit> @At("TAIL") | @Inject | Registra o ID de entrada speedometer e envolve a entrada nativa player_speed se presente. |
DebugScreenEntriesMixin | net.minecraft.client.gui.components.debug.DebugScreenEntries | register | @Invoker | Invoca o método privado vanilla register(Identifier, DebugScreenEntry). |
DebugScreenEntryListMixin | net.minecraft.client.gui.components.debug.DebugScreenEntryList | rebuildCurrentList @At("HEAD") | @Inject | Garante que o status do speedometer seja por padrão DebugScreenEntryStatus.IN_OVERLAY. |
🔒 Segurança de threads e garantia não bloqueante
- Todas as injeções de Mixin são executadas exclusivamente na thread de renderização do cliente do Minecraft.
- A implementação não bloqueante sem travas garante zero perda de quadros ($<0.001\text{ ms}$).
