Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
L1shed committed Oct 5, 2024
2 parents fc4c8c4 + 1080443 commit 662936a
Show file tree
Hide file tree
Showing 45 changed files with 1,107 additions and 329 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ apply plugin: 'java'

group = "keystrokesmod"
archivesBaseName = "raven-XD"
//version = "Dev"
version = "Dev"

compileJava {
sourceCompatibility = '1.8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.ThreadQuickExitException;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -67,23 +68,9 @@ public void onProcessPacket(Packet<?> instance, INetHandler handler) {
((Packet<INetHandler>) instance).processPacket(handler);
} catch (ThreadQuickExitException ignored) { // 😅 Minecraft wtf
} catch (Exception e) {
try {
if (ModuleManager.exploitFixer != null && ModuleManager.exploitFixer.isEnabled() && ExploitFixer.safePacketProcess != null && ExploitFixer.safePacketProcess.isToggled()) {
final StringBuilder stackTraces = new StringBuilder();

Arrays.stream(e.getStackTrace())
.limit(7)
.parallel()
.map(s -> "\n " + ChatFormatting.RED + "at " + ChatFormatting.AQUA + s)
.forEach(stackTraces::append);

Utils.sendMessage(String.format(
"%sCatch %s on processing packet <%s>.%s",
ChatFormatting.RED, e.getClass(), instance.toString(), stackTraces
));
}
} catch (Throwable ignored) {
}
ExploitFixer.onBadPacket(instance, e);
}
}


}
41 changes: 34 additions & 7 deletions src/main/java/keystrokesmod/module/impl/combat/KillAura.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import keystrokesmod.script.classes.Vec3;
import keystrokesmod.utility.*;
import keystrokesmod.utility.aim.AimSimulator;
import keystrokesmod.utility.aim.RotationData;
import keystrokesmod.utility.render.Animation;
import keystrokesmod.utility.render.Easing;
import keystrokesmod.utility.render.RenderUtils;
Expand Down Expand Up @@ -90,6 +91,7 @@ public class KillAura extends IAutoClicker {
private final ButtonSetting disableWhileMining;
private final ButtonSetting fixSlotReset;
private final ButtonSetting fixNoSlowFlag;
private final ButtonSetting fixHypixelSwitch;
private final SliderSetting postDelay;
private final ButtonSetting hitThroughBlocks;
private final ButtonSetting ignoreTeammates;
Expand Down Expand Up @@ -175,6 +177,7 @@ public KillAura() {
this.registerSetting(fixSlotReset = new ButtonSetting("Fix slot reset", false));
this.registerSetting(fixNoSlowFlag = new ButtonSetting("Fix NoSlow flag", false));
this.registerSetting(postDelay = new SliderSetting("Post delay", 10, 1, 20, 1, fixNoSlowFlag::isToggled));
this.registerSetting(fixHypixelSwitch = new ButtonSetting("Fix hypixel switch (beta)", false, () -> moveFixMode.getInput() == 0));
this.registerSetting(hitThroughBlocks = new ButtonSetting("Hit through blocks", true));
this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", true));
this.registerSetting(manualBlock = new ButtonSetting("Manual block", false));
Expand Down Expand Up @@ -370,22 +373,44 @@ else if (blinking || lag) {
}

@SubscribeEvent(priority = EventPriority.LOW)
public void onPreMotion(RotationEvent e) {
public void onRotation(RotationEvent event) {
if (!fixHypixelSwitch.isToggled() || moveFixMode.getInput() != 0) {
RotationData data = doRotationAction(new RotationData(event.getYaw(), event.getPitch()));
if (data != null) {
event.setYaw(data.getYaw());
event.setPitch(data.getPitch());
event.setMoveFix(RotationHandler.MoveFix.values()[(int) moveFixMode.getInput()]);
}
}
}

@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (fixHypixelSwitch.isToggled() && moveFixMode.getInput() == 0) {
RotationData data = doRotationAction(new RotationData(event.getYaw(), event.getPitch()));
if (data != null) {
event.setYaw(data.getYaw());
event.setPitch(data.getPitch());
}
}
}


private @Nullable RotationData doRotationAction(RotationData e) {
if (gameNoAction() || playerNoAction()) {
return;
return null;
}
setTarget(new float[]{e.getYaw(), e.getPitch()});
if (target != null && rotationMode.getInput() == 1) {
e.setYaw(rotations[0]);
e.setPitch(rotations[1]);
e.setMoveFix(RotationHandler.MoveFix.values()[(int) moveFixMode.getInput()]);
return new RotationData(rotations[0], rotations[1]);
} else {
this.rotations = new float[]{mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch};
}
if (autoBlockMode.getInput() == 2 && block.get() && Utils.holdingSword()) {
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem % 8 + 1));
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem));
}
return null;
}

@SubscribeEvent
Expand Down Expand Up @@ -467,8 +492,10 @@ public boolean noAimToEntity() {
noAim = hitResult.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || hitResult.entityHit != target;
case 1:
if (noAim) break;
Object[] rayCasted = Reach.getEntity(attackRange.getInput(), -0.05, rotationMode.getInput() == 1 ? rotations : null);
noAim = rayCasted == null || Arrays.stream(rayCasted).noneMatch(o -> o == target);
noAim = RotationUtils.rayCast(
Utils.getEyePos().distanceTo(RotationUtils.getNearestPoint(target.getEntityBoundingBox(), Utils.getEyePos())),
rotations[0], rotations[1]
) != null;
break;
case 0:
return false;
Expand Down
Loading

0 comments on commit 662936a

Please sign in to comment.