From 36c3a2cd53e74fb3840f7ee916b90d0dfaffcfdd Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:18:04 +0200 Subject: [PATCH] Fixed https://github.com/ViaVersion/ViaFabricPlus/issues/175 --- .../mixin/fixes/minecraft/screen/MixinChatHud.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinChatHud.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinChatHud.java index 9609924f..961b47ef 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinChatHud.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinChatHud.java @@ -17,22 +17,23 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings; import net.minecraft.client.gui.hud.ChatHud; import net.minecraft.client.gui.hud.ChatHudLine; import net.minecraft.client.gui.hud.MessageIndicator; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(ChatHud.class) public class MixinChatHud { - @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHudLine$Visible;indicator()Lnet/minecraft/client/gui/hud/MessageIndicator;"), require = 0) - public MessageIndicator removeIndicators(ChatHudLine.Visible instance) { + @WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHudLine$Visible;indicator()Lnet/minecraft/client/gui/hud/MessageIndicator;"), require = 0) + public MessageIndicator removeIndicators(ChatHudLine.Visible instance, Operation original) { if (VisualSettings.INSTANCE.hideSignatureIndicator.isEnabled()) { return null; } - return instance.indicator(); + return original.call(instance); } }