From 4ed5b00494223e921eb62f8a3d543c9794980bc8 Mon Sep 17 00:00:00 2001 From: 0xTas Date: Fri, 25 Oct 2024 23:55:22 -0700 Subject: [PATCH] Add effect duration setting to PotionSpoof --- .../systems/modules/player/PotionSpoof.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/PotionSpoof.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/PotionSpoof.java index 939570fd59..95f92ca728 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/PotionSpoof.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/PotionSpoof.java @@ -50,6 +50,15 @@ public class PotionSpoof extends Module { .build() ); + private final Setting effectDuration = sgGeneral.add(new IntSetting.Builder() + .name("effect-duration") + .description("How many ticks to spoof the effect for.") + .range(1, 32767) + .sliderRange(20, 500) + .defaultValue(420) + .build() + ); + public PotionSpoof() { super(Categories.Player, "potion-spoof", "Spoofs potion statuses for you. SOME effects DO NOT work."); } @@ -73,9 +82,9 @@ private void onTick(TickEvent.Post event) { if (mc.player.hasStatusEffect(Registries.STATUS_EFFECT.getEntry(entry.getKey()))) { StatusEffectInstance instance = mc.player.getStatusEffect(Registries.STATUS_EFFECT.getEntry(entry.getKey())); ((StatusEffectInstanceAccessor) instance).setAmplifier(level - 1); - if (instance.getDuration() < 1000) ((StatusEffectInstanceAccessor) instance).setDuration(1000); + if (instance.getDuration() < effectDuration.get()) ((StatusEffectInstanceAccessor) instance).setDuration(effectDuration.get()); } else { - mc.player.addStatusEffect(new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(entry.getKey()), 1000, level - 1)); + mc.player.addStatusEffect(new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(entry.getKey()), effectDuration.get(), level - 1)); } } }