From c6dff8df7d3c4959c7e1a2e80456a8ea59ba5b73 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 19 Feb 2023 23:47:33 +0100 Subject: feat: option to hide potion effects --- src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java b/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java index a3126d6..95e3231 100644 --- a/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java +++ b/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java @@ -42,6 +42,7 @@ public class InfoDisplay extends HudModule implements ICommons { // public final ForgeConfigSpec.ConfigValue effects_list; // public final ForgeConfigSpec.ConfigValue item_quantity; // public final ForgeConfigSpec.ConfigValue client_chunk_size; + public final ForgeConfigSpec.ConfigValue hide_effects; public InfoDisplay(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { super("InfoDisplay", builder, dispatcher); @@ -63,6 +64,12 @@ public class InfoDisplay extends HudModule implements ICommons { BoolArgumentType.bool(), Boolean.class, builder, dispatcher ); + + this.hide_effects = this.option( + "hide-effects", "hide effect icons on top right corner", false, + BoolArgumentType.bool(), Boolean.class, + builder, dispatcher + ); } @SubscribeEvent @@ -88,6 +95,12 @@ public class InfoDisplay extends HudModule implements ICommons { @SubscribeEvent public void onRenderOverlay(RenderGameOverlayEvent event) { + if (event.getType() == ElementType.POTION_ICONS) { + if (this.hide_effects.get()) { + event.setCanceled(true); + } + } + if (event.getType() != ElementType.TEXT) return; Minecraft mc = MC; -- cgit v1.2.3-56-ga3b1