diff options
Diffstat (limited to 'src/main/java/com/raeids/stratus/mixin')
-rw-r--r-- | src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java | 4 | ||||
-rw-r--r-- | src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java b/src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java index e701758..f606d4e 100644 --- a/src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java +++ b/src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java @@ -114,9 +114,9 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { return ChatSearchingManager.filterMessages(stratus$previousText, drawnChatLines); } - @ModifyVariable(method = "drawChat", at = @At("STORE"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/util/MathHelper;clamp_double(DDD)D"), to = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/ChatLine;getChatComponent()Lnet/minecraft/util/IChatComponent;")), name = "l1") + @ModifyVariable(method = "drawChat", at = @At("STORE"), ordinal = 7) private int modifyYeah(int value) { - return stratus$textOpacity = value; + return stratus$textOpacity = (int) (((float) (getChatOpen() ? 255 : value)) * (mc.gameSettings.chatOpacity * 0.9F + 0.1F)); } @Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I")) diff --git a/src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java b/src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java new file mode 100644 index 0000000..768b7c7 --- /dev/null +++ b/src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java @@ -0,0 +1,21 @@ +package com.raeids.stratus.mixin; + +import com.raeids.stratus.utils.RenderHelper; +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Coerce; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Pseudo +@Mixin(targets = "net.wyvest.wyvtils.core.listener.Listener") +public class WyvtilsListenerMixin { + + @Dynamic("Wyvtils") + @Inject(method = "onStringRendered", at = @At("HEAD"), cancellable = true) + private void cancelStringRender(@Coerce Object a, CallbackInfo ci) { + if (RenderHelper.INSTANCE.getBypassWyvtils()) ci.cancel(); + } +} |