fix: only hide effects when no gui is shown

This commit is contained in:
əlemi 2024-01-17 00:36:57 +01:00
parent 2893438f64
commit 57dd48049d
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -175,11 +175,14 @@ public class InfoDisplay extends HudModule {
@SubscribeEvent @SubscribeEvent
public void onRenderOverlay(RenderGameOverlayEvent event) { public void onRenderOverlay(RenderGameOverlayEvent event) {
if (event.getType() == ElementType.POTION_ICONS) { if (
if (this.hide_effects.get() && event.isCancelable()) { event.getType() == ElementType.POTION_ICONS
&& MC.screen == null
&& this.hide_effects.get()
&& event.isCancelable()
) {
event.setCanceled(true); event.setCanceled(true);
} }
}
if (event.getType() != ElementType.TEXT) return; if (event.getType() != ElementType.TEXT) return;
if (this.shouldHide()) return; if (this.shouldHide()) return;