mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-04 09:19:33 +01:00
This commit is contained in:
parent
4944870907
commit
36c3a2cd53
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user