package io.gitlab.jfronny.googlechat.mixin; import io.gitlab.jfronny.googlechat.*; import net.minecraft.client.gui.screen.*; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.*; @Mixin(ChatScreen.class) public class ChatScreenMixin { @ModifyVariable(method = "tryRequestChatPreview(Ljava/lang/String;)V", at = @At(value = "HEAD"), argsOnly = true, ordinal = 0) String googlechat$translateChatText(String source) { return GoogleChat.translateIfNeeded(source, GoogleChat.Direction.C2S, true); } }