This commit is contained in:
jackh 2025-01-20 22:47:10 -07:00
parent 24193c5a9a
commit 955f09e05e
6 changed files with 180 additions and 86 deletions

View File

@ -90,9 +90,9 @@ public class KillAura extends Module {
private boolean partialDown;
private int partialTicks;
private int firstEdge;
private boolean blocked;
private int unBlockDelay;
private boolean canBlockServerside;
private boolean checkUsing;
// blink related
private ConcurrentLinkedQueue<Packet> blinkedPackets = new ConcurrentLinkedQueue<>();
@ -112,9 +112,11 @@ public class KillAura extends Module {
private int delayTicks = 0;
private boolean lastPressedLeft;
private boolean lastPressedRight;
private boolean sendDig = true;
private boolean usedWhileTargeting;
private boolean disableCheckUsing;
private int disableCTicks;
public KillAura() {
super("KillAura", category.combat);
this.registerSetting(aps = new SliderSetting("APS", 16.0, 1.0, 20.0, 0.5));
@ -161,7 +163,7 @@ public class KillAura extends Module {
public void onDisable() {
handleBlocking(false);
hitMap.clear();
if (blinkAutoBlock()) { // interact autoblock
if (blinkAutoBlock() || autoBlockMode.getInput() == 2) { // interact autoblock
resetBlinkState(true);
}
blinking.set(false);
@ -206,7 +208,30 @@ public class KillAura extends Module {
@SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) {
if (!Utils.nullCheck()) {
return;
}
if (target != null && Mouse.isButtonDown(0)) {
swingItem();
}
if (checkUsing && disableCheckUsing && ++disableCTicks >= 2) {
checkUsing = false;
}
if (autoBlockOverride() && target != null) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
}
if (target == null) {
if (checkUsing && Mouse.isButtonDown(1) && !blinkAutoBlock()) {
if (!sendUnBlock) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), true);
checkUsing = false;
}
}
}
if (!checkUsing) {
disableCheckUsing = false;
disableCTicks = 0;
}
if (blinkAutoBlock()) {
EntityLivingBase g = Utils.raytrace(3);
/*if ((g != null || BlockUtils.isInteractable(mc.objectMouseOver)) && Utils.holdingSword()) {
@ -258,27 +283,32 @@ public class KillAura extends Module {
}
lastPressedLeft = pressedLeft;
}
if (sendDig && ++unBlockDelay >= 2) {
if (target == null && !ModuleManager.bedAura.stopAutoblock && blocked) {
sendDigPacket();
}
sendDig = blocked = false;
unBlockDelay = 0;
}
delayTicks--;
if (sendUnBlock) {
if (Raven.packetsHandler.C07.get()) {
/*if (Raven.packetsHandler.C07.get()) {
sendUnBlock = false;
return;
}
if (!Utils.keybinds.isMouseDown(1)) {
Reflection.setItemInUse(blockingClient = false);
}*/
/*if (unBlockDelay > 0) {
++unBlockDelay;
if (unBlockDelay >= 3) {
unBlockDelay = 0;
}
return;
}*/
if (!ModuleManager.bedAura.stopAutoblock) {
sendDigPacket();
if (blockingClient) {
Reflection.setItemInUse(blockingClient = false);
}
}
sendUnBlock = false;
//Utils.print("Dig 2");
unBlockDelay = 0;
disableCheckUsing = true;
return;
}
if (ModuleManager.blink.isEnabled()) {
if (blinking.get() || lag) {
resetBlinkState(true);
@ -308,14 +338,6 @@ public class KillAura extends Module {
handleBlocking(false);
return;
}
double distanceToBB = getDistanceToBoundingBox(target);
boolean inBlockRange = distanceToBB <= blockRange.getInput();
if ((blinkAutoBlock() && !Utils.holdingSword()) || !inBlockRange) { // for blink autoblocks
if (blinking.get() || lag) {
resetBlinkState(true);
//Utils.print("2");
}
}
if (delayTicks >= 0) {
return;
}
@ -323,15 +345,28 @@ public class KillAura extends Module {
resetYaw();
reset = false;
}
double distanceToBB = getDistanceToBoundingBox(target);
boolean inBlockRange = distanceToBB <= blockRange.getInput();
if (!autoBlockOverride() || !inBlockRange) { // regular swing & attack if autoblock isnt overriding or isnt in autoblock range
handleSwingAndAttack(distanceToBB, false);
}
if (inBlockRange && autoBlockOverride() && manualBlock()) {
if (inBlockRange && autoBlockOverride()) {
handleAutoBlock(distanceToBB);
if (manualBlock.isToggled()) {
handleBlocking(manualBlock());
} else {
handleBlocking(true);
}
}
if (inBlockRange && manualBlock()) {
handleBlocking(true);
if (((blinkAutoBlock() || autoBlockMode.getInput() == 2) && !Utils.holdingSword()) || !inBlockRange || !manualBlock()) { // for blink autoblocks
if (blinking.get() || lag) {
resetBlinkState(true);
//Utils.print("2");
}
}
if (mc.currentScreen == null || mc.currentScreen.allowUserInput) {
boolean pressedRight = Mouse.isButtonDown(1);
if (pressedRight && !lastPressedRight) {
@ -401,6 +436,9 @@ public class KillAura extends Module {
mc.thePlayer.rotationPitch = smoothedRotations[1];
}
}
if (target != null) {
checkUsing = true;
}
if (target != null && attackingEntity != null && inRange(target, attackRange.getInput())) {
isTargeting = true;
}
@ -447,7 +485,7 @@ public class KillAura extends Module {
}
public void onCustomMouse(int button, boolean state) {
if (blinkAutoBlock() || autoBlockMode.getInput() == 3) {
if (autoBlockOverride() || target == null) {
return;
}
if (button == 1) {
@ -714,11 +752,11 @@ public class KillAura extends Module {
}
return;
}
if (blinkAutoBlock() && target == null) {
if (target == null) {
return;
}
if (autoBlockMode.getInput() != previousAutoBlockMode) {
if (previousAutoBlockMode == 3 || previousAutoBlockMode == 4 || previousAutoBlockMode == 5 || previousAutoBlockMode == 6) { // if == interact
if (previousAutoBlockMode == 2 || previousAutoBlockMode == 3 || previousAutoBlockMode == 4 || previousAutoBlockMode == 5 || previousAutoBlockMode == 6) { // if == interact
resetBlinkState(true);
}
}
@ -731,19 +769,7 @@ public class KillAura extends Module {
this.blockingClient = blockState;
break;
case 2: // partial
if (!blockState) {
rightClick(partialDown = false);
break;
}
partialTicks++;
if (partialDown) {
rightClick(partialDown = false);
partialTicks = 0;
break;
}
else if (partialTicks == 2) {
rightClick(partialDown = true);
}
Reflection.setItemInUse(this.blockingClient = ModuleUtils.isBlocked);
break;
case 3: // interact a
case 4: // interact b
@ -769,7 +795,7 @@ public class KillAura extends Module {
}
public boolean autoBlockOverride() {
return blinkAutoBlock() && Utils.holdingSword();
return (blinkAutoBlock() || autoBlockMode.getInput() == 2) && Utils.holdingSword() && manualBlock();
}
public boolean blinkAutoBlock() {
@ -805,6 +831,24 @@ public class KillAura extends Module {
return;
}
switch ((int) autoBlockMode.getInput()) {
case 2: // partial
if (interactTicks >= 3) {
interactTicks = 0;
}
interactTicks++;
switch (interactTicks) {
case 1:
if (ModuleUtils.isBlocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
}
break;
case 2:
handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket();
lag = true;
break;
}
break;
case 3: // interact a
if (interactTicks >= 2) {
interactTicks = 0;
@ -813,15 +857,13 @@ public class KillAura extends Module {
switch (interactTicks) {
case 1:
blinking.set(true);
if (lag) {
if (ModuleUtils.isBlocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false;
}
break;
case 2:
handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket();
blocked = true;
releasePackets(); // release
lag = true;
break;
@ -837,7 +879,6 @@ public class KillAura extends Module {
blinking.set(true);
if (lag) {
setSwapSlot();
blocked = false;
swapped = true;
}
break;
@ -848,7 +889,6 @@ public class KillAura extends Module {
}
handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket();
blocked = true;
releasePackets(); // release
lag = true;
break;
@ -862,16 +902,15 @@ public class KillAura extends Module {
switch (interactTicks) {
case 1:
blinking.set(true);
if (blocked) {
if (ModuleUtils.isBlocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false;
}
break;
case 2:
handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket();
blocked = true;
releasePackets(); // release
lag = true;
break;
}
break;
@ -884,15 +923,13 @@ public class KillAura extends Module {
switch (interactTicks) {
case 1:
blinking.set(true);
if (blocked) {
if (ModuleUtils.isBlocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false;
}
break;
case 2:
handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket();
blocked = true;
releasePackets();
firstCycle = false;
lag = true;
@ -903,15 +940,13 @@ public class KillAura extends Module {
switch (interactTicks) {
case 1:
blinking.set(true);
if (blocked) {
if (ModuleUtils.isBlocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false;
}
break;
case 2:
handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket();
blocked = true;
releasePackets();
interactTicks = 0;
firstCycle = true;
@ -1149,8 +1184,9 @@ public class KillAura extends Module {
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem));
Raven.packetsHandler.playerSlot.set(mc.thePlayer.inventory.currentItem);
}
else if (unblock && lag && !ModuleManager.scaffold.isEnabled) {
sendDig = true;
else if (unblock && ModuleUtils.isBlocked && !ModuleManager.scaffold.isEnabled) {
unBlockDelay = 1;
sendUnBlock = true;
}
swapped = false;
lag = false;
@ -1159,7 +1195,7 @@ public class KillAura extends Module {
}
public void sendDigPacket() {
if (!Utils.holdingSword()) {
if (!Utils.holdingSword() || !ModuleUtils.isBlocked) {
return;
}
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
@ -1233,7 +1269,7 @@ public class KillAura extends Module {
}
private boolean manualBlock() {
return !manualBlock.isToggled() || Mouse.isButtonDown(1);
return (!manualBlock.isToggled() || Mouse.isButtonDown(1) && Utils.tabbedIn()) && Utils.holdingSword();
}
static class KillAuraTarget {

View File

@ -127,7 +127,7 @@ public class NoSlow extends Module {
if (!canFloat) {
return;
}
e.setPosY(e.getPosY() + 1E-11);
e.setPosY(e.getPosY() + ModuleUtils.offsetValue);
noSlowing = true;
if (groundSpeedOption.isToggled()) {
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !Utils.jumpDown() && mc.thePlayer.moveForward <= -0.5 && mc.thePlayer.moveStrafing == 0 && Utils.isMoving() && mc.thePlayer.onGround) {

View File

@ -75,7 +75,6 @@ public class NoFall extends Module {
Utils.getTimer().timerSpeed = (float) 0.72;
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
initialY = mc.thePlayer.posY;
edging = "nofall packet";
}
}
if (isFalling && mode.getInput() == 3) {
@ -88,7 +87,6 @@ public class NoFall extends Module {
if (distanceFallen >= 3) {
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
initialY = mc.thePlayer.posY;
edging = "nofall packet";
}
}
edging += " " + dynamic;
@ -129,7 +127,7 @@ public class NoFall extends Module {
if (mc.thePlayer.onGround) {
return true;
}
if (BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY- 1, mc.thePlayer.posZ)) != Blocks.air) {
if (BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - 1, mc.thePlayer.posZ)) != Blocks.air) {
return true;
}
if (mc.thePlayer.motionY > -0.0784) {
@ -138,7 +136,7 @@ public class NoFall extends Module {
if (mc.thePlayer.capabilities.isCreativeMode) {
return true;
}
if (isVoid() && mc.thePlayer.posY <= 40) {
if (isVoid() && mc.thePlayer.posY <= 41) {
return true;
}
if (mc.thePlayer.capabilities.isFlying) {

View File

@ -215,7 +215,7 @@ public class Scaffold extends Module {
floatKeepY = false;
startYPos = -1;
if (moduleEnabled) {
e.setPosY(e.getPosY() + 1E-11);
e.setPosY(e.getPosY() + ModuleUtils.offsetValue);
if (Utils.isMoving()) Utils.setSpeed(getFloatSpeed(getSpeedLevel()));
}
}
@ -306,14 +306,17 @@ public class Scaffold extends Module {
if (blockRotations != null) {
blockYaw = blockRotations[0];
pitch = blockRotations[1];
if (pitch < 78.750F && Utils.getHorizontalSpeed() < 0.5) {
pitch = 78.750F;
if (pitch < 79.150F && Utils.getHorizontalSpeed() < 0.5) {
pitch = 79.150F;
}
} else {
firstStroke = 0;
yawOffset = 40;
lastYawOffset = 50;
blockYaw = 0;
pitch = 78.750F;
pitch = 79.150F;
}
//Utils.print("" + pitch);
if (firstStroke > 0 && (System.currentTimeMillis() - firstStroke) > 250) {
firstStroke = 0;
@ -328,8 +331,8 @@ public class Scaffold extends Module {
float firstStraight = 64.50f;
float secondStraight = 60.50f;
float thirdStraight = 54.50f;
float firstDiag = 51.50f;
float secondDiag = 47.50f;
float firstDiag = 50.50f;
float secondDiag = 45.50f;
float thirdDiag = 41.50f;
float fourthDiag = 34.50f;
@ -440,7 +443,12 @@ public class Scaffold extends Module {
if (blockRotations != null) {
e.setYaw(blockRotations[0]);
}
e.setPitch(ModuleManager.tower.pitch);
if (ModuleManager.tower.yaw != 0) {
e.setYaw(ModuleManager.tower.yaw);
}
if (ModuleManager.tower.pitch != 0) {
e.setPitch(ModuleManager.tower.pitch);
}
}
//pitch fix
@ -509,11 +517,11 @@ public class Scaffold extends Module {
if (disabledModule) {
if (hasPlaced && (ModuleManager.tower.canTower() && (ModuleManager.tower.dCount == 0 || !Utils.isMoving()) || floatStarted && Utils.isMoving())) {
if (hasPlaced && (ModuleManager.tower.canTower() && (ModuleManager.tower.dCount == 0 || !Utils.isMoving()) || floatStarted && Utils.isMoving() && Utils.onEdge())) {
dontDisable = true;
}
if (dontDisable && ++disableTicks >= 3) {
if (dontDisable && ++disableTicks >= 2) {
isEnabled = false;
//Utils.print("Extra tick");
}

View File

@ -5,19 +5,13 @@ import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.movement.LongJump;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.network.Packet;
import net.minecraft.network.handshake.client.C00Handshake;
import net.minecraft.network.login.client.C00PacketLoginStart;
import net.minecraft.network.play.client.*;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Keyboard;
public class Tower extends Module {
final private SliderSetting towerMove;
@ -34,6 +28,7 @@ public class Tower extends Module {
private boolean hasTowered, startedTowerInAir, setLowMotion, firstJump;
private int cMotionTicks, placeTicks;
public int dCount;
public float yaw;
public float pitch;
@ -177,14 +172,17 @@ public class Tower extends Module {
if (aligning && (int) mc.thePlayer.posX > firstX) {
aligned = true;
}
pitch = 85F;
yaw = 80F;
pitch = 0;
}
if (aligned) {
if (placed) {
yaw = 0;
pitch = 89.9F;
}
else {
pitch = 85F;
yaw = 80F;
pitch = 0;
}
placeExtraBlock = true;
mc.thePlayer.motionX = 0;
@ -194,6 +192,7 @@ public class Tower extends Module {
break;
}
} else {
yaw = pitch = 0;
aligning = aligned = placed = false;
firstX = 0;
placeExtraBlock = false;

View File

@ -1,5 +1,6 @@
package keystrokesmod.utility;
import keystrokesmod.event.NoEventPacketEvent;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.event.SendPacketEvent;
@ -7,8 +8,8 @@ import keystrokesmod.module.impl.movement.LongJump;
import keystrokesmod.module.impl.render.HUD;
import net.minecraft.client.Minecraft;
import keystrokesmod.module.ModuleManager;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.play.client.*;
import net.minecraft.util.BlockPos;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
@ -33,9 +34,61 @@ public class ModuleUtils {
public static int fadeEdge;
public static int lastFaceDifference;
private int lastFace;
public static float offsetValue = 1E-13F;
public static boolean isBlocked;
@SubscribeEvent
public void onSendPacketNoEvent(NoEventPacketEvent e) {
if (!Utils.nullCheck()) {
return;
}
// isBlocked
EntityLivingBase g = Utils.raytrace(3);
if (e.getPacket() instanceof C08PacketPlayerBlockPlacement && Utils.holdingSword() && !BlockUtils.isInteractable(mc.objectMouseOver) && !isBlocked) {
isBlocked = true;
}
else if (e.getPacket() instanceof C07PacketPlayerDigging && isBlocked) {
isBlocked = false;
}
else if (e.getPacket() instanceof C09PacketHeldItemChange && isBlocked) {
isBlocked = false;
}
//
}
@SubscribeEvent
public void onSendPacket(SendPacketEvent e) {
if (!Utils.nullCheck()) {
return;
}
// isBlocked
EntityLivingBase g = Utils.raytrace(3);
if (e.getPacket() instanceof C08PacketPlayerBlockPlacement && Utils.holdingSword() && !BlockUtils.isInteractable(mc.objectMouseOver) && !isBlocked) {
isBlocked = true;
}
else if (e.getPacket() instanceof C07PacketPlayerDigging && isBlocked) {
isBlocked = false;
}
else if (e.getPacket() instanceof C09PacketHeldItemChange && isBlocked) {
isBlocked = false;
}
//
if (e.getPacket() instanceof C07PacketPlayerDigging) {
isBreaking = true;
}