From d886ac93a05856bd7d18e18da99e51bc2c13d216 Mon Sep 17 00:00:00 2001 From: Soda5601 <62250232+ThebestkillerTBK@users.noreply.github.com> Date: Sat, 4 Feb 2023 02:43:45 +0800 Subject: [PATCH] Invisible filter for ka (#219) --- README.md | 5 ++++- .../rejects/gui/screens/HeadScreen.java | 2 +- .../mixin/meteor/modules/KillAuraMixin.java | 17 ++++++++++++++++- .../anticope/rejects/utils/RejectsUtils.java | 1 + .../anticope/rejects/utils/SeedCrackerEP.java | 2 +- .../anticope/rejects/utils/WorldGenUtils.java | 2 +- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 922b9e0..937753f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,10 @@ - `Random characters` (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack)) - Module - `Duplicate names` -- KillAura & Aim Assist: FoV option +- KillAura + - `Fov and invisible filter` +- AimAssist + - `Fov filter` ## Commands - `.center` diff --git a/src/main/java/anticope/rejects/gui/screens/HeadScreen.java b/src/main/java/anticope/rejects/gui/screens/HeadScreen.java index 808e2c1..f3c7e71 100644 --- a/src/main/java/anticope/rejects/gui/screens/HeadScreen.java +++ b/src/main/java/anticope/rejects/gui/screens/HeadScreen.java @@ -90,7 +90,7 @@ public class HeadScreen extends WindowScreen { try { GiveUtils.giveItem(head); } catch (CommandSyntaxException e) { - ChatUtils.error("Heads", e.getMessage()); + ChatUtils.errorPrefix("Heads", e.getMessage()); } }; WButton equip = t.add(theme.button("Equip")).widget(); diff --git a/src/main/java/anticope/rejects/mixin/meteor/modules/KillAuraMixin.java b/src/main/java/anticope/rejects/mixin/meteor/modules/KillAuraMixin.java index cd8d62a..e39c395 100644 --- a/src/main/java/anticope/rejects/mixin/meteor/modules/KillAuraMixin.java +++ b/src/main/java/anticope/rejects/mixin/meteor/modules/KillAuraMixin.java @@ -1,6 +1,7 @@ package anticope.rejects.mixin.meteor.modules; import anticope.rejects.utils.RejectsUtils; +import meteordevelopment.meteorclient.settings.BoolSetting; import meteordevelopment.meteorclient.settings.DoubleSetting; import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.SettingGroup; @@ -20,7 +21,12 @@ public class KillAuraMixin { @Final private SettingGroup sgGeneral; + @Shadow + @Final + private SettingGroup sgTargeting; + private Setting fov; + private Setting ignoreInvisible; @Inject(method = "", at = @At("TAIL")) private void onInit(CallbackInfo info) { @@ -32,10 +38,19 @@ public class KillAuraMixin { .max(360) .build() ); + + ignoreInvisible = sgTargeting.add(new BoolSetting.Builder() + .name("ignore-invisible") + .description("Whether or not to attack invisible entities.") + .defaultValue(false) + .build() + ); } @Inject(method = "entityCheck", at = @At(value = "RETURN", ordinal = 14), cancellable = true) private void onReturn(Entity entity, CallbackInfoReturnable info) { - info.setReturnValue(info.getReturnValueZ() && RejectsUtils.inFov(entity, fov.get())); + if (ignoreInvisible.get() && entity.isInvisible()) info.setReturnValue(false); + if (!RejectsUtils.inFov(entity, fov.get())) info.setReturnValue(false); + info.setReturnValue(info.getReturnValueZ()); } } diff --git a/src/main/java/anticope/rejects/utils/RejectsUtils.java b/src/main/java/anticope/rejects/utils/RejectsUtils.java index d6134e9..48e9e1b 100644 --- a/src/main/java/anticope/rejects/utils/RejectsUtils.java +++ b/src/main/java/anticope/rejects/utils/RejectsUtils.java @@ -47,6 +47,7 @@ public class RejectsUtils { } public static boolean inFov(Entity entity, double fov) { + if (fov >= 360) return true; float[] angle = PlayerUtils.calculateAngle(entity.getBoundingBox().getCenter()); double xDist = MathHelper.angleBetween(angle[0], mc.player.getYaw()); double yDist = MathHelper.angleBetween(angle[1], mc.player.getPitch()); diff --git a/src/main/java/anticope/rejects/utils/SeedCrackerEP.java b/src/main/java/anticope/rejects/utils/SeedCrackerEP.java index b6e64b6..ef4c0bb 100644 --- a/src/main/java/anticope/rejects/utils/SeedCrackerEP.java +++ b/src/main/java/anticope/rejects/utils/SeedCrackerEP.java @@ -8,6 +8,6 @@ public class SeedCrackerEP implements SeedCrackerAPI { @Override public void pushWorldSeed(long seed) { Seeds.get().setSeed(String.format("%d", seed)); - ChatUtils.info("Seed", "Added seed from SeedCrackerX"); + ChatUtils.infoPrefix("Seed", "Added seed from SeedCrackerX"); } } diff --git a/src/main/java/anticope/rejects/utils/WorldGenUtils.java b/src/main/java/anticope/rejects/utils/WorldGenUtils.java index d53cff5..d34ba83 100644 --- a/src/main/java/anticope/rejects/utils/WorldGenUtils.java +++ b/src/main/java/anticope/rejects/utils/WorldGenUtils.java @@ -186,7 +186,7 @@ public class WorldGenUtils { blocks,64,10,32); if (posList.isEmpty()) return null; if (posList.size() < 5) { - ChatUtils.warning("Locate", "Only %d block(s) found. This search might be a false positive.", posList.size()); + ChatUtils.warningPrefix("Locate", "Only %d block(s) found. This search might be a false positive.", posList.size()); } return posList.get(0); }