From b0991b3326686d2a93022bbffdf1cabea28233a7 Mon Sep 17 00:00:00 2001 From: Roman Danilov Date: Mon, 8 Apr 2024 22:17:51 +0500 Subject: [PATCH] TriggerBot now check Entity type and AntiBot --- .../features/modules/combat/TriggerBot.java | 12 ++++++- .../killaura/modes/LiquidBounceAura.java | 32 ++++++++++++++++++- .../utils/misc/MeteorStarscriptMixin.java | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/main/java/nekiplay/meteorplus/features/modules/combat/TriggerBot.java b/src/main/java/nekiplay/meteorplus/features/modules/combat/TriggerBot.java index 1a038f9c..9985b045 100644 --- a/src/main/java/nekiplay/meteorplus/features/modules/combat/TriggerBot.java +++ b/src/main/java/nekiplay/meteorplus/features/modules/combat/TriggerBot.java @@ -9,6 +9,7 @@ import meteordevelopment.meteorclient.utils.player.PlayerUtils; import meteordevelopment.orbit.EventHandler; import nekiplay.meteorplus.features.modules.misc.MultiTasks; +import nekiplay.meteorplus.features.modules.misc.Teams; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; @@ -98,7 +99,16 @@ private boolean entityCheck(Entity entity) { if (entity instanceof PlayerEntity) { if (((PlayerEntity) entity).isCreative()) return false; if (!Friends.get().shouldAttack((PlayerEntity) entity)) return false; + AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class); + Teams teams = Modules.get().get(Teams.class); + if (antiBotPlus != null && antiBotPlus.isBot(entity)) { + return false; + } + if (teams != null && teams.isInYourTeam(entity)) { + return false; + } } + return !(entity instanceof AnimalEntity) || babies.get() || !((AnimalEntity) entity).isBaby(); } @@ -123,7 +133,7 @@ private void onTick(TickEvent.Pre event) { MultiTasks multiTasks = Modules.get().get(MultiTasks.class); if (!multiTasks.isActive() && (mc.player.isUsingItem() || mc.interactionManager.isBreakingBlock())) return; - if (delayCheck()) hitEntity(mc.targetedEntity); + if (delayCheck() && entityCheck(mc.targetedEntity)) hitEntity(mc.targetedEntity); } private void hitEntity(Entity target) { diff --git a/src/main/java/nekiplay/meteorplus/features/modules/combat/killaura/modes/LiquidBounceAura.java b/src/main/java/nekiplay/meteorplus/features/modules/combat/killaura/modes/LiquidBounceAura.java index 21f5fb43..6ef577a1 100644 --- a/src/main/java/nekiplay/meteorplus/features/modules/combat/killaura/modes/LiquidBounceAura.java +++ b/src/main/java/nekiplay/meteorplus/features/modules/combat/killaura/modes/LiquidBounceAura.java @@ -2,6 +2,7 @@ import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.systems.friends.Friends; +import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.combat.KillAura; import meteordevelopment.meteorclient.utils.entity.Target; import meteordevelopment.meteorclient.utils.entity.TargetUtils; @@ -9,9 +10,11 @@ import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.player.PlayerUtils; import meteordevelopment.meteorclient.utils.player.Rotations; +import nekiplay.meteorplus.features.modules.combat.AntiBotPlus; import nekiplay.meteorplus.features.modules.combat.killaura.KillAuraPlus; import nekiplay.meteorplus.features.modules.combat.killaura.KillAuraPlusMode; import nekiplay.meteorplus.features.modules.combat.killaura.KillAuraPlusModes; +import nekiplay.meteorplus.features.modules.misc.Teams; import nekiplay.meteorplus.utils.Perlin2D; import nekiplay.meteorplus.utils.RaycastUtils; import nekiplay.meteorplus.utils.RotationUtils; @@ -58,9 +61,13 @@ public void onTick(TickEvent.Post event) { target = TargetUtils.getPlayerTarget(settings.range.get(), settings.priority.get()); TargetUtils.getList(targets, this::entityCheck, settings.priority.get(), settings.maxTargets.get()); + if (targets.size() > 0) { Entity primary = targets.get(0); + AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class); + Teams teams = Modules.get().get(Teams.class); + List targets2 = targets; if(settings.fov.get() < 360.0) @@ -161,6 +168,15 @@ private boolean delayCheck() { private void attack(Entity target) { if (Math.random() > settings.hitChance.get() / 100) return; + AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class); + Teams teams = Modules.get().get(Teams.class); + if (antiBotPlus != null && antiBotPlus.isBot(target)) { + return; + } + if (teams != null && teams.isInYourTeam(target)) { + return; + } + if (settings.rotation.get() == KillAuraPlus.RotationMode.OnHit) rotate(target, () -> hitEntity(target)); else hitEntity(target); } @@ -345,7 +361,21 @@ else if (lastRotate != null) { } public Entity getTarget() { - if (!targets.isEmpty()) return targets.get(0); + for (Entity target : targets) { + boolean allow = true; + AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class); + Teams teams = Modules.get().get(Teams.class); + if (antiBotPlus != null && antiBotPlus.isBot(target)) { + allow = false; + } + if (teams != null && teams.isInYourTeam(target)) { + allow = false; + } + if (allow) { + return target; + } + } + return null; } } diff --git a/src/main/java/nekiplay/meteorplus/mixin/meteorclient/utils/misc/MeteorStarscriptMixin.java b/src/main/java/nekiplay/meteorplus/mixin/meteorclient/utils/misc/MeteorStarscriptMixin.java index 2766d338..f45a225a 100644 --- a/src/main/java/nekiplay/meteorplus/mixin/meteorclient/utils/misc/MeteorStarscriptMixin.java +++ b/src/main/java/nekiplay/meteorplus/mixin/meteorclient/utils/misc/MeteorStarscriptMixin.java @@ -227,7 +227,7 @@ else if (dimension == Dimension.Nether) { } private static Value posString(double x, double y, double z) { - return Value.string(String.format("X: %.0f Y: %.0f Z: %.0f", x, y, z)); + return Value.string(String.format("X: %.0f Y: %.0f Z: %.0f", x + ConfigModifier.get().x_spoof.get(), y, z + ConfigModifier.get().z_spoof.get())); } private static Value getItem(Starscript ss, int argCount) {