diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java | 22 |
1 files changed, 22 insertions, 0 deletions
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); + } + } +} |