Invisible filter for ka (#219)

This commit is contained in:
Soda5601
2023-02-04 02:43:45 +08:00
committed by GitHub
parent e14efb2a4d
commit d886ac93a0
6 changed files with 24 additions and 5 deletions

View File

@@ -86,7 +86,10 @@
- `Random characters` (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack)) - `Random characters` (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack))
- Module - Module
- `Duplicate names` - `Duplicate names`
- KillAura & Aim Assist: FoV option - KillAura
- `Fov and invisible filter`
- AimAssist
- `Fov filter`
## Commands ## Commands
- `.center` - `.center`

View File

@@ -90,7 +90,7 @@ public class HeadScreen extends WindowScreen {
try { try {
GiveUtils.giveItem(head); GiveUtils.giveItem(head);
} catch (CommandSyntaxException e) { } catch (CommandSyntaxException e) {
ChatUtils.error("Heads", e.getMessage()); ChatUtils.errorPrefix("Heads", e.getMessage());
} }
}; };
WButton equip = t.add(theme.button("Equip")).widget(); WButton equip = t.add(theme.button("Equip")).widget();

View File

@@ -1,6 +1,7 @@
package anticope.rejects.mixin.meteor.modules; package anticope.rejects.mixin.meteor.modules;
import anticope.rejects.utils.RejectsUtils; import anticope.rejects.utils.RejectsUtils;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.DoubleSetting; import meteordevelopment.meteorclient.settings.DoubleSetting;
import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup; import meteordevelopment.meteorclient.settings.SettingGroup;
@@ -20,7 +21,12 @@ public class KillAuraMixin {
@Final @Final
private SettingGroup sgGeneral; private SettingGroup sgGeneral;
@Shadow
@Final
private SettingGroup sgTargeting;
private Setting<Double> fov; private Setting<Double> fov;
private Setting<Boolean> ignoreInvisible;
@Inject(method = "<init>", at = @At("TAIL")) @Inject(method = "<init>", at = @At("TAIL"))
private void onInit(CallbackInfo info) { private void onInit(CallbackInfo info) {
@@ -32,10 +38,19 @@ public class KillAuraMixin {
.max(360) .max(360)
.build() .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) @Inject(method = "entityCheck", at = @At(value = "RETURN", ordinal = 14), cancellable = true)
private void onReturn(Entity entity, CallbackInfoReturnable<Boolean> info) { private void onReturn(Entity entity, CallbackInfoReturnable<Boolean> 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());
} }
} }

View File

@@ -47,6 +47,7 @@ public class RejectsUtils {
} }
public static boolean inFov(Entity entity, double fov) { public static boolean inFov(Entity entity, double fov) {
if (fov >= 360) return true;
float[] angle = PlayerUtils.calculateAngle(entity.getBoundingBox().getCenter()); float[] angle = PlayerUtils.calculateAngle(entity.getBoundingBox().getCenter());
double xDist = MathHelper.angleBetween(angle[0], mc.player.getYaw()); double xDist = MathHelper.angleBetween(angle[0], mc.player.getYaw());
double yDist = MathHelper.angleBetween(angle[1], mc.player.getPitch()); double yDist = MathHelper.angleBetween(angle[1], mc.player.getPitch());

View File

@@ -8,6 +8,6 @@ public class SeedCrackerEP implements SeedCrackerAPI {
@Override @Override
public void pushWorldSeed(long seed) { public void pushWorldSeed(long seed) {
Seeds.get().setSeed(String.format("%d", seed)); Seeds.get().setSeed(String.format("%d", seed));
ChatUtils.info("Seed", "Added seed from SeedCrackerX"); ChatUtils.infoPrefix("Seed", "Added seed from SeedCrackerX");
} }
} }

View File

@@ -186,7 +186,7 @@ public class WorldGenUtils {
blocks,64,10,32); blocks,64,10,32);
if (posList.isEmpty()) return null; if (posList.isEmpty()) return null;
if (posList.size() < 5) { 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); return posList.get(0);
} }