diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/Notifier.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/Notifier.java index 4a91c48eee..1388450438 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/Notifier.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/Notifier.java @@ -18,6 +18,7 @@ import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.utils.entity.fakeplayer.FakePlayerEntity; import meteordevelopment.meteorclient.utils.player.ChatUtils; +import meteordevelopment.meteorclient.utils.player.PlayerUtils; import meteordevelopment.orbit.EventHandler; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; @@ -49,6 +50,24 @@ public class Notifier extends Module { .build() ); + private final Setting totemsDistanceCheck = sgTotemPops.add(new BoolSetting.Builder() + .name("distance-check") + .description("Limits the distance in which the pops are recognized.") + .defaultValue(false) + .visible(totemPops::get) + .build() + ); + + private final Setting totemsDistance = sgTotemPops.add(new IntSetting.Builder() + .name("player-radius") + .description("The radius in which to log totem pops.") + .defaultValue(30) + .sliderRange(1, 50) + .range(1, 100) + .visible(() -> totemPops.get() && totemsDistanceCheck.get()) + .build() + ); + private final Setting totemsIgnoreOwn = sgTotemPops.add(new BoolSetting.Builder() .name("ignore-own") .description("Ignores your own totem pops.") @@ -246,6 +265,9 @@ private void onReceivePacket(PacketEvent.Receive event) { int pops = totemPopMap.getOrDefault(entity.getUuid(), 0); totemPopMap.put(entity.getUuid(), ++pops); + double distance = PlayerUtils.distanceTo(entity); + if (totemsDistanceCheck.get() && distance > totemsDistance.get()) return; + ChatUtils.sendMsg(getChatId(entity), Formatting.GRAY, "(highlight)%s (default)popped (highlight)%d (default)%s.", entity.getName().getString(), pops, pops == 1 ? "totem" : "totems"); } }