From e02ba1f11a421618aaf357dd166aae005301e7ab Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sun, 2 Jan 2022 15:20:32 +0700 Subject: remove tooltip background feature --- .../cc/woverflow/chattils/mixin/GuiUtilsMixin.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java (limited to 'src/main/java') diff --git a/src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java b/src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java new file mode 100644 index 0000000..df8216b --- /dev/null +++ b/src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java @@ -0,0 +1,22 @@ +package cc.woverflow.chattils.mixin; + +import cc.woverflow.chattils.config.ChattilsConfig; +import net.minecraftforge.fml.client.config.GuiUtils; +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.Redirect; + +@Mixin(value = GuiUtils.class, remap = false) +public class GuiUtilsMixin { + @Shadow + public static void drawGradientRect(int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { + } + + @Redirect(method = "drawHoveringText", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/config/GuiUtils;drawGradientRect(IIIIIII)V")) + private static void redirectBackground(int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { + if (!ChattilsConfig.INSTANCE.getRemoveTooltipBackground()) { + drawGradientRect(zLevel, left, top, right, bottom, startColor, endColor); + } + } +} -- cgit