recoded scaffold rotations (10000x better) and fixed some other issues

This commit is contained in:
jackh 2025-01-19 00:48:12 -07:00
parent 3f1adb8e15
commit 9a2eff4c42
11 changed files with 269 additions and 250 deletions

View File

@ -13,7 +13,6 @@ public class PreMotionEvent extends Event {
private static boolean setRenderYaw; private static boolean setRenderYaw;
private boolean isSprinting; private boolean isSprinting;
private boolean isSneaking; private boolean isSneaking;
public static boolean setRotations;
public PreMotionEvent(double posX, double posY, double posZ, float yaw, float pitch, boolean onGround, boolean isSprinting, boolean isSneaking) { public PreMotionEvent(double posX, double posY, double posZ, float yaw, float pitch, boolean onGround, boolean isSprinting, boolean isSneaking) {
this.posX = posX; this.posX = posX;
@ -65,17 +64,20 @@ public class PreMotionEvent extends Event {
public void setYaw(float yaw) { public void setYaw(float yaw) {
this.yaw = yaw; this.yaw = yaw;
this.setRenderYaw = true; this.setRenderYaw = true;
setRotations = true;
} }
public void setYawSilent(float yaw) { public void setYawSilent(float yaw) {
this.yaw = yaw; this.yaw = yaw;
setRotations = true;
} }
public void setPitch(float pitch) { public void setPitch(float pitch) {
this.pitch = pitch; this.pitch = pitch;
setRotations = true; }
public void setRotations(float yaw, float pitch) {
this.yaw = yaw;
this.setRenderYaw = true;
this.pitch = pitch;
} }
public void setOnGround(boolean onGround) { public void setOnGround(boolean onGround) {

View File

@ -367,7 +367,7 @@ public class KillAura extends Module {
return; return;
} }
if (rotationMode.getInput() != 2) { if (rotationMode.getInput() != 2) {
if (inRange(target, attackRange.getInput() - 0.005)) { if (inRange(target, attackRange.getInput() - 0.006)) {
float[] rotations = RotationUtils.getRotations(target, e.getYaw(), e.getPitch()); float[] rotations = RotationUtils.getRotations(target, e.getYaw(), e.getPitch());
float[] smoothedRotations = getRotationsSmoothed(rotations); float[] smoothedRotations = getRotationsSmoothed(rotations);
if (rotationMode.getInput() == 0) { // silent if (rotationMode.getInput() == 0) { // silent
@ -394,7 +394,7 @@ public class KillAura extends Module {
public void onUpdate() { public void onUpdate() {
if (rotationMode.getInput() == 1 && target != null) { if (rotationMode.getInput() == 1 && target != null) {
if (inRange(target, attackRange.getInput() - 0.005)) { if (inRange(target, attackRange.getInput() - 0.006)) {
float[] rotations = RotationUtils.getRotations(target, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch); float[] rotations = RotationUtils.getRotations(target, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch);
float[] smoothedRotations = getRotationsSmoothed(rotations); float[] smoothedRotations = getRotationsSmoothed(rotations);
mc.thePlayer.rotationYaw = smoothedRotations[0]; mc.thePlayer.rotationYaw = smoothedRotations[0];
@ -569,14 +569,14 @@ public class KillAura extends Module {
continue; continue;
} }
} }
// else if (entity instanceof EntityCreature && attackMobs.isToggled()) { else if (entity instanceof EntityCreature && attackMobs.isToggled()) {
// if (((EntityCreature) entity).tasks == null || ((EntityCreature) entity).isAIDisabled() || ((EntityCreature) entity).deathTime != 0) { // no ai if (((EntityCreature) entity).tasks == null || ((EntityCreature) entity).isAIDisabled() || ((EntityCreature) entity).deathTime != 0) { // no ai
// continue; continue;
// } }
// if (!entity.getClass().getCanonicalName().startsWith("net.minecraft.entity.monster.")) { if (!entity.getClass().getCanonicalName().startsWith("net.minecraft.entity.monster.")) {
// continue; continue;
// } }
// } }
else { else {
continue; continue;
} }
@ -598,10 +598,10 @@ public class KillAura extends Module {
if (distanceRayCasted > maxRange) { if (distanceRayCasted > maxRange) {
continue; continue;
} }
if (target instanceof EntityCreature && !isHostile((EntityCreature) target)) { if (!(target instanceof EntityPlayer) && attackMobs.isToggled() && !isHostile((EntityCreature) target)) {
continue; continue;
} }
if (!hitThroughBlocks.isToggled() && (!Utils.canPlayerBeSeen(target) || !inRange(target, attackRange.getInput() - 0.005))) { if (!hitThroughBlocks.isToggled() && (!Utils.canPlayerBeSeen(target) || !inRange(target, attackRange.getInput() - 0.006))) {
continue; continue;
} }
toClassTargets.add(new KillAuraTarget(distanceRayCasted, target.getHealth(), target.hurtTime, RotationUtils.distanceFromYaw(target, false), target.getEntityId(), (target instanceof EntityPlayer) ? Utils.isEnemy((EntityPlayer) target) : false)); toClassTargets.add(new KillAuraTarget(distanceRayCasted, target.getHealth(), target.hurtTime, RotationUtils.distanceFromYaw(target, false), target.getEntityId(), (target instanceof EntityPlayer) ? Utils.isEnemy((EntityPlayer) target) : false));
@ -640,7 +640,7 @@ public class KillAura extends Module {
List<KillAuraTarget> attackTargets = new ArrayList<>(); List<KillAuraTarget> attackTargets = new ArrayList<>();
for (KillAuraTarget killAuraTarget : toClassTargets) { for (KillAuraTarget killAuraTarget : toClassTargets) {
if (killAuraTarget.distance <= attackRange.getInput() - 0.005) { if (killAuraTarget.distance <= attackRange.getInput() - 0.006) {
attackTargets.add(killAuraTarget); attackTargets.add(killAuraTarget);
} }
} }
@ -655,7 +655,7 @@ public class KillAura extends Module {
if (firstHit == null || ticksExisted - firstHit >= switchDelayTicks) { if (firstHit == null || ticksExisted - firstHit >= switchDelayTicks) {
continue; continue;
} }
if (auraTarget.distance < attackRange.getInput() - 0.005) { if (auraTarget.distance < attackRange.getInput() - 0.006) {
setTarget(mc.theWorld.getEntityByID(auraTarget.entityId)); setTarget(mc.theWorld.getEntityByID(auraTarget.entityId));
return; return;
} }
@ -680,7 +680,7 @@ public class KillAura extends Module {
} }
private void handleSwingAndAttack(double distance, boolean swung) { private void handleSwingAndAttack(double distance, boolean swung) {
boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.005); boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.006);
if ((distance <= swingRange.getInput() || inAttackDistance) && shouldAttack && !swung) { // swing if in swing range or needs to attack if ((distance <= swingRange.getInput() || inAttackDistance) && shouldAttack && !swung) { // swing if in swing range or needs to attack
if (!mc.thePlayer.isBlocking() || !disableWhileBlocking.isToggled()) { if (!mc.thePlayer.isBlocking() || !disableWhileBlocking.isToggled()) {
swingItem(); swingItem();
@ -765,7 +765,7 @@ public class KillAura extends Module {
} }
private double getMaxRange() { private double getMaxRange() {
return Math.max(Math.max(swingRange.getInput(), attackRange.getInput() - 0.005), blockRange.getInput()); return Math.max(Math.max(swingRange.getInput(), attackRange.getInput() - 0.006), blockRange.getInput());
} }
public boolean autoBlockOverride() { public boolean autoBlockOverride() {
@ -782,13 +782,13 @@ public class KillAura extends Module {
private boolean isLookingAtEntity() { // private boolean isLookingAtEntity() { //
if (rotationMode.getInput() == 0 && rotationSmoothing.getInput() > 0) { // silent if (rotationMode.getInput() == 0 && rotationSmoothing.getInput() > 0) { // silent
return RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.005, RotationUtils.serverRotations); return RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.006, RotationUtils.serverRotations);
} }
return true; return true;
} }
private void handleAutoBlock(double distance) { private void handleAutoBlock(double distance) {
boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.005); boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.006);
if (inAttackDistance) { if (inAttackDistance) {
attackingEntity = target; attackingEntity = target;
} }
@ -855,24 +855,23 @@ public class KillAura extends Module {
} }
break; break;
case 5: // hypixel a case 5: // hypixel a
if (interactTicks >= 4) { if (interactTicks >= 3) {
interactTicks = 0; interactTicks = 0;
} }
interactTicks++; interactTicks++;
switch (interactTicks) { switch (interactTicks) {
case 1: case 1:
blinking.set(true); blinking.set(true);
if (lag) { if (blocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false; blocked = false;
} }
break; break;
case 3: case 2:
handleInteractAndAttack(distance, true, true, swung); handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket(); sendBlockPacket();
blocked = true; blocked = true;
releasePackets(); // release releasePackets(); // release
lag = true;
break; break;
} }
break; break;
@ -883,21 +882,20 @@ public class KillAura extends Module {
interactTicks++; interactTicks++;
if (firstCycle) { if (firstCycle) {
switch (interactTicks) { switch (interactTicks) {
case 1: case 2:
blinking.set(true); blinking.set(true);
if (lag) { if (blocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false; blocked = false;
} }
break; break;
case 2: case 3:
handleInteractAndAttack(distance, true, true, swung); handleInteractAndAttack(distance, true, true, swung);
sendBlockPacket(); sendBlockPacket();
blocked = true; blocked = true;
releasePackets(); releasePackets();
lag = true;
firstEdge = 1;
firstCycle = false; firstCycle = false;
lag = true;
break; break;
} }
} }
@ -905,7 +903,7 @@ public class KillAura extends Module {
switch (interactTicks) { switch (interactTicks) {
case 1: case 1:
blinking.set(true); blinking.set(true);
if (lag) { if (blocked) {
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
blocked = false; blocked = false;
} }
@ -915,12 +913,9 @@ public class KillAura extends Module {
sendBlockPacket(); sendBlockPacket();
blocked = true; blocked = true;
releasePackets(); releasePackets();
lag = true;
interactTicks = 0; interactTicks = 0;
if (firstEdge == 0) {
firstEdge = 1;
}
firstCycle = true; firstCycle = true;
lag = true;
break; break;
} }
} }
@ -1066,7 +1061,7 @@ public class KillAura extends Module {
} }
boolean sent = false; boolean sent = false;
if (interactAt) { if (interactAt) {
boolean canHit = RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.005, RotationUtils.serverRotations); boolean canHit = RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.006, RotationUtils.serverRotations);
if (!canHit) { if (!canHit) {
return; return;
} }

View File

@ -61,7 +61,7 @@ public class Bhop extends Module {
collided = false; collided = false;
} }
if (mc.thePlayer.onGround) { if (mc.thePlayer.onGround) {
if (mc.thePlayer.moveForward <= -0.5 && mc.thePlayer.moveStrafing == 0) { if (mc.thePlayer.moveForward <= -0.5 && mc.thePlayer.moveStrafing == 0 && !ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.scaffold.isEnabled && !mc.thePlayer.isCollidedHorizontally) {
setRotation = true; setRotation = true;
} }
mc.thePlayer.jump(); mc.thePlayer.jump();

View File

@ -210,7 +210,7 @@ public class NoSlow extends Module {
speedModifier = 0.37; speedModifier = 0.37;
break; break;
} }
return speedModifier; return speedModifier - 0.005;
} }
private boolean holdingConsumable(ItemStack itemStack) { private boolean holdingConsumable(ItemStack itemStack) {

View File

@ -64,7 +64,7 @@ public class Sprint extends Module {
} }
public boolean disableBackwards() { public boolean disableBackwards() {
limit = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw - ((IAccessorEntityPlayerSP) mc.thePlayer).getLastReportedYaw()); limit = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw - Utils.getLastReportedYaw());
double limitVal = 135; double limitVal = 135;
if (!disableBackwards.isToggled()) { if (!disableBackwards.isToggled()) {
return false; return false;

View File

@ -88,12 +88,17 @@ public class Blink extends Module {
return; return;
} }
Packet packet = e.getPacket(); Packet packet = e.getPacket();
if (e.isCanceled() || packet.getClass().getSimpleName().startsWith("S") || packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) { if (packet.getClass().getSimpleName().startsWith("S")) {
return; return;
} }
started = true; if (packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) {
blinkedPackets.add(packet); return;
e.setCanceled(true); }
if (!e.isCanceled()) {
started = true;
blinkedPackets.add(packet);
e.setCanceled(true);
}
} }
@Override @Override

View File

@ -58,9 +58,7 @@ public class Scaffold extends Module {
public boolean hasSwapped; public boolean hasSwapped;
private boolean rotateForward; private boolean rotateForward;
private int keepYDelay;
private int onGroundTicks; private int onGroundTicks;
private int keepYPlaceTicks;
private double startYPos = -1; private double startYPos = -1;
public boolean fastScaffoldKeepY; public boolean fastScaffoldKeepY;
private boolean firstKeepYPlace; private boolean firstKeepYPlace;
@ -69,10 +67,6 @@ public class Scaffold extends Module {
private boolean lowhop; private boolean lowhop;
private int rotationDelay; private int rotationDelay;
private int blockSlot = -1; private int blockSlot = -1;
private boolean modifyPitch;
private boolean flipRotation;
private long lastSwap, lastSwap2;
private boolean didFlip;
public boolean canBlockFade; public boolean canBlockFade;
@ -86,20 +80,17 @@ public class Scaffold extends Module {
private Vec3 blockPos, hitVec, lookVec; private Vec3 blockPos, hitVec, lookVec;
private float[] blockRotations; private float[] blockRotations;
private long lastPlaceTime, rotationTimeout = 250L; private long lastPlaceTime, rotationTimeout = 250L;
private float getPitch;
private float lastYaw = 0.0f; private float lastYaw = 0.0f;
private float lastPitch = 0.0f; private float lastPitch = 0.0f;
private float lastBlockYaw; private float yaw, pitch, blockYaw;
private boolean set2;
private static float rotOffset;
private long firstStroke;
public boolean moduleEnabled; public boolean moduleEnabled;
public boolean isEnabled; public boolean isEnabled;
private boolean disabledModule; private boolean disabledModule;
private boolean dontDisable; private boolean dontDisable;
private int disableTicks; private int disableTicks;
private int scaffoldTicks;
public Scaffold() { public Scaffold() {
super("Scaffold", category.player); super("Scaffold", category.player);
@ -131,7 +122,6 @@ public class Scaffold extends Module {
isEnabled = true; isEnabled = true;
moduleEnabled = true; moduleEnabled = true;
ModuleUtils.fadeEdge = 0; ModuleUtils.fadeEdge = 0;
firstStroke = System.currentTimeMillis();
FMLCommonHandler.instance().bus().register(scaffoldBlockCount = new ScaffoldBlockCount(mc)); FMLCommonHandler.instance().bus().register(scaffoldBlockCount = new ScaffoldBlockCount(mc));
lastSlot.set(-1); lastSlot.set(-1);
@ -155,12 +145,18 @@ public class Scaffold extends Module {
if (!isEnabled || !holdingBlocks()) { if (!isEnabled || !holdingBlocks()) {
return; return;
} }
if (Utils.isMoving()) {
scaffoldTicks++;
}
else {
scaffoldTicks = 0;
}
canBlockFade = true; canBlockFade = true;
int simpleY = (int) Math.round((e.posY % 1) * 10000); int simpleY = (int) Math.round((e.posY % 1) * 10000);
if (Utils.keysDown() && usingFastScaffold() && fastScaffold.getInput() >= 1 && !ModuleManager.tower.canTower() && !ModuleManager.LongJump.isEnabled()) { // jump mode if (Utils.keysDown() && usingFastScaffold() && fastScaffold.getInput() >= 1 && !ModuleManager.tower.canTower() && !ModuleManager.LongJump.isEnabled()) { // jump mode
if (mc.thePlayer.onGround && Utils.isMoving()) { if (mc.thePlayer.onGround && Utils.isMoving()) {
rotateForward = true; if (scaffoldTicks > 1) {
if (++keepYDelay >= 2 || keepYPlaceTicks > 0 || onGroundTicks > 1) { rotateForward = true;
mc.thePlayer.jump(); mc.thePlayer.jump();
Utils.setSpeed(getSpeed(getSpeedLevel()) - Utils.randomizeDouble(0.001, 0.0001)); Utils.setSpeed(getSpeed(getSpeedLevel()) - Utils.randomizeDouble(0.001, 0.0001));
if (fastScaffold.getInput() == 5 || fastScaffold.getInput() == 2 && firstKeepYPlace) { if (fastScaffold.getInput() == 5 || fastScaffold.getInput() == 2 && firstKeepYPlace) {
@ -177,7 +173,7 @@ public class Scaffold extends Module {
else if (fastScaffoldKeepY) { else if (fastScaffoldKeepY) {
fastScaffoldKeepY = firstKeepYPlace = false; fastScaffoldKeepY = firstKeepYPlace = false;
startYPos = -1; startYPos = -1;
keepYDelay = keepYTicks = keepYPlaceTicks = 0; keepYTicks = 0;
} }
if (lowhop) { if (lowhop) {
switch (simpleY) { switch (simpleY) {
@ -214,10 +210,12 @@ public class Scaffold extends Module {
if (floatStarted && mc.thePlayer.onGround) { if (floatStarted && mc.thePlayer.onGround) {
floatKeepY = false; floatKeepY = false;
startYPos = -1; startYPos = -1;
if (moduleEnabled && !Utils.jumpDown()) e.setPosY(e.getPosY() + 1E-11); if (moduleEnabled) {
if (Utils.isMoving()) Utils.setSpeed(getFloatSpeed(getSpeedLevel())); e.setPosY(e.getPosY() + 1E-11);
if (Utils.isMoving()) Utils.setSpeed(getFloatSpeed(getSpeedLevel()));
}
} }
} else if (floatWasEnabled) { } else if (floatWasEnabled && moduleEnabled) {
if (floatKeepY) { if (floatKeepY) {
startYPos = -1; startYPos = -1;
} }
@ -231,158 +229,138 @@ public class Scaffold extends Module {
targetBlock = null; targetBlock = null;
} }
getPitch = 82;
if (ModuleUtils.inAirTicks >= 1) { if (ModuleUtils.inAirTicks >= 1) {
rotateForward = false; rotateForward = false;
} }
if (rotation.getInput() > 0 && (!rotateForward || !jumpFacingForward.isToggled())) {
rotatingForward = false; switch ((int) rotation.getInput()) {
if (rotation.getInput() > 0) { case 1:
float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); e.setRotations(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(), 82);
float main = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw); break;
float mainOffset = MathHelper.wrapAngleTo180_float(yawBackwards - lastBlockYaw);
float rawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - lastBlockYaw);
float mainOffset2 = MathHelper.wrapAngleTo180_float(yawBackwards - lastBlockYaw);
rotOffset = (!Utils.scaffoldDiagonal(false)) ? 135F : 140F;
float minOffset = (!Utils.scaffoldDiagonal(false)) ? 30 : 0;
case 2:
if (blockRotations != null) { if (blockRotations != null) {
e.setYaw(blockRotations[0]); blockYaw = blockRotations[0];
e.setPitch(blockRotations[1]); pitch = blockRotations[1];
lastBlockYaw = MathHelper.wrapAngleTo180_float(blockRotations[0]);
//Utils.print("" + MathHelper.wrapAngleTo180_float(blockRotations[0]));
if (rotation.getInput() == 2 && !ModuleManager.tower.isVerticalTowering()) {
if (!flipRotation) {
if (main >= 0) {
//Utils.print("Main1");
if (mainOffset >= 0) mainOffset = 0;
if (mainOffset <= -minOffset) mainOffset = -minOffset;
} else if (main <= -0) {
//Utils.print("Main2");
if (mainOffset <= -0) mainOffset = -0;
if (mainOffset >= minOffset) mainOffset = minOffset;
}
} else {
if (main >= 0) {
//Utils.print("Main1");
//Utils.print("1 " + mainOffset);
if (mainOffset <= -0) mainOffset2 = -0;
if (mainOffset >= minOffset) mainOffset2 = minOffset;
} else if (main <= -0) {
//Utils.print("Main2");
//Utils.print("2 " + mainOffset);
if (mainOffset >= 0) mainOffset2 = 0;
if (mainOffset <= -minOffset) mainOffset2 = -minOffset;
}
}
e.setYaw(offsetRotation());
if (main >= 0) {
if (flipRotation) {
e.setYaw(offsetRotation() + rotOffset * 2);
//Utils.print("1 ");
}
} else if (main <= -0) {
if (flipRotation) {
e.setYaw(offsetRotation() - rotOffset * 2);
//Utils.print("2 ");
}
}
double minFlip = (!Utils.scaffoldDiagonal(false)) ? 6 : 14;
double minEdge = (!Utils.scaffoldDiagonal(false)) ? 0 : 10;
if (firstStroke > 0 && (System.currentTimeMillis() - firstStroke) > 200) {
if (!didFlip) {
if ((main >= 0 && rawOffset >= minEdge || main <= -0 && rawOffset <= -minEdge)) {
didFlip = true;
flipRotation = true;
} else {
didFlip = true;
flipRotation = false;
}
} else if ((main >= 0 && rawOffset >= minFlip || main >= 0 && rawOffset <= -minFlip || main <= -0 && rawOffset <= -minFlip || main <= -0 && rawOffset >= minFlip)) {
didFlip = false;
}
}
if (!flipRotation) {
e.setYaw(e.getYaw() - mainOffset);
} else {
/*if (main >= 0) {
e.setYaw(e.getYaw() - mainOffset2);
} else if (main <= -0) {
e.setYaw(e.getYaw() + mainOffset2);
}*/
e.setYaw(e.getYaw() - mainOffset2);
}
}
if (e.getPitch() > 89) {
e.setPitch(89);
}
lastYaw = MathHelper.wrapAngleTo180_float(e.getYaw());
lastPitch = e.getPitch();
if (lastPlaceTime > 0 && (System.currentTimeMillis() - lastPlaceTime) > rotationTimeout) blockRotations = null;
} }
else { else {
lastBlockYaw = lastYaw; blockYaw = 0;
if (rotation.getInput() == 2) { pitch = 82F;
/*if (main >= 0) { }
mainOffset2 = 25; float side = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw);
float offset = 137.625F;
float minOffset = (!Utils.scaffoldDiagonal(false)) ? 30 : 0;
float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
float yawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw);
if (!Utils.isMoving() || Utils.getHorizontalSpeed() == 0.0D) {
e.setRotations(yaw, pitch);
break;
}
float motionYaw = getMotionYaw();
float lastYaw = Utils.getLastReportedYaw();
float newYaw = motionYaw - offset * Math.signum(
MathHelper.wrapAngleTo180_float(motionYaw - yaw)
);
yaw = applyGcd(
lastYaw + MathHelper.wrapAngleTo180_float(newYaw - lastYaw)
);
double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 0 : 13;
if (side >= 0) {
if (yawOffset <= -minSwitch) {
set2 = false;
}
else if (yawOffset >= 0) {
if (yawOffset >= minSwitch) {
set2 = true;
} }
else if (main <= -0) {
mainOffset2 = -25;
}*/
e.setYaw(offsetRotation());
} }
if (set2) {
if (yawOffset <= -0) yawOffset = -0;
if (yawOffset >= minOffset) yawOffset = minOffset;
e.setRotations((yaw + offset * 2) - yawOffset, pitch);
break;
else { }
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw()); } else if (side <= -0) {
if (yawOffset >= minSwitch) {
set2 = false;
}
else if (yawOffset <= 0) {
if (yawOffset <= -minSwitch) {
set2 = true;
}
}
if (set2) {
if (yawOffset >= 0) yawOffset = 0;
if (yawOffset <= -minOffset) yawOffset = -minOffset;
e.setRotations((yaw - offset * 2) - yawOffset, pitch);
break;
} }
e.setPitch(getPitch);
} }
if (rotation.getInput() == 1) {
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw()); if (side >= 0) {
if (yawOffset >= 0) yawOffset = 0;
if (yawOffset <= -minOffset) yawOffset = -minOffset;
} else if (side <= -0) {
if (yawOffset <= -0) yawOffset = -0;
if (yawOffset >= minOffset) yawOffset = minOffset;
} }
e.setRotations(yaw - yawOffset, pitch);
break;
case 3:
if (blockRotations != null) {
e.setRotations(blockRotations[0], blockRotations[1]);
}
else {
e.setRotations(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(), 82);
}
break;
}
//jump facing forward
if (rotateForward && jumpFacingForward.isToggled()) {
if (rotation.getInput() > 0) {
if (!rotatingForward) {
rotationDelay = 2;
rotatingForward = true;
}
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw() - 180 - (float) Utils.randomizeDouble(-5, 5));
e.setPitch(10 - (float) Utils.randomizeDouble(1, 5));
} }
} }
else { else {
if (rotation.getInput() > 0) { rotatingForward = false;
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw() - 180 - (float) Utils.randomizeDouble(-5, 5));
e.setPitch(10 - (float) Utils.randomizeDouble(1, 5));
}
if (!rotatingForward) {
rotationDelay = 2;
rotatingForward = true;
}
} }
if (ModuleManager.tower.isVerticalTowering()) {
if (blockRotations != null) {
e.setYaw(blockRotations[0]);
}
e.setPitch(ModuleManager.tower.pitch);
}
//pitch fix
if (e.getPitch() >= 89.9F) {
e.setPitch(89.9F);
}
lastYaw = MathHelper.wrapAngleTo180_float(e.getYaw());
lastPitch = e.getPitch();
if (lastPlaceTime > 0 && (System.currentTimeMillis() - lastPlaceTime) > rotationTimeout) blockRotations = null;
if (rotationDelay > 0) --rotationDelay; if (rotationDelay > 0) --rotationDelay;
} }
private float yaw;
private float offsetRotation() {
if (!Utils.isMoving() || Utils.getHorizontalSpeed() == 0.0D) {
return yaw;
}
float newYaw = getMotionYaw() - rotOffset * Math.signum(
MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw)
);
yaw = applyGcd(
lastBlockYaw + MathHelper.wrapAngleTo180_float(newYaw - lastBlockYaw)
);
return yaw;
}
@SubscribeEvent @SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) { public void onPreUpdate(PreUpdateEvent e) {
if (!isEnabled) { if (!isEnabled) {
@ -435,12 +413,16 @@ public class Scaffold extends Module {
handleMotion(); handleMotion();
} }
if (disabledModule) { if (disabledModule) {
if (ModuleManager.tower.canTower() && (ModuleManager.tower.dCount == 0 || !Utils.isMoving()) || floatStarted) { if (ModuleManager.tower.canTower() && (ModuleManager.tower.dCount == 0 || !Utils.isMoving()) || floatStarted && Utils.isMoving()) {
dontDisable = true; dontDisable = true;
} }
if (dontDisable && ++disableTicks >= 2) { if (dontDisable && ++disableTicks >= 3) {
isEnabled = false; isEnabled = false;
//Utils.print("Extra tick"); //Utils.print("Extra tick");
} }
@ -474,7 +456,7 @@ public class Scaffold extends Module {
blockRotations = null; blockRotations = null;
startYPos = -1; startYPos = -1;
fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = false; fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = false;
keepYDelay = rotationDelay = keepYTicks = keepYPlaceTicks = 0; rotationDelay = keepYTicks = scaffoldTicks = 0;
startYPos = -1; startYPos = -1;
lookVec = null; lookVec = null;
} }
@ -612,6 +594,9 @@ public class Scaffold extends Module {
private void placeBlock(int yOffset, int xOffset) { private void placeBlock(int yOffset, int xOffset) {
locateAndPlaceBlock(yOffset, xOffset); locateAndPlaceBlock(yOffset, xOffset);
int input = (int) multiPlace.getInput(); int input = (int) multiPlace.getInput();
if (sprint.getInput() == 0 && mc.thePlayer.onGround && !ModuleManager.tower.canTower() && !usingFastScaffold()) {
return;
}
if (input >= 1) { if (input >= 1) {
locateAndPlaceBlock(yOffset, xOffset); locateAndPlaceBlock(yOffset, xOffset);
if (input >= 2) { if (input >= 2) {
@ -823,7 +808,7 @@ public class Scaffold extends Module {
} }
private void handleMotion() { private void handleMotion() {
if (usingFastScaffold()) { if (handleFastScaffolds() > 0 || ModuleManager.tower.canTower()) {
return; return;
} }
mc.thePlayer.motionX *= motion.getInput(); mc.thePlayer.motionX *= motion.getInput();

View File

@ -35,6 +35,8 @@ public class Tower extends Module {
private int cMotionTicks, placeTicks; private int cMotionTicks, placeTicks;
public int dCount; public int dCount;
public float pitch;
//vertical tower //vertical tower
private boolean aligning, aligned, placed; private boolean aligning, aligned, placed;
private int firstX; private int firstX;
@ -127,7 +129,7 @@ public class Tower extends Module {
else if (setLowMotion) { else if (setLowMotion) {
++cMotionTicks; ++cMotionTicks;
if (cMotionTicks == 1) { if (cMotionTicks == 1) {
mc.thePlayer.motionY = 0.04f; mc.thePlayer.motionY = 0.05F;
} }
else if (cMotionTicks == 3) { else if (cMotionTicks == 3) {
cMotionTicks = 0; cMotionTicks = 0;
@ -175,17 +177,14 @@ public class Tower extends Module {
if (aligning && (int) mc.thePlayer.posX > firstX) { if (aligning && (int) mc.thePlayer.posX > firstX) {
aligned = true; aligned = true;
} }
//e.setYaw(90F); pitch = 85F;
e.setPitch(85F);
} }
if (aligned) { if (aligned) {
if (placed) { if (placed) {
//e.setYaw(270F); pitch = 89.9F;
e.setPitch(89.9F);
} }
else { else {
//e.setYaw(90F); pitch = 85F;
e.setPitch(85F);
} }
placeExtraBlock = true; placeExtraBlock = true;
mc.thePlayer.motionX = 0; mc.thePlayer.motionX = 0;
@ -207,21 +206,21 @@ public class Tower extends Module {
@SubscribeEvent @SubscribeEvent
public void onPostPlayerInput(PostPlayerInputEvent e) { public void onPostPlayerInput(PostPlayerInputEvent e) {
/*if (canTower() && Utils.keysDown() && towerMove.getInput() > 0) { if (canTower() && Utils.keysDown() && towerMove.getInput() > 0) {
mc.thePlayer.movementInput.jump = false; mc.thePlayer.movementInput.jump = false;
if (!firstJump) { if (!firstJump) {
if (!mc.thePlayer.onGround) { if (!mc.thePlayer.onGround) {
if (!startedTowerInAir) { if (!startedTowerInAir) {
Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()) - 0.04); //Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()) - 0.04);
} }
startedTowerInAir = true; startedTowerInAir = true;
} }
else if (mc.thePlayer.onGround) { else if (mc.thePlayer.onGround) {
Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel())); //Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()));
firstJump = true; firstJump = true;
} }
} }
}*/ }
if (canTower() && !Utils.keysDown() && verticalTower.getInput() > 0) { if (canTower() && !Utils.keysDown() && verticalTower.getInput() > 0) {
mc.thePlayer.movementInput.jump = false; mc.thePlayer.movementInput.jump = false;
} }

View File

@ -4,10 +4,7 @@ import keystrokesmod.Raven;
import keystrokesmod.module.Module; import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting; import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.BlockUtils; import keystrokesmod.utility.*;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Theme;
import keystrokesmod.utility.Utils;
import net.minecraft.block.BlockBed; import net.minecraft.block.BlockBed;
import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@ -17,12 +14,14 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class BedESP extends Module { public class BedESP extends Module {
public SliderSetting theme; public SliderSetting theme;
@ -30,8 +29,9 @@ public class BedESP extends Module {
private SliderSetting rate; private SliderSetting rate;
private ButtonSetting firstBed; private ButtonSetting firstBed;
private ButtonSetting renderFullBlock; private ButtonSetting renderFullBlock;
private BlockPos[] bed = null; private BlockPos[] bed;
private Set<BlockPos[]> beds = ConcurrentHashMap.newKeySet(); private Timer firstBedTimer;
private Map<BlockPos[], Timer> beds = Collections.synchronizedMap(new HashMap<>());
private long lastCheck = 0; private long lastCheck = 0;
public BedESP() { public BedESP() {
@ -65,12 +65,12 @@ public class BedESP extends Module {
return; return;
} }
else { else {
for (BlockPos[] pos : beds) { for (BlockPos[] pos : beds.keySet()) {
if (BlockUtils.isSamePos(blockPos, pos[0])) { if (BlockUtils.isSamePos(blockPos, pos[0])) {
continue priorityLoop; continue priorityLoop;
} }
} }
this.beds.add(new BlockPos[]{blockPos, blockPos.offset((EnumFacing) getBlockState.getValue((IProperty) BlockBed.FACING))}); this.beds.put(new BlockPos[] { blockPos, blockPos.offset((EnumFacing) getBlockState.getValue((IProperty) BlockBed.FACING)) }, null);
} }
} }
} }
@ -87,29 +87,52 @@ public class BedESP extends Module {
} }
} }
@SubscribeEvent @SubscribeEvent(priority = EventPriority.HIGHEST)
public void onRenderWorld(RenderWorldLastEvent e) { public void onRenderWorld(RenderWorldLastEvent e) {
if (Utils.nullCheck()) { if (Utils.nullCheck()) {
float blockHeight = getBlockHeight(); float blockHeight = getBlockHeight();
if (firstBed.isToggled() && this.bed != null) { if (firstBed.isToggled() && this.bed != null) {
if (!(mc.theWorld.getBlockState(bed[0]).getBlock() instanceof BlockBed)) { float customAlpha = 0.25f;
this.bed = null; if (!(mc.theWorld.getBlockState(this.bed[0]).getBlock() instanceof BlockBed)) {
return; if (firstBedTimer == null) {
(firstBedTimer = (new Timer(300))).start();
}
int alpha = firstBedTimer == null ? 230 : 230 - firstBedTimer.getValueInt(0, 230, 1);
if (alpha <= 0) {
this.bed = null;
return;
}
customAlpha = alpha / 255.0f;
} }
renderBed(this.bed, blockHeight); else {
firstBedTimer = null;
}
renderBed(this.bed, blockHeight, customAlpha);
return; return;
} }
if (this.beds.isEmpty()) { synchronized (beds) {
return; Iterator<Map.Entry<BlockPos[], Timer>> iterator = this.beds.entrySet().iterator();
} while (iterator.hasNext()) {
Iterator<BlockPos[]> iterator = this.beds.iterator(); float customAlpha = 0.25f;
while (iterator.hasNext()) { Map.Entry<BlockPos[], Timer> entry = iterator.next();
BlockPos[] blockPos = iterator.next(); BlockPos[] blockPos = entry.getKey();
if (!(mc.theWorld.getBlockState(blockPos[0]).getBlock() instanceof BlockBed)) { if (!(mc.theWorld.getBlockState(blockPos[0]).getBlock() instanceof BlockBed)) {
iterator.remove(); if (entry.getValue() == null) {
continue; entry.setValue(new Timer(300));
entry.getValue().start();
}
int alpha = entry.getValue() == null ? 230 : 230 - entry.getValue().getValueInt(0, 230, 1);
if (alpha <= 0) {
iterator.remove();
continue;
}
customAlpha = alpha / 255.0f;
}
else {
entry.setValue(null);
}
renderBed(blockPos, blockHeight, customAlpha);
} }
renderBed(blockPos, blockHeight);
} }
} }
} }
@ -119,7 +142,7 @@ public class BedESP extends Module {
this.beds.clear(); this.beds.clear();
} }
private void renderBed(final BlockPos[] array, float height) { private void renderBed(final BlockPos[] array, float height, float alpha) {
final double n = array[0].getX() - mc.getRenderManager().viewerPosX; final double n = array[0].getX() - mc.getRenderManager().viewerPosX;
final double n2 = array[0].getY() - mc.getRenderManager().viewerPosY; final double n2 = array[0].getY() - mc.getRenderManager().viewerPosY;
final double n3 = array[0].getZ() - mc.getRenderManager().viewerPosZ; final double n3 = array[0].getZ() - mc.getRenderManager().viewerPosZ;
@ -129,12 +152,12 @@ public class BedESP extends Module {
GL11.glDisable(3553); GL11.glDisable(3553);
GL11.glDisable(2929); GL11.glDisable(2929);
GL11.glDepthMask(false); GL11.glDepthMask(false);
final int e = Theme.getGradient((int) theme.getInput(), 0); final int color = Theme.getGradient((int) theme.getInput(), 0);
final float n4 = (e >> 24 & 0xFF) / 255.0f; final float a = (color >> 24 & 0xFF) / 255.0f;
final float n5 = (e >> 16 & 0xFF) / 255.0f; final float r = (color >> 16 & 0xFF) / 255.0f;
final float n6 = (e >> 8 & 0xFF) / 255.0f; final float g = (color >> 8 & 0xFF) / 255.0f;
final float n7 = (e & 0xFF) / 255.0f; final float b = (color & 0xFF) / 255.0f;
GL11.glColor4d(n5, n6, n7, n4); GL11.glColor4d(r, g, b, a);
AxisAlignedBB axisAlignedBB; AxisAlignedBB axisAlignedBB;
if (array[0].getX() != array[1].getX()) { if (array[0].getX() != array[1].getX()) {
if (array[0].getX() > array[1].getX()) { if (array[0].getX() > array[1].getX()) {
@ -147,7 +170,7 @@ public class BedESP extends Module {
} else { } else {
axisAlignedBB = new AxisAlignedBB(n, n2, n3, n + 1.0, n2 + height, n3 + 2.0); axisAlignedBB = new AxisAlignedBB(n, n2, n3, n + 1.0, n2 + height, n3 + 2.0);
} }
RenderUtils.drawBoundingBox(axisAlignedBB, n5, n6, n7); RenderUtils.drawBoundingBox(axisAlignedBB, r, g, b, alpha);
GL11.glEnable(3553); GL11.glEnable(3553);
GL11.glEnable(2929); GL11.glEnable(2929);
GL11.glDepthMask(true); GL11.glDepthMask(true);

View File

@ -97,12 +97,17 @@ public class ModuleUtils {
@SubscribeEvent @SubscribeEvent
public void onPreMotion(PreMotionEvent e) { public void onPreMotion(PreMotionEvent e) {
int simpleY = (int) Math.round((e.posY % 1) * 10000);
inAirTicks = mc.thePlayer.onGround ? 0 : ++inAirTicks; if (inAirTicks <= 20) {
inAirTicks = mc.thePlayer.onGround ? 0 : ++inAirTicks;
}
else {
inAirTicks = 19;
}
// 7 tick needs to always finish the motion or itll lag back // 7 tick needs to always finish the motion or itll lag back
if (!ModuleManager.bhop.isEnabled() && ModuleManager.bhop.mode.getInput() == 3 && ModuleManager.bhop.didMove) { if (!ModuleManager.bhop.isEnabled() && ModuleManager.bhop.mode.getInput() == 3 && ModuleManager.bhop.didMove) {
int simpleY = (int) Math.round((e.posY % 1) * 10000);
if (mc.thePlayer.hurtTime == 0) { if (mc.thePlayer.hurtTime == 0) {
switch (simpleY) { switch (simpleY) {
@ -124,9 +129,9 @@ public class ModuleUtils {
} }
if (ModuleManager.bhop.setRotation) { if (ModuleManager.bhop.setRotation) {
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.scaffold.isEnabled && !mc.thePlayer.isCollidedHorizontally) { if (!ModuleManager.killAura.isTargeting && !ModuleManager.scaffold.isEnabled) {
float yaw = mc.thePlayer.rotationYaw; float yaw = mc.thePlayer.rotationYaw - 55;
e.setYaw(yaw - 55); e.setYaw(yaw);
} }
if (mc.thePlayer.onGround) { if (mc.thePlayer.onGround) {
ModuleManager.bhop.setRotation = false; ModuleManager.bhop.setRotation = false;

View File

@ -4,6 +4,7 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import keystrokesmod.Raven; import keystrokesmod.Raven;
import keystrokesmod.mixin.impl.accessor.IAccessorEntityPlayerSP;
import keystrokesmod.mixin.impl.accessor.IAccessorGuiIngame; import keystrokesmod.mixin.impl.accessor.IAccessorGuiIngame;
import keystrokesmod.mixin.impl.accessor.IAccessorItemFood; import keystrokesmod.mixin.impl.accessor.IAccessorItemFood;
import keystrokesmod.mixin.impl.accessor.IAccessorMinecraft; import keystrokesmod.mixin.impl.accessor.IAccessorMinecraft;
@ -942,6 +943,10 @@ public class Utils {
return mc.theWorld.getCollidingBoundingBoxes(entity, entity.getEntityBoundingBox().offset(entity.motionX / 3.0D, -1.0D, entity.motionZ / 3.0D)).isEmpty(); return mc.theWorld.getCollidingBoundingBoxes(entity, entity.getEntityBoundingBox().offset(entity.motionX / 3.0D, -1.0D, entity.motionZ / 3.0D)).isEmpty();
} }
public static float getLastReportedYaw() {
return ((IAccessorEntityPlayerSP) mc.thePlayer).getLastReportedYaw();
}
public static boolean lookingAtBlock() { public static boolean lookingAtBlock() {
return mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mc.objectMouseOver.getBlockPos() != null; return mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mc.objectMouseOver.getBlockPos() != null;
} }