diff options
-rw-r--r-- | build.gradle | 1 | ||||
-rw-r--r-- | src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java | 11 |
2 files changed, 2 insertions, 10 deletions
diff --git a/build.gradle b/build.gradle index 30dc6ac..5a18999 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,6 @@ loom { runConfigs { client { vmArgs.remove("-XstartOnFirstThread") - ideConfigGenerated = true } } forge { diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java index 97b00a7..92c3dfe 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java @@ -101,7 +101,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { @ModifyArgs(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/util/MathHelper;clamp_double(DDD)D"), to = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;enableBlend()V"))) private void captureDrawRect(Args args) { - args.set(4, changeChatBackgroundColor(ChattingConfig.INSTANCE.getChatBackgroundColor(), args.get(4))); + args.set(4, ChattingConfig.INSTANCE.getChatBackgroundColor().getRGB()); if (mc.currentScreen instanceof GuiChat) { int left = args.get(0); int top = args.get(1); @@ -110,7 +110,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { if (isInBounds(left, top, right, bottom, getChatScale())) { chatting$isHovering = true; lineInBounds = true; - args.set(4, changeChatBackgroundColor(ChattingConfig.INSTANCE.getHoveredChatBackgroundColor(), args.get(4))); + args.set(4, ChattingConfig.INSTANCE.getHoveredChatBackgroundColor().getRGB()); } } } @@ -139,13 +139,6 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { return mouseX >= (left + ModCompatHooks.getXOffset()) && mouseY < bottom && mouseX < (right + 23 + ModCompatHooks.getXOffset()) && mouseY >= top; } - private int changeChatBackgroundColor(OneColor color, int alphaColor) { - return (((alphaColor >> 24) & 0xFF) << 24) | - ((color.getRed() & 0xFF) << 16) | - ((color.getGreen() & 0xFF) << 8) | - ((color.getBlue() & 0xFF)); - } - @ModifyVariable(method = "drawChat", at = @At("STORE"), ordinal = 7) private int modifyYeah(int value) { return chatting$textOpacity = (int) (((float) (getChatOpen() ? 255 : value)) * (mc.gameSettings.chatOpacity * 0.9F + 0.1F)); |