Class MycelTranslations
java.lang.Object
my.celium.org.translation.MycelTranslations
Centralised translation helpers.
Keys are namespaced per mod: key("mymod", "config.enabled") gives
"mymod.config.enabled". Mods ship their own en_us.json (and
friends) under assets/<modid>/lang/ as usual; these helpers only
remove key-building boilerplate and guarantee a missing translation can
never crash the game - it falls back to readable text plus one debug line.
Remote translation downloading is intentionally not implemented: it would add network, cache-invalidation and trust concerns to a core library. If it ever lands, it will be optional, asynchronous, cached, timeout-controlled, validated and failure-tolerant.
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.network.chat.MutableComponentComponent.translatablefor a namespaced key.static net.minecraft.network.chat.ComponentcomponentOrFallback(String modId, String path, String fallback, Object... args) Translatable component, or a literalfallbackwhen the key is missing.static booleanWhether the currently loaded language providesfullKey.static StringBuilds"<modId>.<path>"translation keys.
-
Method Details
-
key
-
component
-
componentOrFallback
public static net.minecraft.network.chat.Component componentOrFallback(String modId, String path, String fallback, Object... args) Translatable component, or a literalfallbackwhen the key is missing. Never throws: any failure (including headless environments without a loaded language) yields the fallback. -
has
Whether the currently loaded language providesfullKey.
-