From 7191d38e36bb59e7f884a2843ddb0a90befcf235 Mon Sep 17 00:00:00 2001 From: thebest9178 <76120883+thebest9178@users.noreply.github.com> Date: Fri, 11 Aug 2023 03:52:02 -0700 Subject: [PATCH] Added Hidden Effects Added Show Ambient --- .../systems/hud/elements/PotionTimersHud.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PotionTimersHud.java b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PotionTimersHud.java index 8f4d2573a9..1aec30b857 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PotionTimersHud.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PotionTimersHud.java @@ -10,9 +10,12 @@ import meteordevelopment.meteorclient.utils.misc.Names; import meteordevelopment.meteorclient.utils.render.color.Color; import meteordevelopment.meteorclient.utils.render.color.SettingColor; +import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectUtil; +import java.util.List; + import static meteordevelopment.meteorclient.MeteorClient.mc; public class PotionTimersHud extends HudElement { @@ -24,6 +27,19 @@ public class PotionTimersHud extends HudElement { // General + private final Setting> hiddenEffects = sgGeneral.add(new StatusEffectListSetting.Builder() + .name("hidden-effects") + .description("Which effects not to show in the list.") + .build() + ); + + private final Setting showAmbient = sgGeneral.add(new BoolSetting.Builder() + .name("show-ambient") + .description("Whether to show ambient effects like from beacons and conduits.") + .defaultValue(true) + .build() + ); + private final Setting colorMode = sgGeneral.add(new EnumSetting.Builder() .name("color-mode") .description("What color to use for effects.") @@ -165,6 +181,8 @@ public void tick(HudRenderer renderer) { double height = 0; for (StatusEffectInstance statusEffectInstance : mc.player.getStatusEffects()) { + if (hiddenEffects.get().contains(statusEffectInstance.getEffectType())) continue; + if (!showAmbient.get() && statusEffectInstance.isAmbient()) continue; width = Math.max(width, renderer.textWidth(getString(statusEffectInstance), shadow.get(), getScale())); height += renderer.textHeight(shadow.get(), getScale()); } @@ -193,6 +211,8 @@ public void render(HudRenderer renderer) { rainbowHue2 = rainbowHue1; for (StatusEffectInstance statusEffectInstance : mc.player.getStatusEffects()) { + if (hiddenEffects.get().contains(statusEffectInstance.getEffectType())) continue; + if (!showAmbient.get() && statusEffectInstance.isAmbient()) continue; Color color = new Color(255, 255, 255); switch (colorMode.get()) {