package io.gitlab.jfronny.googlechat.mixin; import io.gitlab.jfronny.googlechat.*; import net.minecraft.client.network.*; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.*; @Mixin(ClientPlayerEntity.class) public class ClientPlayerEntityMixin { @ModifyVariable(method = "sendChatMessage(Ljava/lang/String;Lnet/minecraft/text/Text;)V", at = @At("HEAD"), argsOnly = true, ordinal = 0) String googlechat$translateMessage(String source) { return GoogleChat.translateIfNeeded(source, GoogleChat.Direction.C2S, true); } }