diff options
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/devenv/EarlyInstantiateTranslations.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/devenv/EarlyInstantiateTranslations.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/devenv/EarlyInstantiateTranslations.java b/src/main/java/moe/nea/firmament/mixins/devenv/EarlyInstantiateTranslations.java new file mode 100644 index 0000000..ef8c9eb --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/devenv/EarlyInstantiateTranslations.java @@ -0,0 +1,19 @@ +package moe.nea.firmament.mixins.devenv; + +import net.minecraft.text.TranslatableTextContent; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(TranslatableTextContent.class) +public abstract class EarlyInstantiateTranslations { + @Shadow + protected abstract void updateTranslations(); + + @Inject(method = "<init>", at = @At("TAIL")) + private void onInit(String key, String fallback, Object[] args, CallbackInfo ci) { + updateTranslations(); + } +} |