aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_RemoveScrollBar.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_RemoveScrollBar.java')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_RemoveScrollBar.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_RemoveScrollBar.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_RemoveScrollBar.java
new file mode 100644
index 0000000..347ea57
--- /dev/null
+++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_RemoveScrollBar.java
@@ -0,0 +1,25 @@
+package cc.woverflow.chatting.mixin;
+
+import cc.woverflow.chatting.config.ChattingConfig;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.gui.GuiNewChat;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Redirect;
+
+@Mixin(GuiNewChat.class)
+public class GuiNewChatMixin_RemoveScrollBar extends Gui {
+ @Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V", ordinal = 1))
+ private void redirectScrollBar(int left, int top, int right, int bottom, int color) {
+ if (!ChattingConfig.INSTANCE.getRemoveScrollBar()) {
+ drawRect(left, top, right, bottom, color);
+ }
+ }
+
+ @Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V", ordinal = 2))
+ private void redirectScrollBar2(int left, int top, int right, int bottom, int color) {
+ if (!ChattingConfig.INSTANCE.getRemoveScrollBar()) {
+ drawRect(left, top, right, bottom, color);
+ }
+ }
+}