FlorianMichael 2023-07-09 21:18:04 +02:00
parent 4944870907
commit 36c3a2cd53
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -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<MessageIndicator> original) {
if (VisualSettings.INSTANCE.hideSignatureIndicator.isEnabled()) {
return null;
}
return instance.indicator();
return original.call(instance);
}
}