Skip to content

Commit

Permalink
Release 1.21.0 (#690)
Browse files Browse the repository at this point in the history
Co-authored-by: Dylan <[email protected]>
  • Loading branch information
xia-mc and dylan0356 authored Aug 2, 2024
1 parent 73e2820 commit 73c810e
Show file tree
Hide file tree
Showing 42 changed files with 1,772 additions and 675 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'java'

group = "keystrokesmod"
archivesBaseName = "raven-XD"
//version = "1.20-dev"
//version = "1.21-dev"

compileJava {
sourceCompatibility = '1.8'
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package keystrokesmod.clickgui.components.impl;

import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.setting.Setting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.utility.Theme;
import net.minecraft.client.Minecraft;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.opengl.GL11;

import java.awt.*;

public class DescriptionComponent extends Component {
private final DescriptionSetting desc;

@Nullable
@Override
public Setting getSetting() {
return desc;
}

public DescriptionComponent(DescriptionSetting desc, ModuleComponent b, int o) {
super(b);
this.desc = desc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,12 @@ public void onLivingUpdate() {
boolean flag2 = this.movementInput.moveForward >= f;
this.movementInput.updatePlayerMoveState();
boolean usingItemModified = this.isUsingItem() || (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && ModuleManager.killAura.block.get() && ((Object) this) == Minecraft.getMinecraft().thePlayer && ModuleManager.killAura.rmbDown && ModuleManager.killAura.manualBlock.isToggled());
boolean stopSprint = this.isUsingItem() && ModuleManager.noSlow != null && ModuleManager.noSlow.isEnabled() && NoSlow.slowed.getInput() == 80;
boolean stopSprint = this.isUsingItem() && ModuleManager.noSlow != null && ModuleManager.noSlow.isEnabled() && NoSlow.getForwardSlowed() == 0.8;
if (usingItemModified && !this.isRiding()) {
MovementInput var10000 = this.movementInput;
float slowed = NoSlow.getSlowed();
var10000.moveStrafe *= slowed;
var10000.moveStrafe *= NoSlow.getStrafeSlowed();
var10000 = this.movementInput;
var10000.moveForward *= slowed;
var10000.moveForward *= NoSlow.getForwardSlowed();
if (stopSprint) {
this.sprintToggleTimer = 0;
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/keystrokesmod/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ModuleManager {
public static Module antiShuffle;
public static Module commandLine;
public static Module antiBot;
public static Module noSlow;
public static NoSlow noSlow;
public static KillAura killAura;
public static AutoClicker autoClicker;
public static HitBox hitBox;
Expand Down Expand Up @@ -102,6 +102,9 @@ public class ModuleManager {
public static ExploitFixer exploitFixer;
public static AutoRegister autoRegister;
public static NoteBot noteBot;
public static ViewPackets viewPackets;
public static ArmedAura armedAura;
public static HitLog hitLog;

public void register() {

Expand Down Expand Up @@ -129,6 +132,7 @@ public void register() {
this.addModule(new JumpReset());
this.addModule(killAura = new KillAura());
this.addModule(killAuraV2 = new KillAuraV2());
this.addModule(armedAura = new ArmedAura());
this.addModule(moreKB = new MoreKB());
this.addModule(reach = new Reach());
this.addModule(new RodAimbot());
Expand All @@ -139,7 +143,8 @@ public void register() {
this.addModule(new ExtraBobbing());
this.addModule(new FlameTrail());
this.addModule(new SlyPort());
this.addModule(new Spin());
this.addModule(new AntiAim());
this.addModule(hitLog = new HitLog());
this.addModule(noteBot = new NoteBot());

// minigames
Expand Down Expand Up @@ -183,6 +188,7 @@ public void register() {
this.addModule(staffDetector = new StaffDetector());
this.addModule(new BedProximityAlert());
this.addModule(autoRegister = new AutoRegister());
this.addModule(viewPackets = new ViewPackets());

// player
this.addModule(new AntiAFK());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public Notifications() {
this.registerSetting(moduleToggled = new ButtonSetting("Module toggled", true));
}

@Override
public void onEnable() {
notifs.clear();
}

public static void sendNotification(NotificationTypes notificationType, String message) {
sendNotification(notificationType, message, 3000);
}
Expand Down
235 changes: 235 additions & 0 deletions src/main/java/keystrokesmod/module/impl/combat/ArmedAura.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
package keystrokesmod.module.impl.combat;

import akka.japi.Pair;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.event.RotationEvent;
import keystrokesmod.module.impl.client.Notifications;
import keystrokesmod.module.impl.combat.autoclicker.DragClickAutoClicker;
import keystrokesmod.module.impl.combat.autoclicker.IAutoClicker;
import keystrokesmod.module.impl.combat.autoclicker.NormalAutoClicker;
import keystrokesmod.module.impl.combat.autoclicker.RecordAutoClicker;
import keystrokesmod.module.impl.fun.HitLog;
import keystrokesmod.module.impl.other.RotationHandler;
import keystrokesmod.module.impl.other.SlotHandler;
import keystrokesmod.module.impl.other.anticheats.utils.world.PlayerRotation;
import keystrokesmod.module.impl.player.Blink;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.ModeSetting;
import keystrokesmod.module.setting.impl.ModeValue;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.script.classes.Vec3;
import keystrokesmod.utility.MoveUtil;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.tuple.Triple;
import org.jetbrains.annotations.NotNull;

import java.util.Comparator;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;

public class ArmedAura extends IAutoClicker {
private final ModeValue clickMode;
private final SliderSetting range;
private final ButtonSetting perfect;
private final ModeSetting moveFix;
private final ButtonSetting prediction;
private final ButtonSetting smart;
private final SliderSetting predictionTicks;
private final ButtonSetting drawPos;
private final ButtonSetting autoSwitch;
private final ButtonSetting fastFire;
private final SliderSetting fastFireAmount;
private final ButtonSetting targetInvisible;
private final ButtonSetting ignoreTeammates;

private boolean targeted = false;
private Pair<Pair<EntityPlayer, Vec3>, Triple<Double, Float, Float>> target = null;
private boolean click = false;
private int predTicks = 0;
private net.minecraft.util.Vec3 pos = null;
private final Set<Integer> fired = new HashSet<>();

public ArmedAura() {
super("ArmedAura", category.combat);
this.registerSetting(clickMode = new ModeValue("Click mode", this)
.add(new NormalAutoClicker("Normal", this, false, true))
.add(new DragClickAutoClicker("Drag Click", this, false, true))
.add(new RecordAutoClicker("Record", this, false, true))
.setDefaultValue("Normal")
);
this.registerSetting(range = new SliderSetting("Range", 50, 0, 100, 5));
this.registerSetting(moveFix = new ModeSetting("Move fix", RotationHandler.MoveFix.MODES, 0));
this.registerSetting(perfect = new ButtonSetting("Perfect", false));
this.registerSetting(prediction = new ButtonSetting("Prediction", false));
this.registerSetting(smart = new ButtonSetting("Smart", true, prediction::isToggled));
this.registerSetting(predictionTicks = new SliderSetting("Prediction ticks", 2, 0, 10, 1, "ticks", () -> prediction.isToggled() && !smart.isToggled()));
this.registerSetting(drawPos = new ButtonSetting("Draw pos", false, prediction::isToggled));
this.registerSetting(autoSwitch = new ButtonSetting("Auto switch", true));
this.registerSetting(fastFire = new ButtonSetting("Fast fire", false, autoSwitch::isToggled));
this.registerSetting(fastFireAmount = new SliderSetting("Fast fire amount", 1, 1, 4, 1, () -> autoSwitch.isToggled() && fastFire.isToggled()));
this.registerSetting(targetInvisible = new ButtonSetting("Target invisible", false));
this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", true));
}

@SubscribeEvent
public void onRotation(RotationEvent event) {
if (!targeted && !(perfect.isToggled() && mc.thePlayer.experience % 1 != 0)) {
final Optional<Pair<Pair<EntityPlayer, Vec3>, Triple<Double, Float, Float>>> target = mc.theWorld.playerEntities.parallelStream()
.filter(p -> p != mc.thePlayer)
.filter(p -> !AntiBot.isBot(p))
.filter(p -> !Utils.isTeamMate(p) || !ignoreTeammates.isToggled())
.filter(entity -> targetInvisible.isToggled() || !entity.isInvisible())
.filter(p -> p.getDistanceToEntity(mc.thePlayer) < range.getInput())
.map(p -> new Pair<>(p, doPrediction(Utils.getEyePos(p), new Vec3(p.motionX, p.motionY, p.motionZ))))
.map(pair -> new Pair<>(pair, Triple.of(pair.second().distanceTo(Utils.getEyePos()), PlayerRotation.getYaw(pair.second()), PlayerRotation.getPitch(pair.second()))))
.filter(pair -> RotationUtils.rayCast(pair.second().getLeft(), pair.second().getMiddle(), pair.second().getRight()) == null)
.min(Comparator.comparingDouble(pair -> mc.thePlayer.getDistanceSqToEntity(pair.first().first())));
if (target.isPresent()) {
if (SlotHandler.getHeldItem() != null && SlotHandler.getHeldItem().getItem() instanceof ItemHoe) {
event.setYaw(target.get().second().getMiddle());
event.setPitch(target.get().second().getRight());
event.setMoveFix(RotationHandler.MoveFix.values()[(int) moveFix.getInput()]);
pos = target.get().first().second().add(0, -target.get().first().first().getEyeHeight(), 0).toVec3();
this.target = target.get();
}
targeted = true;
} else {
targeted = false;
}
}
}

@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event) {
if (drawPos.isToggled() && prediction.isToggled() && pos != null) {
Blink.drawBox(pos);
}
}

@SubscribeEvent
public void onPreUpdate(PreUpdateEvent event) {
if (targeted && autoSwitch.isToggled()) {
int bestArm = getBestArm();
SlotHandler.setCurrentSlot(bestArm);
}

if (SlotHandler.getHeldItem() == null || !(SlotHandler.getHeldItem().getItem() instanceof ItemHoe)) {
targeted = false;
return;
}

if (targeted && click) {
Notifications.sendNotification(Notifications.NotificationTypes.INFO, "attack");
mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, SlotHandler.getHeldItem());
if (fastFire.isToggled() && autoSwitch.isToggled()) {
for (int i = 0; i < (int) fastFireAmount.getInput(); i++) {
int bestArm = getBestArm();
SlotHandler.setCurrentSlot(bestArm);
mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, SlotHandler.getHeldItem());
}
}
if (target != null)
HitLog.onAttack(predTicks, target.first().first(), Utils.getEyePos(target.first().first()), new Vec3(mc.thePlayer), RotationHandler.getRotationYaw(), RotationHandler.getRotationPitch());
targeted = false;
}
}

private int getBestArm() {
int arm = -1;
int level = -1;
for (int i = 0; i < 9; i++) {
ItemStack stack = mc.thePlayer.inventory.mainInventory[i];
if (stack != null && stack.getItem() instanceof ItemHoe) {
if (fastFire.isToggled() && fired.contains(i))
continue;

int curLevel;
String name = ((ItemHoe) stack.getItem()).getMaterialName().toLowerCase();
switch (name) {
default:
case "wood":
curLevel = 1;
break;
case "stone":
curLevel = 2;
break;
case "iron":
curLevel = 3;
break;
case "gold":
curLevel = 4;
break;
case "diamond":
curLevel = 5;
break;
}

if (curLevel > level) {
level = curLevel;
arm = i;
}
}
}

if (arm == -1 && !fired.isEmpty()) {
fired.clear();
return getBestArm();
}
fired.add(arm);
return arm;
}

@Override
public void onUpdate() {
if (prediction.isToggled()) {
if (smart.isToggled()) {
predTicks = (int) Math.floor(mc.getNetHandler().getPlayerInfo(mc.thePlayer.getUniqueID()).getResponseTime() / 50.0);
} else {
predTicks = (int) predictionTicks.getInput();
}
} else {
predTicks = 0;
}
}

private @NotNull Vec3 doPrediction(@NotNull Vec3 pos, Vec3 motion) {
Vec3 result = new Vec3(pos.toVec3());
for (int i = 0; i < predTicks; i++) {
result = result.add(
MoveUtil.predictedMotionXZ(motion.x(), i),
mc.thePlayer.onGround ? 0 : MoveUtil.predictedMotion(motion.y(), i),
MoveUtil.predictedMotionXZ(motion.z(), i)
);
}
return result;
}

@Override
public void onEnable() {
clickMode.enable();
targeted = false;
click = false;
predTicks = 0;
fired.clear();
pos = null;
}

@Override
public void onDisable() {
clickMode.disable();
}

@Override
public boolean click() {
click = true;
return targeted;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.jetbrains.annotations.NotNull;

public class NormalAutoClicker extends SubMode<IAutoClicker> {
private final SliderSetting minCPS = new SliderSetting("Min CPS", 8, 1, 20, 0.1);
private final SliderSetting maxCPS = new SliderSetting("Max CPS", 14, 1, 20, 0.1);
private final SliderSetting minCPS = new SliderSetting("Min CPS", 8, 1, 40, 0.1);
private final SliderSetting maxCPS = new SliderSetting("Max CPS", 14, 1, 40, 0.1);
private final ButtonSetting butterFly = new ButtonSetting("Butterfly", true);
private final boolean leftClick;
private final boolean rightClick;
Expand Down
Loading

0 comments on commit 73c810e

Please sign in to comment.