Skip to content

Commit

Permalink
Release 1.5.3
Browse files Browse the repository at this point in the history
- [+] **Add** Active mode to HitSelect.
    - Active mode will cancel attack action and keep swing action. It looks like "Legit KeepSprint", and may be flagged by Polar.
- [※] **Fix** JumpReset sometimes do impossible jump.
- [+] **Improve** TimerRange.
    - **Add** fov option. default is 180° it means only TimerRange if you are face the target.
    - **Add** ignoreTeammates option.
    - Now TimerRange didn't need KillAura anymore.
- [※] **Improve** StrafeTest mode in Speed.
    - Renamed "Strafe (Deprecated)" to "StrafeTest".
- [+] **Add** Latency compensation option to Water bucket.
    - if the value > 0, module will predict your future move and extend your reach distance.
- [※] **Fix** Block-In
    - fix direction
  • Loading branch information
xia-mc committed Jun 23, 2024
1 parent 9473366 commit 3c86def
Show file tree
Hide file tree
Showing 20 changed files with 212 additions and 138 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package keystrokesmod.mixins.impl.entity;

import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.combat.HitSelect;
import keystrokesmod.module.impl.combat.Reduce;
import keystrokesmod.module.impl.movement.KeepSprint;
import net.minecraft.enchantment.EnchantmentHelper;
Expand Down Expand Up @@ -106,6 +107,9 @@ public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCur
else if (ModuleManager.keepSprint != null && ModuleManager.keepSprint.isEnabled()) {
KeepSprint.keepSprint(p_attackTargetEntityWithCurrentItem_1_);
}
// else if (ModuleManager.hitSelect != null && ModuleManager.hitSelect.isEnabled()) {
// HitSelect.hitSelect(p_attackTargetEntityWithCurrentItem_1_);
// }
else {
this.motionX *= 0.6D;
this.motionZ *= 0.6D;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void guiUpdate() {

@SubscribeEvent
public void onRenderTick(@NotNull RenderTickEvent ev) {
if (ev.phase != Phase.END && Utils.nullCheck() && !mc.thePlayer.isEating() && HitSelect.canAttack()) {
if (ev.phase != Phase.END && Utils.nullCheck() && !mc.thePlayer.isEating() && mc.objectMouseOver != null && HitSelect.canAttack(mc.objectMouseOver.entityHit)) {
if (mc.currentScreen == null && mc.inGameHasFocus) {
if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return;
Expand Down
36 changes: 29 additions & 7 deletions src/main/java/keystrokesmod/module/impl/combat/HitSelect.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package keystrokesmod.module.impl.combat;

import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C02PacketUseEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -15,20 +15,38 @@
import static keystrokesmod.module.ModuleManager.hitSelect;

public class HitSelect extends Module {
private static long attackTime = -1;
private static final String[] MODES = new String[]{"Pause", "Active"};
private final SliderSetting mode;
private final SliderSetting delay;
private final SliderSetting chance;
private final ButtonSetting smart;

private static long attackTime = -1;
private static boolean currentShouldAttack = false;

public HitSelect() {
super("HitSelect", category.combat);
this.registerSetting(new DescriptionSetting("chooses the best time to hit."));
this.registerSetting(delay = new SliderSetting("Delay", 420, 200, 750, 1));
this.registerSetting(mode = new SliderSetting("Mode", MODES, 0));
this.registerSetting(delay = new SliderSetting("Delay", 420, 400, 500, 1));
this.registerSetting(chance = new SliderSetting("Chance", 80, 0, 100, 1));
this.registerSetting(smart = new ButtonSetting("Smart", true));
}

@Override
public String getInfo() {
return MODES[(int) mode.getInput()];
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onAttack(@NotNull AttackEntityEvent event) {
if (mode.getInput() == 1 && !currentShouldAttack && (!smart.isToggled()
|| !(event.target instanceof EntityLivingBase)
|| ((EntityLivingBase) event.target).hurtTime > 0)) {
event.setCanceled(true);
return;
}

attackTime = System.currentTimeMillis();
}

Expand All @@ -37,12 +55,16 @@ public void onPreUpdate(PreUpdateEvent event) {
currentShouldAttack = Math.random() > hitSelect.chance.getInput() || System.currentTimeMillis() - HitSelect.attackTime >= hitSelect.delay.getInput();
}

public static boolean canAttack() {
public static boolean canAttack(Entity target) {
if (target instanceof EntityLivingBase)
if (hitSelect.smart.isToggled() && ((EntityLivingBase) target).hurtTime == 0)
return true;

return canSwing();
}

public static boolean canSwing() {
if (!hitSelect.isEnabled()) return true;
if (!hitSelect.isEnabled() || hitSelect.mode.getInput() == 1) return true;
return currentShouldAttack;
}
}
16 changes: 7 additions & 9 deletions src/main/java/keystrokesmod/module/impl/combat/JumpReset.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class JumpReset extends Module {
private final SliderSetting minDelay;
private final SliderSetting maxDelay;
private final SliderSetting chance;
private final SliderSetting motion;
private final SliderSetting maxFallDistance;
private final ButtonSetting ignoreFire;
private boolean jump;
Expand All @@ -26,7 +25,6 @@ public JumpReset() {
this.registerSetting(minDelay = new SliderSetting("Min delay", 0, 0, 150, 1, "ms"));
this.registerSetting(maxDelay = new SliderSetting("Max delay", 0, 0, 150, 1, "ms"));
this.registerSetting(chance = new SliderSetting("Chance", 80, 0, 100, 1, "%"));
this.registerSetting(motion = new SliderSetting("Jump motion", 0.42, 0, 1, 0.01));
this.registerSetting(maxFallDistance = new SliderSetting("Max fall distance", 3, 1, 8, 0.5));
this.registerSetting(ignoreFire = new ButtonSetting("Ignore fire", true));
}
Expand Down Expand Up @@ -66,14 +64,17 @@ public void onLivingUpdate(LivingEvent.LivingUpdateEvent ev) {
return;
}
}
if (jump && mc.thePlayer.onGround) {
if (jump) {
long delay = (long) (Math.random() * (maxDelay.getInput() - minDelay.getInput()) + minDelay.getInput());
if (delay == 0) {
mc.thePlayer.jump();
if (mc.thePlayer.onGround) mc.thePlayer.jump();
jump = false;
} else {
Raven.getExecutor().schedule(() -> mc.thePlayer.jump(), delay, TimeUnit.MILLISECONDS);
Raven.getExecutor().schedule(() -> {
if (mc.thePlayer.onGround) mc.thePlayer.jump();
jump = false;
}, delay, TimeUnit.MILLISECONDS);
}
jump = false;
}
}
}
Expand All @@ -83,9 +84,6 @@ public void onJump(JumpEvent e) {
if (!Utils.nullCheck() || !jump) {
return;
}
if (motion.getInput() != 0.42) {
e.setMotionY((float) motion.getInput());
}
jump = false;
}
}
30 changes: 27 additions & 3 deletions src/main/java/keystrokesmod/module/impl/combat/TimerRange.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
package keystrokesmod.module.impl.combat;

import akka.japi.Pair;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.script.classes.Vec3;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;

import java.util.Comparator;

public class TimerRange extends Module {
private final SliderSetting lagTicks;
private final SliderSetting timerTicks;
private final SliderSetting minRange;
private final SliderSetting maxRange;
private final SliderSetting delay;
private final SliderSetting fov;
private final ButtonSetting ignoreTeammates;

private int hasLag = 0;
private long lastTimerTime = 0;
private long lastLagTime = 0;
public TimerRange() {
super("TimerRange", category.combat);
this.registerSetting(new DescriptionSetting("Use timer help you to beat opponent."));
this.registerSetting(new DescriptionSetting("Only work with KillAura."));
this.registerSetting(lagTicks = new SliderSetting("Lag ticks", 2, 0, 10, 1));
this.registerSetting(timerTicks = new SliderSetting("Timer ticks", 2, 0, 10, 1));
this.registerSetting(minRange = new SliderSetting("Min range", 3.6, 0, 8, 0.1));
this.registerSetting(maxRange = new SliderSetting("Max range", 5, 0, 8, 0.1));
this.registerSetting(delay = new SliderSetting("Delay", 500, 0, 4000, 1));
this.registerSetting(fov = new SliderSetting("Fov", 180, 0, 360, 30));
this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", true));
}

@SubscribeEvent
Expand Down Expand Up @@ -59,9 +68,24 @@ public void onDisable() {
}

private boolean shouldStart() {
if (!Utils.isMoving()) return false;
if (fov.getInput() == 0) return false;
if (System.currentTimeMillis() - lastTimerTime < delay.getInput()) return false;
if (KillAura.target == null) return false;
double distance = new Vec3(KillAura.target).distanceTo(mc.thePlayer);

EntityPlayer target = mc.theWorld.playerEntities.stream()
.filter(p -> !ignoreTeammates.isToggled() || !Utils.isTeamMate(p))
.filter(p -> !Utils.isFriended(p))
.filter(p -> !AntiBot.isBot(p))
.map(p -> new Pair<>(p, mc.thePlayer.getDistanceSqToEntity(p)))
.min(Comparator.comparing(Pair::second))
.map(Pair::first)
.orElse(null);

if (target == null) return false;

if (fov.getInput() < 360 && !Utils.inFov((float) fov.getInput(), target)) return false;

double distance = new Vec3(target).distanceTo(mc.thePlayer);
return distance >= minRange.getInput() && distance <= maxRange.getInput();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class KeepSprint extends Module {

public KeepSprint() {
super("KeepSprint", Module.category.movement, 0);
this.registerSetting(new DescriptionSetting(new String("Default is 40% motion reduction.")));
this.registerSetting(new DescriptionSetting("Default is 40% motion reduction."));
this.registerSetting(slow = new SliderSetting("Slow %", 40.0D, 0.0D, 40.0D, 1.0D));
this.registerSetting(disableWhileJump = new ButtonSetting("Disable while jumping", false));
this.registerSetting(reduceReachHits = new ButtonSetting("Only reduce reach hits", false));
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/keystrokesmod/module/impl/movement/LongJump.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class LongJump extends Module {
public static final String[] MODES = {"Fireball", "Fireball Auto", "Self Damage"};
private final SliderSetting mode;
private final SliderSetting horizonBoost;
private final SliderSetting horizonMotionMultiplier;
private final SliderSetting verticalMotion;
private final ButtonSetting reverseYaw;
private final SliderSetting pitch;
Expand All @@ -41,8 +42,9 @@ public class LongJump extends Module {
public LongJump() {
super("Long Jump", category.movement);
this.registerSetting(mode = new SliderSetting("Mode", MODES, 0));
this.registerSetting(horizonBoost = new SliderSetting("Horizon boost", 1.0, 0.5, 3.0, 0.05));
this.registerSetting(verticalMotion = new SliderSetting("Vertical motion", 0.35, 0.01, 0.4, 0.01));
this.registerSetting(horizonBoost = new SliderSetting("Horizon boost", 1.0, 1.0, 1.5, 0.01));
this.registerSetting(horizonMotionMultiplier = new SliderSetting("Horizon motion multiplier", 1.0, 0.9, 1.1, 0.005));
this.registerSetting(verticalMotion = new SliderSetting("Vertical motion", 0.01, 0.01, 0.6, 0.01));
this.registerSetting(reverseYaw = new ButtonSetting("Reverse yaw", false));
this.registerSetting(pitch = new SliderSetting("Pitch", 90, 80, 90, 0.5));
this.registerSetting(aimTicks = new SliderSetting("Aim ticks", 2, 1, 10, 1));
Expand Down Expand Up @@ -80,8 +82,8 @@ public void onPreMotion(PreMotionEvent event) {
if (ticks < 40) {
event.setOnGround(false);
mc.thePlayer.motionX = mc.thePlayer.motionZ = 0;
event.setPosZ(mc.thePlayer.prevPosZ);
event.setPosX(mc.thePlayer.prevPosX);
event.setPosZ(mc.thePlayer.lastTickPosZ);
event.setPosX(mc.thePlayer.lastTickPosX);
} else if (ticks == 50) {
event.setOnGround(true);
}
Expand Down Expand Up @@ -144,6 +146,8 @@ public void onPreUpdate(PreUpdateEvent event) {
}

if (ticks > 0 && ticks < 30) {
mc.thePlayer.motionX *= horizonMotionMultiplier.getInput();
mc.thePlayer.motionZ *= horizonMotionMultiplier.getInput();
mc.thePlayer.motionY = verticalMotion.getInput();
} else if (ticks >= 30) {
done = true;
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/keystrokesmod/module/impl/movement/Speed.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.other.anticheats.utils.world.BlockUtils;
import keystrokesmod.module.impl.player.NoFall;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.script.classes.Vec3;
import keystrokesmod.utility.MoveUtil;
import keystrokesmod.utility.Utils;
import net.minecraft.block.BlockAir;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.potion.Potion;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -22,7 +25,7 @@ public class Speed extends Module {
private final ButtonSetting sneakDisable;
private final ButtonSetting stopMotion;
private final ButtonSetting stopSprint;
private final String[] modes = new String[]{"Strafe (Deprecated)", "Ground", "Damage", "Old Hypixel"};
private final String[] modes = new String[]{"StrafeTest", "Ground", "Damage", "OldHypixel"};
private int offGroundTicks = 0;
public static int ticksSinceVelocity = Integer.MAX_VALUE;

Expand Down Expand Up @@ -85,15 +88,15 @@ public void onUpdate() {
mc.thePlayer.motionY = 0.42;
break;
case 10:
if (!BlockUtils.isFullBlock(keystrokesmod.utility.BlockUtils.getBlockState(mc.thePlayer.getPosition().down())))
break;

MoveUtil.strafe(0.315);
mc.thePlayer.motionY = -0.28;
break;
case 11:
MoveUtil.strafe();
break;
case 12:
MoveUtil.stop();
break;
}
}
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package keystrokesmod.module.impl.other.anticheats.utils.world;

import net.minecraft.block.Block;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.state.IBlockState;
import org.jetbrains.annotations.NotNull;

public class BlockUtils {
public static boolean isFullBlock(@NotNull IBlockState blockState) {
return blockState.getBlock().isFullBlock();
Block block = blockState.getBlock();
return block instanceof BlockGlass || block.isFullBlock();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.script.classes.Vec3;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.render.RenderUtils;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.Packet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BreakProgress extends Module {
private ButtonSetting manual;
private ButtonSetting bedAura;
private String[] modes = new String[]{"Percentage", "Second", "Decimal"};
private float progress;
private double progress;
private BlockPos block;
private String progressStr;

Expand Down Expand Up @@ -76,7 +76,7 @@ public void onUpdate() {
return;
}
if (bedAura.isToggled() && ModuleManager.bedAura != null && ModuleManager.bedAura.isEnabled() && ModuleManager.bedAura.breakProgress != 0.0f && ModuleManager.bedAura.currentBlock != null && !(BlockUtils.getBlock(ModuleManager.bedAura.currentBlock) instanceof BlockBed)) {
this.progress = Math.min(1.0f, ModuleManager.bedAura.breakProgress);
this.progress = Math.min(1.0, ModuleManager.bedAura.breakProgress);
this.block = ModuleManager.bedAura.currentBlock;
if (this.block == null) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/keystrokesmod/module/impl/render/HUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.List;

public class HUD extends Module {
public static final String VERSION = "1.5.2";
public static final String VERSION = "1.5.3";
public static SliderSetting theme;
// public static SliderSetting font;
// public static SliderSetting fontSize;
Expand Down
Loading

0 comments on commit 3c86def

Please sign in to comment.