aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java
index 6489f67..d939d6b 100644
--- a/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java
+++ b/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java
@@ -1,6 +1,8 @@
package cc.woverflow.chatting.mixin;
+import cc.polyfrost.oneconfig.renderer.TextRenderer;
import cc.woverflow.chatting.config.ChattingConfig;
+import net.minecraft.client.gui.FontRenderer;
import net.minecraftforge.fml.client.config.GuiUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -19,4 +21,16 @@ public class GuiUtilsMixin {
drawGradientRect(zLevel, left, top, right, bottom, startColor, endColor);
}
}
+
+ @Redirect(method = "drawHoveringText", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I"))
+ private static int redirectText(FontRenderer instance, String text, float x, float y, int color) {
+ switch (ChattingConfig.INSTANCE.getTooltipTextRenderType()) {
+ case 0:
+ return instance.drawString(text, x, y, color, false);
+ case 2:
+ return TextRenderer.drawBorderedText(text, x, y, color, 255);
+ default:
+ return instance.drawStringWithShadow(text, x, y, color);
+ }
+ }
}