-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
NtGitG edited this page Jun 12, 2026
·
1 revision
High-level map of the mod — enough to find your way in the code, not a full class diagram.
MineGlot (Forge) → MineGlotLifecycle
→ ServiceManager (config, DB, cache, translation, events, Lingua)
→ ClientShutdownManager (clean exit)
/translate, /translation → handler → TranslationOrchestrator
→ ValidationService
→ TranslationCacheApiFlow (cache → API → render)
/translation without text → ChatSelectionDecorator
→ existing GuiNewChat lines become clickable
→ click runs /translation <line>
ClientChatReceivedEvent → ChatMessageInterceptor
→ ChatMessageParser (player + message)
→ ChatTranslationFilter (target list, chat shape)
→ TranslationOrchestrator (same cache/API flow)
While selection mode is active, ChatSelectionEventHandler also marks newly received chat lines as clickable.
TranslationOrchestrator
→ fast unified cache hit? (text + target lang, skip language detection)
→ else TranslationContextResolver (Lingua if needed)
→ TranslationCacheApiFlow
→ contextual cache (text + source + target + model)
→ API via AbstractAIEngine (OpenAI / Claude)
→ store memory + RocksDB
| Layer | Role |
|---|---|
TranslationMemoryCache |
Hot entries in RAM |
TranslationStorage / RocksDB |
Persistent cache on disk |
| Recent miss TTL | Avoids hammering DB on repeated misses |
| Area | Key classes |
|---|---|
| Translation |
TranslationOrchestrator, TranslationCacheApiFlow, TranslationRenderer
|
| Chat |
ChatMessageParser, ChatTranslationFilter, ChatMessageInterceptor
|
| Cache / DB |
TranslationCache, DatabaseService, TranslationStorage
|
| AI |
AbstractAIEngine, parsers for OpenAI / Claude |
| Config |
ConfigurationManager, ModConfig
|
| UI |
ScreenManager, screens under ui/gui/screens/
|
| Commands |
CommandManager, handlers under core/command/
|
Logic that does not need Minecraft is covered under src/test/java (parser, cache, storage keys, retry policy, API request builders).
Run:
.\gradlew.bat test --no-daemon