diff --git a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java index 8f6a7b9..b702462 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java +++ b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java @@ -71,7 +71,7 @@ public class KillAura extends Module { private ButtonSetting weaponOnly; private String[] autoBlockModes = new String[] { "Manual", "Vanilla", "Partial", "Interact A", "Interact B" }; - private String[] interactAModes = new String[] { "10", "7", "7.5" }; + private String[] interactAModes = new String[] { "10", "5", "6.5" }; private String[] interactBModes = new String[] { "10", "7", "8.5" }; private String[] rotationModes = new String[] { "Silent", "Lock view", "None" }; private String[] sortModes = new String[] { "Distance", "Health", "Hurttime", "Yaw" }; @@ -87,6 +87,7 @@ public class KillAura extends Module { private List hostileMobs = new ArrayList<>(); private Map golems = new HashMap<>(); // entity id, is teammate public boolean justUnTargeted; + private final double reachVal = 0.007; // blocking related public boolean blockingClient; @@ -182,7 +183,7 @@ public class KillAura extends Module { resetBlinkState(true); } blinking.set(false); - interactTicks = 0; + interactTicks = firstEdge = 0; setTarget(null); if (rotated || reset) { resetYaw(); @@ -233,10 +234,10 @@ public class KillAura extends Module { } if (target == null || !manualBlock() && manualBlock.isToggled()) { if (ModuleUtils.swapTick == 0 && !ModuleUtils.isBlocked) { - interactTicks = 1; + interactTicks = firstEdge = 1; } else { - interactTicks = 0; + interactTicks = firstEdge = 0; } } if (target != null && Utils.holdingSword()) { @@ -441,7 +442,7 @@ public class KillAura extends Module { return; } if (rotationMode.getInput() != 2) { - if (inRange(target, attackRange.getInput() - 0.006)) { + if (inRange(target, attackRange.getInput() - reachVal)) { float[] rotations = RotationUtils.getRotations(target, e.getYaw(), e.getPitch()); float[] smoothedRotations = getRotationsSmoothed(rotations); if (rotationMode.getInput() == 0) { // silent @@ -468,7 +469,7 @@ public class KillAura extends Module { public void onUpdate() { if (rotationMode.getInput() == 1 && target != null) { - if (inRange(target, attackRange.getInput() - 0.006)) { + if (inRange(target, attackRange.getInput() - reachVal)) { float[] rotations = RotationUtils.getRotations(target, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch); float[] smoothedRotations = getRotationsSmoothed(rotations); mc.thePlayer.rotationYaw = smoothedRotations[0]; @@ -522,7 +523,7 @@ public class KillAura extends Module { if (target == null) { return; } - boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.006); + boolean inAttackDistance = inRange(target, attackRange.getInput() - reachVal); if (!Utils.holdingWeapon() || manualBlock() && target != null && !inAttackDistance) { return; } @@ -684,7 +685,7 @@ public class KillAura extends Module { if (!(target instanceof EntityPlayer) && attackMobs.isToggled() && !isHostile((EntityCreature) target)) { continue; } - if (!hitThroughBlocks.isToggled() && (!Utils.canPlayerBeSeen(target) || !inRange(target, attackRange.getInput() - 0.006))) { + if (!hitThroughBlocks.isToggled() && (!Utils.canPlayerBeSeen(target) || !inRange(target, attackRange.getInput() - reachVal))) { continue; } toClassTargets.add(new KillAuraTarget(distanceRayCasted, target.getHealth(), target.hurtTime, RotationUtils.distanceFromYaw(target, false), target.getEntityId(), (target instanceof EntityPlayer) ? Utils.isEnemy((EntityPlayer) target) : false)); @@ -723,7 +724,7 @@ public class KillAura extends Module { List attackTargets = new ArrayList<>(); for (KillAuraTarget killAuraTarget : toClassTargets) { - if (killAuraTarget.distance <= attackRange.getInput() - 0.006) { + if (killAuraTarget.distance <= attackRange.getInput() - reachVal) { attackTargets.add(killAuraTarget); } } @@ -738,7 +739,7 @@ public class KillAura extends Module { if (firstHit == null || ticksExisted - firstHit >= switchDelayTicks) { continue; } - if (auraTarget.distance < attackRange.getInput() - 0.006) { + if (auraTarget.distance < attackRange.getInput() - reachVal) { setTarget(mc.theWorld.getEntityByID(auraTarget.entityId)); return; } @@ -763,7 +764,7 @@ public class KillAura extends Module { } private void handleSwingAndAttack(double distance, boolean swung) { - boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.006); + boolean inAttackDistance = inRange(target, attackRange.getInput() - reachVal); if ((distance <= swingRange.getInput() || inAttackDistance) && shouldAttack && !swung) { // swing if in swing range or needs to attack if (!mc.thePlayer.isBlocking() || !disableWhileBlocking.isToggled()) { swingItem(); @@ -835,7 +836,7 @@ public class KillAura extends Module { } private double getMaxRange() { - return Math.max(Math.max(swingRange.getInput(), attackRange.getInput() - 0.006), blockRange.getInput()); + return Math.max(Math.max(swingRange.getInput(), attackRange.getInput() - reachVal), blockRange.getInput()); } public boolean autoBlockOverride() { @@ -852,13 +853,13 @@ public class KillAura extends Module { private boolean isLookingAtEntity() { // if (rotationMode.getInput() == 0 && rotationSmoothing.getInput() > 0) { // silent - return RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.006, RotationUtils.serverRotations); + return RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - reachVal, RotationUtils.serverRotations); } return true; } private void handleAutoBlock(double distance) { - boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.006); + boolean inAttackDistance = inRange(target, attackRange.getInput() - reachVal); if (inAttackDistance) { attackingEntity = target; } @@ -943,7 +944,7 @@ public class KillAura extends Module { } private void getInteractA1(double distance, boolean swung) { - if (interactTicks >= 3) { + if (interactTicks >= 4) { interactTicks = 0; } interactTicks++; @@ -957,19 +958,16 @@ public class KillAura extends Module { case 2: handleInteractAndAttack(distance, true, true, swung); sendBlockPacket(); + break; + case 3: releasePackets(); // release break; } } private void getInteractA2(double distance, boolean swung) { - if (interactTicks == 0) { - firstEdge++; - } - if (firstEdge > 8) { - firstEdge = 0; - } interactTicks++; + firstEdge++; if (firstCycle) { switch (interactTicks) { case 1: @@ -981,20 +979,12 @@ public class KillAura extends Module { case 2: handleInteractAndAttack(distance, true, true, swung); sendBlockPacket(); - releasePackets(); // release - break; - case 3: - if (firstEdge == 2 || firstEdge == 6) { - firstCycle = false; - } + firstCycle = false; interactTicks = 0; + releasePackets(); // release break; } } - - - - else { switch (interactTicks) { case 1: @@ -1006,9 +996,11 @@ public class KillAura extends Module { case 2: handleInteractAndAttack(distance, true, true, swung); sendBlockPacket(); - releasePackets(); // release + break; + case 4: firstCycle = true; interactTicks = 0; + releasePackets(); // release break; } } @@ -1074,7 +1066,7 @@ public class KillAura extends Module { case 1: blinking.set(true); if (ModuleUtils.isBlocked) { - if (firstGyatt == 3) { + if (firstGyatt == 2) { setSwapSlot(); swapped = true; } @@ -1082,7 +1074,7 @@ public class KillAura extends Module { sendUnBlockPacket(); } firstGyatt++; - if (firstGyatt > 4) { + if (firstGyatt > 3) { firstGyatt = 0; } } @@ -1110,7 +1102,7 @@ public class KillAura extends Module { case 1: blinking.set(true); if (ModuleUtils.isBlocked) { - if (firstEdge == 1) { + if (firstEdge == 0) { setSwapSlot(); swapped = true; } @@ -1118,7 +1110,7 @@ public class KillAura extends Module { sendUnBlockPacket(); } firstEdge++; - if (firstEdge > 4) { + if (firstEdge > 3) { firstEdge = 0; } } @@ -1169,9 +1161,9 @@ public class KillAura extends Module { } private boolean settingCondition() { - if (getOtherGUIs() && Mouse.isButtonDown(0)) { + /*if (getOtherGUIs() && Mouse.isButtonDown(0)) { return false; - } + }*/ if (requireMouseDown.isToggled() && !Mouse.isButtonDown(0)) { return false; } @@ -1299,7 +1291,7 @@ public class KillAura extends Module { } boolean sent = false; if (interactAt) { - boolean canHit = RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.006, RotationUtils.serverRotations); + boolean canHit = RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - reachVal, RotationUtils.serverRotations); if (!canHit) { return; } @@ -1393,7 +1385,6 @@ public class KillAura extends Module { } swapped = false; lag = false; - firstEdge = firstGyatt = 0; firstCycle = true; } diff --git a/src/main/java/keystrokesmod/module/impl/combat/Velocity.java b/src/main/java/keystrokesmod/module/impl/combat/Velocity.java index db9389e..dd734a8 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/Velocity.java +++ b/src/main/java/keystrokesmod/module/impl/combat/Velocity.java @@ -21,14 +21,13 @@ import org.lwjgl.input.Keyboard; public class Velocity extends Module { public SliderSetting velocityModes; - public static SliderSetting vertical, horizontal, reverseHorizontal; + public static SliderSetting vertical, horizontal, reverseHorizontal, explosionsHorizontal, explosionsVertical; public static SliderSetting minExtraSpeed, extraSpeedBoost; private SliderSetting chance; private ButtonSetting onlyWhileAttacking; private ButtonSetting onlyWhileTargeting; private ButtonSetting disableS; private ButtonSetting zzWhileNotTargeting; - private ButtonSetting disableExplosions; public ButtonSetting allowSelfFireball; public static ButtonSetting reverseDebug; private KeySetting switchToReverse, switchToHypixel; @@ -46,15 +45,19 @@ public class Velocity extends Module { this.registerSetting(vertical = new SliderSetting("Vertical", 0.0, 0.0, 100.0, 1.0)); this.registerSetting(reverseHorizontal = new SliderSetting("-Horizontal", 0.0, 0.0, 100.0, 1.0)); + + this.registerSetting(explosionsHorizontal = new SliderSetting("Horizontal (Explosions)", 0.0, 0.0, 100.0, 1.0)); + this.registerSetting(explosionsVertical = new SliderSetting("Vertical (Explosions)", 0.0, 0.0, 100.0, 1.0)); + this.registerSetting(minExtraSpeed = new SliderSetting("Maximum speed for extra boost", 0, 0, 0.7, 0.01)); this.registerSetting(extraSpeedBoost = new SliderSetting("Extra speed boost multiplier", "%", 0, 0, 100, 1)); + this.registerSetting(chance = new SliderSetting("Chance", "%", 100.0D, 0.0D, 100.0D, 1.0D)); this.registerSetting(onlyWhileAttacking = new ButtonSetting("Only while attacking", false)); this.registerSetting(onlyWhileTargeting = new ButtonSetting("Only while targeting", false)); this.registerSetting(disableS = new ButtonSetting("Disable while holding S", false)); this.registerSetting(zzWhileNotTargeting = new ButtonSetting("00 while not targeting", false)); - this.registerSetting(disableExplosions = new ButtonSetting("Disable explosions", false)); this.registerSetting(allowSelfFireball = new ButtonSetting("Allow self fireball", false)); this.registerSetting(switchToReverse = new KeySetting("Switch to reverse", Keyboard.KEY_SPACE)); @@ -69,7 +72,6 @@ public class Velocity extends Module { this.disableS.setVisible(velocityModes.getInput() == 0, this); this.allowSelfFireball.setVisible(velocityModes.getInput() == 1, this); - this.disableExplosions.setVisible(velocityModes.getInput() == 1, this); this.zzWhileNotTargeting.setVisible(velocityModes.getInput() == 1, this); this.switchToReverse.setVisible(velocityModes.getInput() == 1, this); @@ -82,6 +84,9 @@ public class Velocity extends Module { this.chance.setVisible(velocityModes.getInput() != 2, this); this.reverseHorizontal.setVisible(velocityModes.getInput() == 2, this); + this.explosionsHorizontal.setVisible(velocityModes.getInput() != 0, this); + this.explosionsVertical.setVisible(velocityModes.getInput() != 0, this); + this.minExtraSpeed.setVisible(velocityModes.getInput() == 2, this); this.extraSpeedBoost.setVisible(velocityModes.getInput() == 2, this); this.reverseDebug.setVisible(velocityModes.getInput() == 2, this); @@ -109,7 +114,7 @@ public class Velocity extends Module { @SubscribeEvent public void onReceivePacket(ReceivePacketEvent e) { - if (velocityModes.getInput() == 1) { + if (velocityModes.getInput() >= 1) { if (!Utils.nullCheck() || LongJump.stopVelocity || e.isCanceled() || ModuleManager.bedAura.cancelKnockback() || ModuleManager.tower.cancelKnockback() || velocityModes.getInput() == 2 && ModuleUtils.firstDamage || ModuleManager.bhop.isEnabled() && ModuleManager.bhop.damageBoost.isToggled() && ModuleUtils.firstDamage && (!ModuleManager.bhop.damageBoostRequireKey.isToggled() || ModuleManager.bhop.damageBoostKey.isPressed())) { return; } @@ -126,19 +131,19 @@ public class Velocity extends Module { return; } } - if (!dontEditMotion() && !disableVelo && !disableExplosions.isToggled() && !ModuleManager.bedAura.cancelKnockback()) { - if (horizontal.getInput() == 0 && vertical.getInput() > 0) { - mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * vertical.getInput() / 100.0; - } else if (horizontal.getInput() > 0 && vertical.getInput() == 0) { - mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * horizontal.getInput() / 100.0; - mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * horizontal.getInput() / 100.0; - } else if (horizontal.getInput() > 0 && vertical.getInput() > 0) { - mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * horizontal.getInput() / 100.0; - mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * vertical.getInput() / 100.0; - mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * horizontal.getInput() / 100.0; + if (!dontEditMotion() && !disableVelo) { + if (explosionsHorizontal.getInput() == 0 && explosionsVertical.getInput() > 0) { + mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * explosionsVertical.getInput() / 100.0; + } else if (explosionsHorizontal.getInput() > 0 && explosionsVertical.getInput() == 0) { + mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * explosionsHorizontal.getInput() / 100.0; + mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * explosionsHorizontal.getInput() / 100.0; + } else if (explosionsHorizontal.getInput() > 0 && explosionsVertical.getInput() > 0) { + mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * explosionsHorizontal.getInput() / 100.0; + mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * explosionsVertical.getInput() / 100.0; + mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * explosionsHorizontal.getInput() / 100.0; } } - if (disableExplosions.isToggled()) stopFBvelo = true; + stopFBvelo = true; e.setCanceled(true); disableVelo = false; } @@ -146,16 +151,32 @@ public class Velocity extends Module { if (((S12PacketEntityVelocity) e.getPacket()).getEntityID() == mc.thePlayer.getEntityId()) { S12PacketEntityVelocity s12PacketEntityVelocity = (S12PacketEntityVelocity) e.getPacket(); - if (!dontEditMotion() && !disableVelo && !stopFBvelo && !ModuleManager.bedAura.cancelKnockback()) { - if (horizontal.getInput() == 0 && vertical.getInput() > 0) { - mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0; - } else if (horizontal.getInput() > 0 && vertical.getInput() == 0) { - mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0; - mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0; - } else if (horizontal.getInput() > 0 && vertical.getInput() > 0) { - mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0; - mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0; - mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0; + if (!stopFBvelo) { + if (!dontEditMotion() && !disableVelo) { + if (horizontal.getInput() == 0 && vertical.getInput() > 0) { + mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0; + } else if (horizontal.getInput() > 0 && vertical.getInput() == 0) { + mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0; + mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0; + } else if (horizontal.getInput() > 0 && vertical.getInput() > 0) { + mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0; + mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0; + mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0; + } + } + } + else { + if (!dontEditMotion() && !disableVelo) { + if (explosionsHorizontal.getInput() == 0 && explosionsVertical.getInput() > 0) { + mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * explosionsVertical.getInput() / 100.0; + } else if (explosionsHorizontal.getInput() > 0 && explosionsVertical.getInput() == 0) { + mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * explosionsHorizontal.getInput() / 100.0; + mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * explosionsHorizontal.getInput() / 100.0; + } else if (explosionsHorizontal.getInput() > 0 && explosionsVertical.getInput() > 0) { + mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * explosionsHorizontal.getInput() / 100.0; + mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * explosionsVertical.getInput() / 100.0; + mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * explosionsHorizontal.getInput() / 100.0; + } } } stopFBvelo = false; diff --git a/src/main/java/keystrokesmod/module/impl/movement/Bhop.java b/src/main/java/keystrokesmod/module/impl/movement/Bhop.java index 7165f93..ed0b4b1 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/Bhop.java +++ b/src/main/java/keystrokesmod/module/impl/movement/Bhop.java @@ -24,26 +24,26 @@ public class Bhop extends Module { public ButtonSetting disablerOnly; private ButtonSetting sneakDisable; private ButtonSetting jumpMoving; - public ButtonSetting rotateYawOption, damageBoost, strafe, damageBoostRequireKey; + public ButtonSetting rotateYaw, slowBackwards, damageBoost, strafe, damageBoostRequireKey; public GroupSetting damageBoostGroup, strafeGroup; private SliderSetting strafeDegrees; public KeySetting damageBoostKey; public String[] modes = new String[]{"Strafe", "Ground", "9 tick", "8 tick", "7 tick"}; public boolean hopping, lowhop, didMove, setRotation; - private int motionTick = 0; public boolean isNormalPos; public boolean running; public Bhop() { super("Bhop", Module.category.movement); this.registerSetting(mode = new SliderSetting("Mode", 0, modes)); + this.registerSetting(disablerOnly = new ButtonSetting("Require disabler", false)); this.registerSetting(speedSetting = new SliderSetting("Speed", 2.0, 0.8, 1.2, 0.01)); this.registerSetting(friction = new SliderSetting("Friction multiplier", 1, 1, 1.3, 0.01)); - this.registerSetting(disablerOnly = new ButtonSetting("Lowhop only if disabler loaded", false)); this.registerSetting(liquidDisable = new ButtonSetting("Disable in liquid", true)); this.registerSetting(sneakDisable = new ButtonSetting("Disable while sneaking", true)); this.registerSetting(jumpMoving = new ButtonSetting("Only jump when moving", true)); - this.registerSetting(rotateYawOption = new ButtonSetting("Rotate yaw", false)); + this.registerSetting(rotateYaw = new ButtonSetting("Rotate yaw", false)); + this.registerSetting(slowBackwards = new ButtonSetting("Slow backwards", false)); this.registerSetting(damageBoostGroup = new GroupSetting("Damage boost")); this.registerSetting(damageBoost = new ButtonSetting(damageBoostGroup, "Enable Damage boost", false)); @@ -57,6 +57,8 @@ public class Bhop extends Module { public void guiUpdate() { this.damageBoostKey.setVisible(damageBoostRequireKey.isToggled(), this); + + this.disablerOnly.setVisible(mode.getInput() >= 2, this); } @Override @@ -88,7 +90,6 @@ public class Bhop extends Module { if (LongJump.function) { return; } - motionTick = 0; if (mode.getInput() >= 1) { if (mc.thePlayer.onGround && (!jumpMoving.isToggled() || Utils.isMoving())) { if (mc.thePlayer.moveForward <= -0.5 && mc.thePlayer.moveStrafing == 0 && !ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.scaffold.isEnabled && !mc.thePlayer.isCollidedHorizontally) { @@ -123,9 +124,12 @@ public class Bhop extends Module { } if (Utils.isMoving()) { - if (!Utils.noSlowingBackWithBow() && !ModuleManager.sprint.disableBackwards()) { + if (!Utils.noSlowingBackWithBow() && !ModuleManager.sprint.disableBackwards() && !slowBackwards()) { Utils.setSpeed((speedModifier - Utils.randomizeDouble(0.0003, 0.0001)) * ModuleUtils.applyFrictionMulti()); } + else { + Utils.setSpeed((speedModifier - Utils.randomizeDouble(0.0003, 0.0001)) - 0.3); + } didMove = true; } hopping = true; @@ -166,6 +170,10 @@ public class Bhop extends Module { } + private boolean slowBackwards() { + return slowBackwards.isToggled() && mc.thePlayer.moveForward <= -0.5; + } + public float hardcodedYaw() { float simpleYaw = 0F; float f = 0.8F; diff --git a/src/main/java/keystrokesmod/module/impl/movement/LongJump.java b/src/main/java/keystrokesmod/module/impl/movement/LongJump.java index e2e57f0..7982ba6 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/LongJump.java +++ b/src/main/java/keystrokesmod/module/impl/movement/LongJump.java @@ -107,6 +107,7 @@ public class LongJump extends Module { this.verticalMotion.setVisible(mode.getInput() == 0, this); this.motionDecay.setVisible(mode.getInput() == 0, this); + this.beginFlat.setVisible(mode.getInput() == 0, this); this.verticalKey.setVisible(mode.getInput() == 0 && beginFlat.isToggled(), this); this.flatKey.setVisible(mode.getInput() == 0 && !beginFlat.isToggled(), this); } @@ -157,12 +158,12 @@ public class LongJump extends Module { disabled(); } - if (spoofItem.isToggled() && lastSlot != -1 && !manual.isToggled()) { + if (spoofItem.isToggled() && lastSlot != -1 && !manual.isToggled()) { ((IMixinItemRenderer) mc.getItemRenderer()).setCancelUpdate(true); ((IMixinItemRenderer) mc.getItemRenderer()).setCancelReset(true); } - if (swapped) { + if (swapped && rotateTick == 0) { resetSlot(); swapped = false; } @@ -256,7 +257,10 @@ public class LongJump extends Module { if (!Utils.nullCheck()) { return; } - if (rotateTick == 1) { + if (rotateTick >= 3) { + rotateTick = 0; + } + if (rotateTick >= 1) { if ((invertYaw.isToggled() || stopMovement.isToggled()) && !notMoving) { if (!stopMovement.isToggled()) { yaw = mc.thePlayer.rotationYaw - 180f; @@ -272,7 +276,6 @@ public class LongJump extends Module { e.setRotations(yaw, pitch); } if (rotateTick > 0 && ++rotateTick >= 3) { - rotateTick = 0; int fireballSlot = setupFireballSlot(false); if (fireballSlot != -1) { fireballTime = System.currentTimeMillis(); diff --git a/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java b/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java index e962959..48bedb0 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java +++ b/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java @@ -193,6 +193,7 @@ public class NoSlow extends Module { if (!floatConditions()) { grounded = 0; didC = true; + requireJump = true; } else if (didC) { grounded++; @@ -209,23 +210,17 @@ public class NoSlow extends Module { } noSlowing = true; - if (!floatConditions() || requireJump) { - requireJump = true; + if (requireJump) { offset = false; return; } - if (offsetDelay <= 2) { + /*if (offsetDelay <= 2) { ++offsetDelay; return; - } - if (mc.thePlayer.motionY >= -0.0784000015258789) { - e.setPosY(e.getPosY() + ModuleUtils.offsetValue); - } - else { - e.setPosY(e.getPosY() - ModuleUtils.offsetValue); - } - ModuleManager.scaffold.offsetDelay = 2; + }*/ offset = true; + e.setPosY(e.getPosY() + ModuleUtils.offsetValue); + ModuleManager.scaffold.offsetDelay = 2; if (groundSpeedOption.isToggled()) { if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !Utils.jumpDown() && mc.thePlayer.moveForward <= -0.5 && mc.thePlayer.moveStrafing == 0 && offset && Utils.isMoving() && mc.thePlayer.onGround) { float yaw = mc.thePlayer.rotationYaw; @@ -268,11 +263,11 @@ public class NoSlow extends Module { private boolean floatConditions() { Block block = BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)); - int edgeY = (int) Math.round((mc.thePlayer.posY % 1.0D) * 100.0D); + int edge = (int) Math.round((mc.thePlayer.posY % 1.0D) * 100.0D); if (mc.thePlayer.posY % 1 == 0) { return true; } - if (edgeY < 10) { + if (edge < 10) { return true; } if (!mc.thePlayer.onGround) { diff --git a/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java b/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java index cbf7ca5..a17fac4 100644 --- a/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java +++ b/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java @@ -3,17 +3,25 @@ package keystrokesmod.module.impl.player; import keystrokesmod.module.Module; import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; public class AutoSwap extends Module { public ButtonSetting sameType; public ButtonSetting spoofItem; public ButtonSetting swapToGreaterStack; + public SliderSetting swapAt; + public AutoSwap() { super("AutoSwap", category.player); this.registerSetting(new DescriptionSetting("Automatically swaps blocks.")); this.registerSetting(sameType = new ButtonSetting("Only same type", false)); this.registerSetting(spoofItem = new ButtonSetting("Spoof item", false)); this.registerSetting(swapToGreaterStack = new ButtonSetting("Swap to greater stack", true)); + this.registerSetting(swapAt = new SliderSetting("Swap at", " blocks", 3, 1, 7, 1)); this.canBeEnabled = false; } + + public void guiUpdate() { + this.swapAt.setVisible(!swapToGreaterStack.isToggled(), this); + } } \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/Safewalk.java b/src/main/java/keystrokesmod/module/impl/player/Safewalk.java index f0ffc25..b8f9c62 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Safewalk.java +++ b/src/main/java/keystrokesmod/module/impl/player/Safewalk.java @@ -98,14 +98,17 @@ public class Safewalk extends Module { if (!sneakState) { unsneakDelayTicks = 0; } - if (!sneakState && Utils.isBindDown(mc.gameSettings.keyBindSneak)) { + if (Utils.isBindDown(mc.gameSettings.keyBindSneak)) { return; } canSneak = sneakState; mc.thePlayer.movementInput.sneak = sneakState; - mc.thePlayer.setSneaking(sneakState); this.isSneaking = sneakState; - //Utils.print("Edge " + mc.thePlayer.movementInput.sneak + " " + sneakState + " " + mc.thePlayer.ticksExisted); + if (sneakState) { + double val = 0; + mc.thePlayer.motionX *= val; + mc.thePlayer.motionZ *= val; + } } @@ -141,6 +144,10 @@ public class Safewalk extends Module { if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70.0f) { return false; } + if (!mc.thePlayer.onGround) { + return false; + + } return true; } } \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java index 411b094..785b894 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java +++ b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java @@ -43,8 +43,6 @@ public class Scaffold extends Module { private SliderSetting floatFirstJump; private SliderSetting fastScaffold; private SliderSetting multiPlace; - private GroupSetting multiPlaceSettings; - final private ButtonSetting mAlways, mSprint, mSprintWithSpeed, mKeepY, mKeepYWithSpeed, mTowerMove, mVerticalTower; public ButtonSetting autoSwap; private ButtonSetting fastOnRMB; @@ -110,12 +108,15 @@ public class Scaffold extends Module { private float minOffset, pOffset; private float minPitch = 80F; private float edge; - private long firstStroke; + private long firstStroke, yawEdge; private float lastEdge2, yawAngle, theYaw; private boolean enabledOffGround = false; private float[] blockRotations; - public float scaffoldYaw, scaffoldPitch, blockYaw, yawOffset; + public float scaffoldYaw, scaffoldPitch, blockYaw, yawOffset, lastOffset; private boolean set2; + private float maxOffset; + private int sameMouse; + private int randomF, yawChanges, dynamic; //fake rotations private float fakeYaw, fakePitch; private float fakeYaw1, fakeYaw2; @@ -131,14 +132,6 @@ public class Scaffold extends Module { this.registerSetting(fastScaffold = new SliderSetting("Fast scaffold", 0, fastScaffoldModes)); this.registerSetting(multiPlace = new SliderSetting("Multi-place", 0, multiPlaceModes)); - this.registerSetting(multiPlaceSettings = new GroupSetting("Multi-place settings")); - this.registerSetting(mAlways = new ButtonSetting(multiPlaceSettings, "Always", false)); - this.registerSetting(mSprint = new ButtonSetting(multiPlaceSettings, "Sprint scaffold", false)); - this.registerSetting(mSprintWithSpeed = new ButtonSetting(multiPlaceSettings, "Sprint scaffold with speed", false)); - this.registerSetting(mKeepY = new ButtonSetting(multiPlaceSettings, "Keep-Y", false)); - this.registerSetting(mKeepYWithSpeed = new ButtonSetting(multiPlaceSettings, "Keep-Y with speed", false)); - this.registerSetting(mTowerMove = new ButtonSetting(multiPlaceSettings, "Tower move", false)); - this.registerSetting(mVerticalTower = new ButtonSetting(multiPlaceSettings, "Vertical tower", false)); this.registerSetting(autoSwap = new ButtonSetting("Auto swap", true)); this.registerSetting(fastOnRMB = new ButtonSetting("Fast on RMB", true)); @@ -156,7 +149,6 @@ public class Scaffold extends Module { public void guiUpdate() { this.floatFirstJump.setVisible(sprint.getInput() == 2, this); - this.multiPlaceSettings.setVisible(multiPlace.getInput() > 0, this); } public void onDisable() { @@ -208,8 +200,7 @@ public class Scaffold extends Module { scaffoldTicks = 0; } canBlockFade = true; - int simpleY = (int) Math.round((e.posY % 1) * 10000); - if (Utils.keysDown() && usingFastScaffold() && fastScaffold.getInput() >= 1 && !ModuleManager.tower.canTower() && !ModuleManager.LongJump.function) { // jump mode + if (Utils.keysDown() && usingFastScaffold() && fastScaffold.getInput() >= 1 && !ModuleManager.tower.canTower() && !LongJump.function) { // jump mode if (mc.thePlayer.onGround && Utils.isMoving()) { if (scaffoldTicks > 1) { rotateForward(); @@ -218,8 +209,7 @@ public class Scaffold extends Module { if (fastScaffold.getInput() == 6 || fastScaffold.getInput() == 3 && firstKeepYPlace) { lowhop = true; } - //Utils.print("Keepy"); - if (startYPos == -1 || Math.abs(startYPos - e.posY) > 5) { + if (startYPos == -1 || Math.abs(startYPos - e.posY) > 2) { startYPos = e.posY; fastScaffoldKeepY = true; } @@ -269,15 +259,43 @@ public class Scaffold extends Module { floatStarted = floatJumped = floatKeepY = floatWasEnabled = false; } + if (blockRotations != null) { + if (mc.thePlayer.rotationYaw == lastOffset) { + sameMouse++; + } + else { + sameMouse = 0; + yawChanges++; + } + if (sameMouse > 2) { + yawChanges = 0; + } + lastOffset = mc.thePlayer.rotationYaw; + if (yawChanges > 15) { + randomF = 1; + yawEdge = Utils.time(); + } + if (yawEdge > 0 && (Utils.time() - yawEdge) > 500) { + yawEdge = 0; + } + } + else { + fakeYaw1 = mc.thePlayer.rotationYaw - hardcodedYaw(); + } + + dynamic = 0; if (targetBlock != null) { Vec3 lookAt = new Vec3(targetBlock.xCoord - lookVec.xCoord, targetBlock.yCoord - lookVec.yCoord, targetBlock.zCoord - lookVec.zCoord); blockRotations = RotationUtils.getRotations(lookAt); targetBlock = null; fakeYaw1 = mc.thePlayer.rotationYaw - hardcodedYaw(); + if (yawEdge == 0) { + randomF = Utils.randomizeInt(0, 9); + yawEdge = Utils.time(); + } + dynamic++; } - if (blockRotations == null) { - fakeYaw1 = mc.thePlayer.rotationYaw - hardcodedYaw(); - } + randomF = 0; switch ((int) rotation.getInput()) { case 1: @@ -298,40 +316,35 @@ public class Scaffold extends Module { long strokeDelay = 250; if (quad <= 5 || quad >= 85) { - yawAngle = 126.50F; - minOffset = 13; - minPitch = 71.08F; + yawAngle = 125.625F; + minOffset = 18; } if (quad > 5 && quad <= 15 || quad >= 75 && quad < 85) { - yawAngle = 127.50F; - minOffset = 10; - minPitch = 72.34F; + yawAngle = 127.625F; + minOffset = 16; } if (quad > 15 && quad <= 25 || quad >= 65 && quad < 75) { - yawAngle = 128.50F; - minOffset = 7; - minPitch = 73.65F; + yawAngle = 129.625F; + minOffset = 14; } if (quad > 25 && quad <= 32 || quad >= 58 && quad < 65) { - yawAngle = 130F; - minOffset = 6; - minPitch = 74.13F; + yawAngle = 132.625F; + minOffset = 12; } if (quad > 32 && quad <= 38 || quad >= 52 && quad < 58) { - yawAngle = 131.50F; - minOffset = 4; - minPitch = 75.41F; + yawAngle = 135.625F; + minOffset = 10; } if (quad > 38 && quad <= 42 || quad >= 48 && quad < 52) { - yawAngle = 133.50F; - minOffset = 2; - minPitch = 76.54F; + yawAngle = 137.625F; + minOffset = 8; } if (quad > 42 && quad <= 45 || quad >= 45 && quad < 48) { - yawAngle = 137F; - minOffset = 1; - minPitch = 77.43F; + yawAngle = 140.625F; + minOffset = 6; + } + minPitch = 78F; //Utils.print("" + minOffset); //float offsetAmountD = ((((float) offsetAmount.getInput() / 10) - 10) * -2) - (((float) offsetAmount.getInput() / 10) - 10); //yawAngle += offsetAmountD; @@ -343,18 +356,18 @@ public class Scaffold extends Module { if (firstStroke > 0 && (System.currentTimeMillis() - firstStroke) > strokeDelay) { firstStroke = 0; } - if (enabledOffGround) { + /*if (enabledOffGround) { if (blockRotations != null) { scaffoldYaw = blockRotations[0]; scaffoldPitch = blockRotations[1]; } else { scaffoldYaw = mc.thePlayer.rotationYaw - hardcodedYaw(); - scaffoldPitch = 78f; + scaffoldPitch = 77f; } e.setRotations(scaffoldYaw, scaffoldPitch); break; - } + }*/ if (blockRotations != null) { blockYaw = blockRotations[0]; @@ -365,10 +378,10 @@ public class Scaffold extends Module { } } else { scaffoldPitch = minPitch; - if (edge == 1) { + if (edge == 1 && ((quad <= 5 || quad >= 85) && !Utils.scaffoldDiagonal(false))) { firstStroke = Utils.time(); } - yawOffset = 0; + yawOffset = 5; } if (!Utils.isMoving() || Utils.getHorizontalSpeed() == 0.0D) { @@ -383,7 +396,7 @@ public class Scaffold extends Module { ); scaffoldYaw = MathHelper.wrapAngleTo180_float(newYaw); - if (quad > 5 && quad < 85) { + if (quad > 5 && quad < 85 && dynamic > 0) { if (quad < 45F) { if (firstStroke == 0) { if (side >= 0) { @@ -412,16 +425,16 @@ public class Scaffold extends Module { was451 = false; } } - double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 9 : 15; + double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 4 : 15; if (side >= 0) { - if (yawOffset <= -minSwitch && firstStroke == 0) { + if (yawOffset <= -minSwitch && firstStroke == 0 && dynamic > 0) { if (quad <= 5 || quad >= 85) { if (set2) { firstStroke = Utils.time(); } set2 = false; } - } else if (yawOffset >= 0 && firstStroke == 0) { + } else if (yawOffset >= 0 && firstStroke == 0 && dynamic > 0) { if (quad <= 5 || quad >= 85) { if (yawOffset >= minSwitch) { if (!set2) { @@ -439,14 +452,14 @@ public class Scaffold extends Module { break; } } else if (side <= -0) { - if (yawOffset >= minSwitch && firstStroke == 0) { + if (yawOffset >= minSwitch && firstStroke == 0 && dynamic > 0) { if (quad <= 5 || quad >= 85) { if (set2) { firstStroke = Utils.time(); } set2 = false; } - } else if (yawOffset <= 0 && firstStroke == 0) { + } else if (yawOffset <= 0 && firstStroke == 0 && dynamic > 0) { if (quad <= 5 || quad >= 85) { if (yawOffset <= -minSwitch) { if (!set2) { @@ -574,12 +587,12 @@ public class Scaffold extends Module { } } - @SubscribeEvent(priority = EventPriority.LOWEST) - public void onMoveInput(PrePlayerInputEvent e) { + @SubscribeEvent + public void onPostPlayerInput(PostPlayerInputEvent e) { if (!ModuleManager.scaffold.isEnabled) { return; } - if (fastScaffold.getInput() == 0) { + if (!fastScaffoldKeepY && !floatKeepY) { return; } mc.thePlayer.movementInput.jump = false; @@ -609,7 +622,7 @@ public class Scaffold extends Module { } if (holdingBlocks() && setSlot()) { if (moduleEnabled && !finishProcedure) { - if (Utils.distanceToGround(mc.thePlayer) <= 3) { + if (Utils.distanceToGround(mc.thePlayer) < 2) { canPlace = true; finishProcedure = true; } @@ -833,11 +846,6 @@ public class Scaffold extends Module { private void placeBlock(int yOffset, int xOffset) { locateAndPlaceBlock(yOffset, xOffset); int input = (int) multiPlace.getInput(); - if (!mAlways.isToggled()) { - if (!handleMultiPlaceSettings()) { - return; - } - } if (input >= 1) { locateAndPlaceBlock(yOffset, xOffset); if (input >= 2) { @@ -846,28 +854,6 @@ public class Scaffold extends Module { } } - private boolean handleMultiPlaceSettings() { - if (mTowerMove.isToggled() && ModuleManager.tower.towerMove.getInput() != 0 && (ModuleManager.tower.canTower() && Utils.keysDown() && ModuleManager.tower.towering || ModuleManager.tower.finishedTower)) { - return true; - } - if (mVerticalTower.isToggled() && ModuleManager.tower.verticalTower.getInput() != 0 && ModuleManager.tower.canTower() && !Utils.keysDown()) { - return true; - } - if (mSprint.isToggled() && sprint.getInput() != 0 && !usingFastScaffold() && !ModuleManager.tower.canTower()) { - return true; - } - if (mSprintWithSpeed.isToggled() && sprint.getInput() != 0 && !usingFastScaffold() && getSpeedLevel() > 0 && !ModuleManager.tower.canTower()) { - return true; - } - if (mKeepY.isToggled() && fastScaffold.getInput() != 0 && usingFastScaffold() && !ModuleManager.tower.canTower()) { - return true; - } - if (mKeepYWithSpeed.isToggled() && fastScaffold.getInput() != 0 && usingFastScaffold() && getSpeedLevel() > 0 && !ModuleManager.tower.canTower()) { - return true; - } - return false; - } - private void locateAndPlaceBlock(int yOffset, int xOffset) { locateBlocks(yOffset, xOffset); if (blockInfo == null) { @@ -1093,10 +1079,6 @@ public class Scaffold extends Module { } float getMotionYaw() { - return MathHelper.wrapAngleTo180_float((float) Math.toDegrees(Math.atan2(mc.thePlayer.motionZ, mc.thePlayer.motionX)) - 90.0F); - } - - float getMotionYaw2() { return (float) Math.toDegrees(Math.atan2(mc.thePlayer.motionZ, mc.thePlayer.motionX)) - 90.0F; } @@ -1210,6 +1192,7 @@ public class Scaffold extends Module { } public boolean setSlot() { + ItemStack heldItem = mc.thePlayer.getHeldItem(); int slot = getSlot(); if (slot == -1) { return false; @@ -1226,12 +1209,13 @@ public class Scaffold extends Module { spoofSlot = slot; } else { - mc.thePlayer.inventory.currentItem = blockSlot; - spoofSlot = blockSlot; + if (heldItem == null || !(heldItem.getItem() instanceof ItemBlock) || !Utils.canBePlaced((ItemBlock) heldItem.getItem()) || mc.thePlayer.getHeldItem().stackSize <= ModuleManager.autoSwap.swapAt.getInput()) { + mc.thePlayer.inventory.currentItem = slot; + spoofSlot = slot; + } } } - ItemStack heldItem = mc.thePlayer.getHeldItem(); if (heldItem == null || !(heldItem.getItem() instanceof ItemBlock) || !Utils.canBePlaced((ItemBlock) heldItem.getItem())) { blockSlot = -1; return false; diff --git a/src/main/java/keystrokesmod/module/impl/player/Tower.java b/src/main/java/keystrokesmod/module/impl/player/Tower.java index ccf44e6..1528489 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Tower.java +++ b/src/main/java/keystrokesmod/module/impl/player/Tower.java @@ -3,6 +3,7 @@ package keystrokesmod.module.impl.player; import keystrokesmod.event.*; 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.GroupSetting; import keystrokesmod.module.setting.impl.SliderSetting; @@ -28,7 +29,7 @@ public class Tower extends Module { private final ButtonSetting cancelKnockback; private ButtonSetting cancelVelocityRequired; - final private String[] towerMoveModes = new String[]{"None", "Vanilla", "Low", "Edge", "2.5 tick", "1.5 tick", "1 tick"}; + final private String[] towerMoveModes = new String[]{"None", "Vanilla", "Low", "Edge", "2.5 tick", "1.5 tick", "1 tick", "10 tick"}; final private String[] verticalTowerModes = new String[]{"None", "Vanilla", "Extra block"}; private int slowTicks; private boolean wasTowering; @@ -112,6 +113,13 @@ public class Tower extends Module { break; case 6: + break; + case 7: + if (towering) { + if (towerTicks == 0) { + //e.setOnGround(true); + } + } break; } } @@ -121,257 +129,289 @@ public class Tower extends Module { public void onPreUpdate(PreUpdateEvent e) { int valY = (int) Math.round((mc.thePlayer.posY % 1) * 10000); int simpleY = (int) Math.round((mc.thePlayer.posY % 1.0D) * 100.0D); - if (canTower() && Utils.keysDown()) { - speed = false; - wasTowering = hasTowered = true; - if (disableWhileHurt.isToggled() && ModuleUtils.damage) { - towerTicks = 0; - towering = false; - return; - } - switch ((int) towerMove.getInput()) { - case 1: - mc.thePlayer.motionY = 0.41965; - switch (towerTicks) { - case 1: - mc.thePlayer.motionY = 0.33; - break; - case 2: - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1; - break; - } - if (towerTicks >= 3) { - towerTicks = 0; - } - case 2: - if (mc.thePlayer.onGround) { - mc.thePlayer.motionY = 0.4196; - } - else { + if (towerMove.getInput() > 0) { + if (canTower() && Utils.keysDown()) { + speed = false; + wasTowering = hasTowered = true; + if (disableWhileHurt.isToggled() && ModuleUtils.damage) { + towerTicks = 0; + towering = false; + return; + } + switch ((int) towerMove.getInput()) { + case 1: + mc.thePlayer.motionY = 0.41965; switch (towerTicks) { - case 3: - case 4: - mc.thePlayer.motionY = 0; - break; - case 5: - mc.thePlayer.motionY = 0.4191; - break; - case 6: - mc.thePlayer.motionY = 0.3275; - break; - case 11: - mc.thePlayer.motionY = - 0.5; - - } - } - break; - case 3: - if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround && !setLowMotion) { - towering = true; - } - if (towering) { - if (valY == 0) { - mc.thePlayer.motionY = 0.42f; - Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel())); - startedTowerInAir = false; - } - else if (valY > 4000 && valY < 4300) { - mc.thePlayer.motionY = 0.33f; - Utils.setSpeed(getTowerSpeed(getSpeedLevel())); - speed = true; - } - else if (valY > 7000) { - if (setLowMotion) { - towering = false; - } - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; - } - } - else if (setLowMotion) { - ++cMotionTicks; - if (cMotionTicks == 1) { - mc.thePlayer.motionY = 0.08F; - Utils.setSpeed(getTowerSpeed(getSpeedLevel())); - } - else if (cMotionTicks == 4) { - cMotionTicks = 0; - setLowMotion = false; - towering = true; - Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()) - 0.02); - } - } - break; - case 4: - if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { - towering = true; - } - if (towering) { - towerTicks = mc.thePlayer.onGround ? 0 : ++towerTicks; - switch (simpleY) { - case 0: - mc.thePlayer.motionY = 0.42f; - if (towerTicks == 6) { - mc.thePlayer.motionY = -0.078400001525879; - } - Utils.setSpeed(getTowerSpeed(getSpeedLevel())); - speed = true; - break; - case 42: - mc.thePlayer.motionY = 0.33f; - Utils.setSpeed(getTowerSpeed(getSpeedLevel())); - speed = true; - break; - case 75: - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; - break; - } - } - break; - case 5: - if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { - towering = true; - } - if (towering) { - towerTicks = mc.thePlayer.onGround ? 0 : ++towerTicks; - switch (towerTicks) { - case 0: - mc.thePlayer.motionY = 0.42f; - Utils.setSpeed(get15tickspeed(getSpeedLevel())); // Speed + Strafe tick - speed = true; - break; case 1: - mc.thePlayer.motionY = 0.33f; - Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick + mc.thePlayer.motionY = 0.33; break; case 2: - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; - break; - case 3: - mc.thePlayer.motionY = 0.42f; - Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick - break; - case 4: - mc.thePlayer.motionY = 0.33f; - Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick - break; - case 5: - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f + 0.0000001; - break; - case 6: - mc.thePlayer.motionY = -0.01; + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1; break; } - } - break; - case 6: - if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { - grounds++; - } - if (mc.thePlayer.posY % 1 == 0) { - towering = true; - } - if (towering) { - towerTicks = mc.thePlayer.onGround ? 0 : ++towerTicks; - switch (towerTicks) { - case 0: - mc.thePlayer.motionY = 0.42f; - Utils.setSpeed(get15tickspeed(getSpeedLevel())); // Speed + Strafe tick - speed = true; - break; - case 1: - mc.thePlayer.motionY = 0.33f; - Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick - break; - case 2: - mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; - break; - case 3: - mc.thePlayer.motionY = 0.005; - break; + if (towerTicks >= 3) { + towerTicks = 0; } - } - break; - } - } - else { - if (finishedTower) { - finishedTower = false; - } - if (hasTowered) { - finishedTower = true; - } - if (wasTowering && modulesEnabled()) { - if (slowedTicks.getInput() > 0 && slowedTicks.getInput() != 100 && slowTicks++ < slowedTicks.getInput()) { - mc.thePlayer.motionX *= slowedSpeed.getInput() / 100; - mc.thePlayer.motionZ *= slowedSpeed.getInput() / 100; - } - else { - ModuleUtils.handleSlow(); - } - if (slowTicks >= slowedTicks.getInput()) { - slowTicks = 0; - wasTowering = false; - } - } - else { - if (wasTowering) { - wasTowering = false; - } - slowTicks = 0; - } - if (speed || hasTowered && mc.thePlayer.onGround) { - Utils.setSpeed(Utils.getHorizontalSpeed(mc.thePlayer) / 1.6); - } - hasTowered = towering = firstJump = startedTowerInAir = setLowMotion = speed = false; - cMotionTicks = placeTicks = towerTicks = grounds = 0; - reset(); - } - if (canTower() && !Utils.keysDown()) { - wasTowering = true; - switch ((int) verticalTower.getInput()) { - case 1: - mc.thePlayer.motionY = 0.42f; - break; - case 2: - if (!aligned) { + case 2: if (mc.thePlayer.onGround) { - if (!aligning) { - blockX = (int) mc.thePlayer.posX; + mc.thePlayer.motionY = 0.4196; + } else { + switch (towerTicks) { + case 3: + case 4: + mc.thePlayer.motionY = 0; + break; + case 5: + mc.thePlayer.motionY = 0.4191; + break; + case 6: + mc.thePlayer.motionY = 0.3275; + break; + case 11: + mc.thePlayer.motionY = -0.5; - firstX = mc.thePlayer.posX - 10; - firstY = mc.thePlayer.posY; - firstZ = mc.thePlayer.posZ; } - mc.thePlayer.motionX = 0.22; - aligning = true; } - if (aligning && (int) mc.thePlayer.posX > blockX) { - aligned = true; + break; + case 3: + if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround && !setLowMotion) { + towering = true; } - yaw = RotationUtils.getRotations(firstX, firstY, firstZ)[0]; - pitch = 0; + if (towering) { + if (valY == 0) { + mc.thePlayer.motionY = 0.42f; + Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel())); + startedTowerInAir = false; + } else if (valY > 4000 && valY < 4300) { + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + speed = true; + } else if (valY > 7000) { + if (setLowMotion) { + towering = false; + } + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + } + } else if (setLowMotion) { + ++cMotionTicks; + if (cMotionTicks == 1) { + mc.thePlayer.motionY = 0.08F; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + } else if (cMotionTicks == 4) { + cMotionTicks = 0; + setLowMotion = false; + towering = true; + Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()) - 0.02); + } + } + break; + case 4: + if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { + towering = true; + } + if (towering) { + towerTicks = mc.thePlayer.onGround ? 0 : ++towerTicks; + switch (simpleY) { + case 0: + mc.thePlayer.motionY = 0.42f; + if (towerTicks == 6) { + mc.thePlayer.motionY = -0.078400001525879; + } + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + speed = true; + break; + case 42: + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + speed = true; + break; + case 75: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + break; + } + } + break; + case 5: + if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { + towering = true; + } + if (towering) { + towerTicks = mc.thePlayer.onGround ? 0 : ++towerTicks; + switch (towerTicks) { + case 0: + mc.thePlayer.motionY = 0.42f; + Utils.setSpeed(get15tickspeed(getSpeedLevel())); // Speed + Strafe tick + speed = true; + break; + case 1: + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick + break; + case 2: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + break; + case 3: + mc.thePlayer.motionY = 0.42f; + Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick + break; + case 4: + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick + break; + case 5: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f + 0.0000001; + break; + case 6: + mc.thePlayer.motionY = -0.01; + break; + } + } + break; + case 6: + if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { + grounds++; + } + if (mc.thePlayer.posY % 1 == 0) { + towering = true; + } + if (towering) { + towerTicks = mc.thePlayer.onGround ? 0 : ++towerTicks; + switch (towerTicks) { + case 0: + mc.thePlayer.motionY = 0.42f; + Utils.setSpeed(get1tickspeed(getSpeedLevel())); // Speed + Strafe tick + speed = true; + break; + case 1: + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick + break; + case 2: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + break; + case 3: + mc.thePlayer.motionY = 0.005; + break; + } + } + break; + case 7: + if (mc.thePlayer.posY % 1 == 0 && mc.thePlayer.onGround) { + towering = true; + } + if (towering) { + ++towerTicks; + switch (towerTicks) { + case 7: + case 4: + case 1: + mc.thePlayer.motionY = 0.42f; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); // Speed + Strafe tick + speed = true; + break; + case 8: + case 5: + case 2: + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(Utils.getHorizontalSpeed()); // Strafe tick + break; + case 6: + case 3: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + break; + case 9: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f + 0.0000001; + break; + case 10: + mc.thePlayer.motionY = -0.01; + towerTicks = 0; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); // Speed + Strafe tick + speed = true; + break; + } + } + break; + + } + } else { + if (finishedTower) { + finishedTower = false; + } + if (hasTowered) { + finishedTower = true; + } + if (wasTowering && modulesEnabled()) { + if (slowedTicks.getInput() > 0 && slowedTicks.getInput() != 100 && slowTicks++ < slowedTicks.getInput()) { + mc.thePlayer.motionX *= slowedSpeed.getInput() / 100; + mc.thePlayer.motionZ *= slowedSpeed.getInput() / 100; + } else { + ModuleUtils.handleSlow(); } - if (aligned) { - if (placed) { - yaw = 0; - pitch = 89.9F; - } - else { + if (slowTicks >= slowedTicks.getInput()) { + slowTicks = 0; + wasTowering = false; + } + } else { + if (wasTowering) { + wasTowering = false; + } + slowTicks = 0; + } + if (speed || hasTowered && mc.thePlayer.onGround) { + Utils.setSpeed(Utils.getHorizontalSpeed(mc.thePlayer) / 1.6); + } + hasTowered = towering = firstJump = startedTowerInAir = setLowMotion = speed = false; + cMotionTicks = placeTicks = towerTicks = grounds = 0; + reset(); + } + } + if (verticalTower.getInput() > 0) { + if (canTower() && !Utils.keysDown()) { + wasTowering = true; + switch ((int) verticalTower.getInput()) { + case 1: + mc.thePlayer.motionY = 0.42f; + break; + case 2: + if (!aligned) { + if (mc.thePlayer.onGround) { + if (!aligning) { + blockX = (int) mc.thePlayer.posX; + + firstX = mc.thePlayer.posX - 10; + firstY = mc.thePlayer.posY; + firstZ = mc.thePlayer.posZ; + } + mc.thePlayer.motionX = 0.22; + aligning = true; + } + if (aligning && (int) mc.thePlayer.posX > blockX) { + aligned = true; + } yaw = RotationUtils.getRotations(firstX, firstY, firstZ)[0]; pitch = 0; } - placeExtraBlock = true; - mc.thePlayer.motionX = 0; - mc.thePlayer.motionY = verticalTowerValue(); - mc.thePlayer.motionZ = 0; - } - break; + if (aligned) { + if (placed) { + yaw = 0; + pitch = 89.9F; + } else { + yaw = RotationUtils.getRotations(firstX, firstY, firstZ)[0]; + pitch = 0; + } + placeExtraBlock = true; + mc.thePlayer.motionX = 0; + mc.thePlayer.motionY = verticalTowerValue(); + mc.thePlayer.motionZ = 0; + } + break; + } + } else { + yaw = pitch = 0; + aligning = aligned = placed = false; + firstX = 0; + placeExtraBlock = false; } - } else { - yaw = pitch = 0; - aligning = aligned = placed = false; - firstX = 0; - placeExtraBlock = false; } } @@ -468,7 +508,7 @@ public class Tower extends Module { } private boolean modulesEnabled() { - return (ModuleManager.scaffold.moduleEnabled && ModuleManager.scaffold.holdingBlocks() && ModuleManager.scaffold.hasSwapped && !ModuleManager.LongJump.function); + return (ModuleManager.scaffold.moduleEnabled && ModuleManager.scaffold.holdingBlocks() && ModuleManager.scaffold.hasSwapped && !LongJump.function); } private int getSpeedLevel() { @@ -539,4 +579,19 @@ public class Tower extends Module { return (speedSetting.getInput() / 10); } + private double get1tickspeed(int speedLevel) { + if (speedLevel == 0) { + return (speedSetting.getInput() / 10); + } else if (speedLevel == 1) { + return (speedSetting.getInput() / 10) + 0.03; + } else if (speedLevel == 2) { + return (speedSetting.getInput() / 10) + 0.06; + } else if (speedLevel == 3) { + return (speedSetting.getInput() / 10) + 0.1; + } else if (speedLevel == 4) { + return (speedSetting.getInput() / 10) + 0.11; + } + return (speedSetting.getInput() / 10); + } + } \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java b/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java index 9d3f977..7fcafce 100644 --- a/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java +++ b/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java @@ -111,6 +111,7 @@ public class PlayerESP extends Module { if (teamColor.isToggled()) { rgb = Utils.getColorFromEntity(entity); } + rgb = Utils.mergeAlpha(rgb, 255); this.render(entity, rgb); this.renderAsTwoD.put((EntityLivingBase) entity, rgb); } @@ -132,6 +133,7 @@ public class PlayerESP extends Module { if (teamColor.isToggled()) { rgb = Utils.getColorFromEntity(player); } + rgb = Utils.mergeAlpha(rgb, 255); this.render(player, rgb); this.renderAsTwoD.put(player, rgb); } diff --git a/src/main/java/keystrokesmod/utility/ModuleUtils.java b/src/main/java/keystrokesmod/utility/ModuleUtils.java index abf320a..2164ac9 100644 --- a/src/main/java/keystrokesmod/utility/ModuleUtils.java +++ b/src/main/java/keystrokesmod/utility/ModuleUtils.java @@ -18,6 +18,7 @@ import net.minecraft.network.play.client.*; import net.minecraft.network.play.server.S12PacketEntityVelocity; import net.minecraft.network.play.server.S27PacketExplosion; import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent; @@ -60,7 +61,9 @@ public class ModuleUtils { private int edgeTick; - public static boolean canSlow, didSlow, setSlow; + private boolean dontCheckFD; + + public static boolean canSlow, didSlow, setSlow, hasSlowed; private static boolean allowFriction; @SubscribeEvent @@ -174,12 +177,22 @@ public class ModuleUtils { if (!Utils.nullCheck()) { return; } + if (e.getPacket() instanceof S27PacketExplosion) { + firstDamage = false; + + dontCheckFD = true; + } if (e.getPacket() instanceof S12PacketEntityVelocity) { if (((S12PacketEntityVelocity) e.getPacket()).getEntityID() == mc.thePlayer.getEntityId()) { - damage = firstDamage = true; + damage = true; damageTicks = 0; + if (!dontCheckFD) { + firstDamage = true; + } + dontCheckFD = false; + } } } @@ -224,24 +237,31 @@ public class ModuleUtils { @SubscribeEvent public void onPreUpdate(PreUpdateEvent e) { + double ed = Math.toDegrees(Math.atan2(mc.thePlayer.motionZ, mc.thePlayer.motionX)); + //Utils.print("" + ed); + if (swapTick > 0) { --swapTick; } - if ((canSlow || ModuleManager.scaffold.moduleEnabled && !ModuleManager.tower.canTower()) && !mc.thePlayer.onGround) { + if (canSlow || ModuleManager.scaffold.moduleEnabled && !ModuleManager.tower.canTower()) { double motionVal = 0.9507832 - ((double) inAirTicks / 10000) - Utils.randomizeDouble(0.00001, 0.00006); - if (mc.thePlayer.hurtTime == 0 && inAirTicks >= 5 && !setSlow) { + if (!hasSlowed) motionVal = motionVal - 0.15; + if (mc.thePlayer.hurtTime == 0 && inAirTicks >= 3 && !setSlow) { mc.thePlayer.motionX *= motionVal; mc.thePlayer.motionZ *= motionVal; - setSlow = true; + setSlow = hasSlowed = true; //Utils.print("Slow " + motionVal); } didSlow = true; //Utils.print(mc.thePlayer.ticksExisted + " : " + Utils.getHorizontalSpeed()); } - else if (didSlow) { + if (didSlow && mc.thePlayer.onGround) { canSlow = didSlow = false; } + if (groundTicks > 1) { + hasSlowed = false; + } if (mc.thePlayer.onGround || mc.thePlayer.hurtTime != 0) { setSlow = false; } @@ -436,7 +456,7 @@ public class ModuleUtils { } } - if (ModuleManager.bhop.setRotation) { + if (ModuleManager.bhop.setRotation && ModuleManager.bhop.rotateYaw.isToggled()) { if (!ModuleManager.killAura.isTargeting && !ModuleManager.scaffold.isEnabled) { float yaw = mc.thePlayer.rotationYaw - 55; e.setYaw(yaw);