aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/devenv/EarlyInstantiateTranslations.java
blob: ef8c9eb58a0356fa2ac9a0d71e6cc0ad288a526c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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();
	}
}