Skip to content

GenerateDefaultLanguageEvent

Package: com.hypixel.hytale.server.core.modules.i18n.event Implements: IEvent<Void> Cancellable: No

Standard event dispatched during default language generation for the i18n system. Listeners can contribute translation files by calling putTranslationFile().

FieldTypeAccessorMutableNullable
translationFilesConcurrentHashMap<String,TranslationMap>NoNo
  • translationFiles — The concurrent map of translation file names to translation maps. Accessible via putTranslationFile(String, TranslationMap).

putTranslationFile(String filename, TranslationMap translations)

Section titled “putTranslationFile(String filename, TranslationMap translations)”

Adds a translation file to the default language generation. The filename and translations must not be null.

Dispatch location not identified in decompiled source. This event may be dispatched by game modules not yet mapped.

getEventRegistry().register(GenerateDefaultLanguageEvent.class, event -> {
TranslationMap myTranslations = new TranslationMap();
myTranslations.put("myplugin.greeting", "Hello, World!");
event.putTranslationFile("myplugin.lang", myTranslations);
});
  • MessagesUpdated — Fired when translation messages are updated at runtime.