/* * SPDX-FileCopyrightText: 2023 Linnea Gräf * * SPDX-License-Identifier: GPL-3.0-or-later */ package moe.nea.firmament.mixins; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import moe.nea.firmament.features.fixes.Fixes; import net.minecraft.client.gui.hud.ChatHud; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @Mixin(ChatHud.class) public class MixinChatHud { @ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z")) public boolean onGetChatHud(boolean old) { return old || Fixes.INSTANCE.shouldPeekChat(); } @ModifyExpressionValue(method = "getHeight", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z")) public boolean onGetChatHudHeight(boolean old) { return old || Fixes.INSTANCE.shouldPeekChat(); } }