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,10 +175,13 @@ 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
event.setCanceled(true); && MC.screen == null
} && this.hide_effects.get()
&& event.isCancelable()
) {
event.setCanceled(true);
} }
if (event.getType() != ElementType.TEXT) return; if (event.getType() != ElementType.TEXT) return;