Skip to content

Commit

Permalink
Release 2.7.1 (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-mc authored Oct 1, 2024
1 parent c304d84 commit 0f0de7e
Show file tree
Hide file tree
Showing 24 changed files with 523 additions and 299 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ dependencies {
// implementation files('libraries/ViaRewind-4.0.3-SNAPSHOT.jar')
// implementation files('libraries/ViaVersion-5.0.4-SNAPSHOT.jar')

embed 'cn.hutool:hutool-all:5.8.26'
embed files('libraries/discord-rpc.jar')
embed files('libraries/json-20220924.jar')
// embed files('libraries/viaforge-1.8.9-3.3.3.jar')
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/keystrokesmod/Raven.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import keystrokesmod.utility.i18n.I18nManager;
import keystrokesmod.utility.profile.Profile;
import keystrokesmod.utility.profile.ProfileManager;
import keystrokesmod.utility.render.progress.ProgressManager;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.ClientCommandHandler;
Expand Down Expand Up @@ -47,6 +48,8 @@ public class Raven {
public static ScriptManager scriptManager;
public static Profile currentProfile;
public static BadPacketsHandler badPacketsHandler;
public static ProgressManager progressManager;
@SuppressWarnings({"unused", "FieldMayBeFinal"})
private boolean loaded = false;

public static int moduleCounter;
Expand All @@ -66,6 +69,7 @@ public void init(FMLInitializationEvent ignored) {
FMLCommonHandler.instance().bus().register(new KeySrokeRenderer());
FMLCommonHandler.instance().bus().register(new Ping());
FMLCommonHandler.instance().bus().register(badPacketsHandler = new BadPacketsHandler());
FMLCommonHandler.instance().bus().register(progressManager = new ProgressManager());
Reflection.getFields();
Reflection.getMethods();
moduleManager.register();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/keystrokesmod/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public class ModuleManager {
public static ViaVersionFix viaVersionFix;
public static AutoGapple autoGapple;
public static RemoteShop remoteShop;
public static Regen regen;

public void register() {

Expand Down Expand Up @@ -312,6 +313,7 @@ public void register() {
this.addModule(antiFalseFlag = new AntiFalseFlag());
this.addModule(viaVersionFix = new ViaVersionFix());
this.addModule(remoteShop = new RemoteShop());
this.addModule(regen = new Regen());

// enable
antiBot.enable();
Expand Down
50 changes: 18 additions & 32 deletions src/main/java/keystrokesmod/module/impl/combat/AutoGapple.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import keystrokesmod.event.*;
import keystrokesmod.mixins.impl.network.S14PacketEntityAccessor;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.other.RotationHandler;
import keystrokesmod.module.impl.other.SlotHandler;
import keystrokesmod.module.impl.player.Blink;
import keystrokesmod.module.setting.impl.ButtonSetting;
Expand All @@ -13,7 +12,8 @@
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.render.Animation;
import keystrokesmod.utility.render.Easing;
import keystrokesmod.utility.render.RenderUtils;
import keystrokesmod.utility.render.progress.Progress;
import keystrokesmod.utility.render.progress.ProgressManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -46,12 +46,13 @@ public class AutoGapple extends Module {
private int releaseLeft = 0;
private int foodSlot;

private float yaw, pitch;
private final Animation progress = new Animation(Easing.EASE_OUT_CIRC, 500);
private final Queue<Packet<?>> delayedSend = new ConcurrentLinkedQueue<>();
private final Queue<Packet<INetHandlerPlayClient>> delayedReceive = new ConcurrentLinkedQueue<>();
private final HashMap<Integer, RealPositionData> realPositions = new HashMap<>();

private final Animation animation = new Animation(Easing.EASE_OUT_CIRC, 500);
private final Progress progress = new Progress("AutoGapple");

public AutoGapple() {
super("AutoGapple", category.combat, "Made for QuickMacro.");
this.registerSetting(minHealth = new SliderSetting("Min health", 10, 1, 20, 1));
Expand All @@ -70,6 +71,7 @@ public void onDisable() {
releaseLeft = 0;
release();
realPositions.clear();
ProgressManager.remove(progress);
}

@SubscribeEvent
Expand Down Expand Up @@ -97,8 +99,6 @@ public void onPreUpdate(PreUpdateEvent event) {

if (releaseLeft > 0) {
releaseLeft--;
working = false;
return;
}

if (!Utils.nullCheck() || mc.thePlayer.getHealth() >= minHealth.getInput() || (onlyWhileKillAura.isToggled() && KillAura.target == null)) {
Expand All @@ -120,11 +120,14 @@ public void onPreUpdate(PreUpdateEvent event) {
return;
}

if (releaseLeft > 0)
return;

foodSlot = eat();
if (foodSlot != -1) {
progress.reset();
animation.reset();
eatingTicksLeft = 36;
progress.setValue(eatingTicksLeft);
animation.setValue(eatingTicksLeft);
if (airStuck.isToggled()) {
mc.theWorld.playerEntities.parallelStream()
.filter(p -> p != mc.thePlayer)
Expand Down Expand Up @@ -210,10 +213,9 @@ public void onReceivePacket(ReceivePacketEvent event) {
S12PacketEntityVelocity velo = (S12PacketEntityVelocity) p;
if (velo.getEntityID() == mc.thePlayer.getEntityId()) {
if (releaseTicksAfterVelocity.getInput() > 0) {
working = false;
releaseLeft = (int) releaseTicksAfterVelocity.getInput();
release();
}
return;
}
}

Expand All @@ -224,11 +226,8 @@ public void onReceivePacket(ReceivePacketEvent event) {

@SubscribeEvent
public void onMove(PreMoveEvent event) {
if (working && airStuck.isToggled()) {
if (working && airStuck.isToggled() && releaseLeft == 0) {
event.setCanceled(true);
} else {
yaw = RotationHandler.getRotationYaw();
pitch = RotationHandler.getRotationPitch();
}
}

Expand All @@ -244,22 +243,6 @@ private int eat() {
return slot;
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRotation(RotationEvent event) {
if (working && airStuck.isToggled()) {
event.setYaw(yaw);
event.setPitch(pitch);
}
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPreMotion(PreMotionEvent event) {
if (working && airStuck.isToggled()) {
event.setYaw(yaw);
event.setPitch(pitch);
}
}

@SubscribeEvent
public void onRender2D(TickEvent.RenderTickEvent event) {
if (!Utils.nullCheck() || mc.thePlayer.isDead) {
Expand All @@ -270,9 +253,12 @@ public void onRender2D(TickEvent.RenderTickEvent event) {
foodSlot = -1;
}

animation.run(eatingTicksLeft);
if (working && visual.isToggled()) {
progress.run(eatingTicksLeft);
RenderUtils.drawProgressBar((32 - progress.getValue()) / 32, "AutoGapple");
progress.setProgress((32 - animation.getValue()) / 32);
ProgressManager.add(progress);
} else {
ProgressManager.remove(progress);
}
}

Expand Down
38 changes: 38 additions & 0 deletions src/main/java/keystrokesmod/module/impl/exploit/Regen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package keystrokesmod.module.impl.exploit;

import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.PacketUtils;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class Regen extends Module {
private final SliderSetting speed;
private final SliderSetting minHealth;
private final ButtonSetting notInAir;
private final ButtonSetting groundSpoof;

public Regen() {
super("Regen", category.exploit);
this.registerSetting(speed = new SliderSetting("Speed", 10, 1, 200, 1, "x"));
this.registerSetting(minHealth = new SliderSetting("Min health", 15, 5, 40, 1));
this.registerSetting(notInAir = new ButtonSetting("Not in air", false));
this.registerSetting(groundSpoof = new ButtonSetting("Ground spoof", false));
}

@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (mc.thePlayer.getHealth() > minHealth.getInput()) return;
if (notInAir.isToggled() && !mc.thePlayer.onGround) return;

for (int i = 0; i < speed.getInput(); i++) {
if (groundSpoof.isToggled()) {
PacketUtils.sendPacket(new C03PacketPlayer(true));
} else {
PacketUtils.sendPacket(new C03PacketPlayer(event.isOnGround()));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.render.Animation;
import keystrokesmod.utility.render.Easing;
import keystrokesmod.utility.render.RenderUtils;
import keystrokesmod.utility.render.progress.Progress;
import keystrokesmod.utility.render.progress.ProgressManager;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
Expand All @@ -22,6 +23,8 @@ public class HypixelMotionDisabler extends SubMode<HypixelDisabler> {
private int offGroundTicks = 0;
private static boolean isFinished = false;
private final Animation animation = new Animation(Easing.EASE_OUT_CIRC, 500);
private final Progress progress = new Progress("Disabler");

private final ButtonSetting lobbyCheck;

public HypixelMotionDisabler(String name, @NotNull HypixelDisabler parent) {
Expand All @@ -38,7 +41,7 @@ public static boolean isDisabled() {

@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (isFinished) return;
if (isFinished || !Utils.nullCheck() || mc.thePlayer.ticksExisted < 5) return;
if (lobbyCheck.isToggled() && Utils.isLobby()) return;
if (mc.thePlayer.onGround) {
if (!Utils.jumpDown())
Expand All @@ -61,6 +64,7 @@ public void onReceivePacket(@NotNull ReceivePacketEvent event) {
flagged = 0;
Notifications.sendNotification(Notifications.NotificationTypes.INFO, "WatchDog Motion is disable.");
isFinished = true;
ProgressManager.remove(progress);
}
}
}
Expand All @@ -70,6 +74,9 @@ public void onWorldChange(WorldChangeEvent event) {
isFinished = false;
this.flagged = 0;
animation.setValue(flagged);
if (!lobbyCheck.isToggled() || !Utils.isLobby()) {
ProgressManager.add(progress);
}
}

@Override
Expand All @@ -82,19 +89,17 @@ public void onUpdate() {

@Override
public void onDisable() {
onWorldChange(null);
isFinished = false;
ProgressManager.remove(progress);
}

@SubscribeEvent
public void onRender(TickEvent.RenderTickEvent event) {
if (!isFinished) {
if (lobbyCheck.isToggled() && Utils.isLobby()) {
// RenderUtils.drawProgressBar(0, "You are in the lobby");
} else {
animation.run(flagged);
RenderUtils.drawProgressBar(Math.min(animation.getValue() / 20.0, 1),
"Disabler " + (int)(animation.getValue() / 20.0 * 100) + "%");
}
animation.run(flagged);

progress.setText("Disabler " + (int)(animation.getValue() / 20.0 * 100) + "%");
progress.setProgress(Math.min(animation.getValue() / 20.0, 1));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import keystrokesmod.utility.Utils;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.network.play.server.S12PacketEntityVelocity;
import net.minecraft.network.play.server.S32PacketConfirmTransaction;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -28,10 +30,7 @@ public class HypixelBowLongJump extends SubMode<LongJump> {
private final ButtonSetting autoDisable;

private State state = State.SELF_DAMAGE;
private double cacheMotionX;
private double cacheMotionY;
private double cacheMotionZ;
private final Queue<S32PacketConfirmTransaction> delayedPackets = new ConcurrentLinkedQueue<>();
private final Queue<Packet<INetHandlerPlayClient>> delayedPackets = new ConcurrentLinkedQueue<>();

public HypixelBowLongJump(String name, @NotNull LongJump parent) {
super(name, parent);
Expand All @@ -54,17 +53,14 @@ public void onMoveInput(MoveInputEvent event) {

@SubscribeEvent
public void onReceivePacket(@NotNull ReceivePacketEvent event) {
if (event.getPacket() instanceof S12PacketEntityVelocity && state == State.SELF_DAMAGE) {
if (event.getPacket() instanceof S12PacketEntityVelocity && (state == State.SELF_DAMAGE || state == State.JUMP)) {
S12PacketEntityVelocity packet = (S12PacketEntityVelocity) event.getPacket();
if (packet.getEntityID() != mc.thePlayer.getEntityId()) return;

cacheMotionX = packet.getMotionX() / 8000.0;
cacheMotionY = packet.getMotionY() / 8000.0;
cacheMotionZ = packet.getMotionZ() / 8000.0;
event.setCanceled(true);
delayedPackets.add(event.getPacket());
state = State.JUMP;
} else if (event.getPacket() instanceof S32PacketConfirmTransaction && state == State.JUMP) {
delayedPackets.add((S32PacketConfirmTransaction) event.getPacket());
} else if (event.getPacket() instanceof S32PacketConfirmTransaction && (state == State.SELF_DAMAGE || state == State.JUMP)) {
delayedPackets.add(event.getPacket());
}
}

Expand Down Expand Up @@ -94,11 +90,8 @@ public void onPrePlayerInput(PrePlayerInputEvent event) {
break;
case APPLY:
if (parent.offGroundTicks >= 7) {
mc.thePlayer.motionX = cacheMotionX;
mc.thePlayer.motionY = cacheMotionY;
mc.thePlayer.motionZ = cacheMotionZ;
synchronized (delayedPackets) {
for (S32PacketConfirmTransaction p : delayedPackets) {
for (Packet<INetHandlerPlayClient> p : delayedPackets) {
PacketUtils.receivePacket(p);
}
delayedPackets.clear();
Expand Down
Loading

0 comments on commit 0f0de7e

Please sign in to comment.