Last active
December 13, 2018 21:33
-
-
Save kitlith/863c5d64813103501cba1c511635764a to your computer and use it in GitHub Desktop.
failed translation mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.kitl.oldboosters.mixin; | |
import net.minecraft.client.resources.Locale; | |
import org.apache.logging.log4j.LogManager; | |
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.CallbackInfoReturnable; | |
@Mixin(Locale.class) | |
public abstract class MixinLocale { | |
@Shadow | |
public abstract boolean hasKey(String key); | |
@Inject(method = "translateKeyPrivate", at = @At("HEAD")) | |
private void onTryTranslateKey(String key, CallbackInfoReturnable<String> ci) { | |
if (!hasKey(key)) { | |
LogManager.getLogger("lang_info").error("Translation key lookup failed: '{}'", key); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment