Azura-X's Watchdog Speed
-
Watchdog Fast
public class WatchdogFast extends SpeedMode { public WatchdogFast() { super("WatchdogFast"); } private double speed; private int ticks; @Override public void onEnable() { speed = 0; ticks = 0; } @Override public void onDisable() { speed = 0; ticks = 0; } @Override public void onMotion(MotionEvent event) { if (mc.thePlayer.onGround) { if (MoveUtil.isMoving()) { if (mc.gameSettings.keyBindJump.isKeyDown()) return; mc.thePlayer.jump(); BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.5); if (ticks > 0) BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.77); ticks++; } } else if (MoveUtil.isMoving()) { if (mc.thePlayer.motionY > 0.05 && mc.thePlayer.motionY < 0.15) mc.thePlayer.motionY = (float) -0.01; if (mc.thePlayer.motionY > -0.07 && mc.thePlayer.motionY < 0.) mc.thePlayer.motionY = (float) -0.09; } if (!MoveUtil.isMoving()) speed = 0; } @Override public void onUpdate() { } @Override public void onMove(MoveEvent event) { if (!MoveUtil.isMoving() || mc.thePlayer.isCollidedHorizontally) speed = 0; BhopHelper.setSpeed(MoveUtil.isMoving() ? Math.max(BhopHelper.getBaseSpeed(), MoveUtil.getSpeed()) : 0, event); } }
Watchdog Low
public class WatchdogLow extends SpeedMode { public WatchdogLow() { super("WatchdogLow"); } private double speed; private int ticks; @Override public void onEnable() { speed = 0; ticks = 0; } @Override public void onDisable() { speed = 0; ticks = 0; } @Override public void onMotion(MotionEvent event) { event.setYaw((float) Math.toDegrees(MoveUtil.getDirection())); boolean doLowHop = !this.mc.thePlayer.isPotionActive(Potion.jump) && this.mc.thePlayer.fallDistance <= 0.75F && !this.mc.thePlayer.isCollidedHorizontally; if (mc.thePlayer.onGround) { if (MoveUtil.isMoving()) { mc.thePlayer.jump(); if (!this.mc.thePlayer.isPotionActive(Potion.jump)) mc.thePlayer.motionY = 0.4; BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.65); if (ticks > 0 && ticks % 2 == 0) { BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.72); } ticks++; } } else if (MoveUtil.isMoving() && doLowHop) { final double groundOffset = MathHelper.round(this.mc.thePlayer.posY - (int) this.mc.thePlayer.posY, 3, 0.0001); if (groundOffset == MathHelper.round(0.4, 3, 0.0001)) { mc.thePlayer.motionY = 0.32; } else if (groundOffset == MathHelper.round(0.71, 3, 0.0001)) { mc.thePlayer.motionY = 0.04; } else if (groundOffset == MathHelper.round(0.75, 3, 0.0001)) { mc.thePlayer.motionY = -0.2; } else if (groundOffset == MathHelper.round(0.55, 3, 0.0001)) { mc.thePlayer.motionY = -0.15; } else if (groundOffset == MathHelper.round(0.41, 3, 0.0001)) { mc.thePlayer.motionY = -0.2; } } if (!MoveUtil.isMoving()) speed = 0; } @Override public void onUpdate() { } @Override public void onMove(MoveEvent event) { if (!MoveUtil.isMoving() || mc.thePlayer.isCollidedHorizontally) speed = 0; final double value = MoveUtil.isMoving() ? Math.max(BhopHelper.getBaseSpeed(), MoveUtil.getSpeed()) : 0, yaw = MoveUtil.getDirection(), x = -Math.sin(yaw) * value, z = Math.cos(yaw) * value; event.setX(x - (x - event.getX()) * (1.0 - 80F / 100)); event.setZ(z - (z - event.getZ()) * (1.0 - 80F / 100)); BhopHelper.setSpeed(MoveUtil.isMoving() ? Math.max(BhopHelper.getBaseSpeed(), MoveUtil.getSpeed()) : 0, event); } }
Watchdog Slow
public class WatchdogSlow extends SpeedMode { public WatchdogSlow() { super("WatchdogSlow"); } private double speed; private int ticks; @Override public void onEnable() { speed = 0; ticks = 0; } @Override public void onDisable() { speed = 0; ticks = 0; } @Override public void onMotion(MotionEvent event) { if (mc.thePlayer.onGround) { if (MoveUtil.isMoving()) { if (mc.gameSettings.keyBindJump.isKeyDown()) return; mc.thePlayer.jump(); switch (ticks) { case 0: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.63); ticks++; break; case 1: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.75); ticks++; break; case 2: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.67); ticks++; break; case 3: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.74); ticks++; break; case 4: case 5: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.7); ticks++; break; case 6: case 7: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.64); ticks++; break; case 8: BhopHelper.setSpeed(BhopHelper.getBaseSpeed() * 1.68); ticks = 0; break; } } } if (!MoveUtil.isMoving()) speed = 0; } @Override public void onUpdate() { } @Override public void onMove(MoveEvent event) { if (!MoveUtil.isMoving() || mc.thePlayer.isCollidedHorizontally) speed = 0; BhopHelper.setSpeed(MoveUtil.isMoving() ? Math.max(BhopHelper.getBaseSpeed(), MoveUtil.getSpeed()) : 0, event); } }
My BhopHelper
public class BhopHelper extends MinecraftInstance { public static final double JUMP_MOTION = 0.41999998688698; public static void setSpeed(double value, MoveEvent e) { double yaw = getDirection(); double x = -Math.sin(yaw) * value; double z = Math.cos(yaw) * value; e.setX(x); e.setZ(z); } public static float getBaseSpeed() { float baseSpeed = mc.thePlayer.capabilities.getWalkSpeed() * 2.873f; if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) { final int ampl = mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier(); baseSpeed *= 1.0 + (0.2 * ampl); } return baseSpeed; } public static double getBaseMoveSpeed() { double speed = 0.2873; if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) { int amplifier = mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier(); speed *= 1.0 + 0.2 * (amplifier + 1); } return speed; } public static void strafe() { strafe(getHorizontalMotion()); } public static void strafe(MoveEvent event) { strafe(event, getHorizontalMotion()); } public static void strafe(double speed) { float direction = (float) Math.toRadians(getPlayerDirection()); if (isMoving()) { mc.thePlayer.motionX = -Math.sin(direction) * speed; mc.thePlayer.motionZ = Math.cos(direction) * speed; } else { mc.thePlayer.motionX = mc.thePlayer.motionZ = 0; } } public static float[] getRotations(EntityLivingBase entity) { double deltaX = entity.posX + (entity.posX - entity.lastTickPosX) - mc.thePlayer.posX, deltaY = entity.posY - 3.5 + entity.getEyeHeight() - mc.thePlayer.posY + mc.thePlayer.getEyeHeight(), deltaZ = entity.posZ + (entity.posZ - entity.lastTickPosZ) - mc.thePlayer.posZ, distance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaZ, 2)); float yaw = (float) Math.toDegrees(-Math.atan(deltaX / deltaZ)), pitch = (float) -Math.toDegrees(Math.atan(deltaY / distance)); if(deltaX < 0 && deltaZ < 0) { yaw = (float) (90 + Math.toDegrees(Math.atan(deltaZ / deltaX))); }else if(deltaX > 0 && deltaZ < 0) { yaw = (float) (-90 + Math.toDegrees(Math.atan(deltaZ / deltaX))); } return new float[] {yaw, pitch}; } public static void strafe(MoveEvent event, double speed) { float direction; KillAura killaura = (KillAura) LiquidBounce.moduleManager.getModule(KillAura.class); TargetStrafe targetStrafe = (TargetStrafe) LiquidBounce.moduleManager.getModule(TargetStrafe.class); if(killaura.getState() && killaura.getTarget() != null && targetStrafe.getState()) { if(!isBlockUnder() || mc.thePlayer.isCollidedHorizontally) { targetStrafe.direction = !targetStrafe.direction; } if(mc.thePlayer.getDistanceToEntity(killaura.getTarget()) >= targetStrafe.getRadiusValue().get()) { direction = getRotations(killaura.getTarget())[0]; } else { direction = getRotations(killaura.getTarget())[0] + (targetStrafe.direction ? 91 - mc.thePlayer.getDistanceToEntity(killaura.getTarget()) * 3 : -91 + mc.thePlayer.getDistanceToEntity(killaura.getTarget()) * 3); } direction = (float) Math.toRadians(direction); } else { direction = (float) Math.toRadians(getPlayerDirection()); } if (isMoving()) { event.setX(mc.thePlayer.motionX = -Math.sin(direction) * speed); event.setZ(mc.thePlayer.motionZ = Math.cos(direction) * speed); } else { event.setX(mc.thePlayer.motionX = 0); event.setZ(mc.thePlayer.motionZ = 0); } } public static float getPlayerDirection() { float direction = mc.thePlayer.rotationYaw; if (mc.thePlayer.moveForward > 0) { if (mc.thePlayer.moveStrafing > 0) { direction -= 45; } else if (mc.thePlayer.moveStrafing < 0) { direction += 45; } } else if (mc.thePlayer.moveForward < 0) { if (mc.thePlayer.moveStrafing > 0) { direction -= 135; } else if (mc.thePlayer.moveStrafing < 0) { direction += 135; } else { direction -= 180; } } else { if (mc.thePlayer.moveStrafing > 0) { direction -= 90; } else if (mc.thePlayer.moveStrafing < 0) { direction += 90; } } return direction; } public static double getHorizontalMotion() { return Math.hypot(mc.thePlayer.motionX, mc.thePlayer.motionZ); } public static boolean isMoving() { return mc.thePlayer.moveForward != 0 || mc.thePlayer.moveStrafing != 0; } public static float setFriction(float speed, float friction) { float percent = friction; float value = speed / 100.0F * percent; return value; } public static void setSpeed(MoveEvent moveEvent, double moveSpeed, float yaw, double forward, double strafe) { if (forward != 0.0D) { if (strafe > 0.0D) { yaw += ((forward > 0.0D) ? -45 : 45); } else if (strafe < 0.0D) { yaw += ((forward > 0.0D) ? 45 : -45); } strafe = 0.0D; if (forward > 0.0D) { forward = 1.0D; } else if (forward < 0.0D) { forward = -1.0D; } } if (strafe > 0.0D) { strafe = 1.0D; } else if (strafe < 0.0D) { strafe = -1.0D; } double mx = Math.cos(Math.toRadians((yaw + 90.0F))); double mz = Math.sin(Math.toRadians((yaw + 90.0F))); moveEvent.setX(forward * moveSpeed * mx + strafe * moveSpeed * mz); moveEvent.setZ(forward * moveSpeed * mz - strafe * moveSpeed * mx); } public static void setSpeed(double moveSpeed) { float rotationYaw = mc.thePlayer.rotationYaw; MovementInput movementInput = mc.thePlayer.movementInput; double strafe = movementInput.moveStrafe; MovementInput movementInput2 = mc.thePlayer.movementInput; setSpeed(moveSpeed, rotationYaw, strafe, movementInput.moveForward); } public static void setSpeed(double moveSpeed, float yaw, double strafe, double forward) { if (forward != 0.0D) { if (strafe > 0.0D) { yaw += ((forward > 0.0D) ? -45 : 45); } else if (strafe < 0.0D) { yaw += ((forward > 0.0D) ? 45 : -45); } strafe = 0.0D; if (forward > 0.0D) { forward = 1.0D; } else if (forward < 0.0D) { forward = -1.0D; } } if (strafe > 0.0D) { strafe = 1.0D; } else if (strafe < 0.0D) { strafe = -1.0D; } double mx = Math.cos(Math.toRadians((yaw + 90.0F))); double mz = Math.sin(Math.toRadians((yaw + 90.0F))); mc.thePlayer.motionX = forward * moveSpeed * mx + strafe * moveSpeed * mz; mc.thePlayer.motionZ = forward * moveSpeed * mz - strafe * moveSpeed * mx; } }
My MathHelper
public class MathHelper { public static double getRandom_double(double min, double max) { if (min > max) return min; Random RANDOM = new Random(); return RANDOM.nextDouble() * (max - min) + min; } public static float getRandom_float(float min, float max) { if (min > max) return min; Random RANDOM = new Random(); return RANDOM.nextFloat() * (max - min) + min; } public static long getRandom_long(long min, long max) { if (min > max) return min; Random RANDOM = new Random(); return RANDOM.nextLong() * (max - min) + min; } public static int getRandom_int(int min, int max) { if (min > max) return min; Random RANDOM = new Random(); return RANDOM.nextInt(max) + min; } public static byte getRandom_byte(byte min, byte max) { if (min > max) return min; Random RANDOM = new Random(); return (byte) (RANDOM.nextInt(max) + min); } public static double getDifference(double base, double yaw) { final double bigger; if (base >= yaw) bigger = base - yaw; else bigger = yaw - base; return bigger; } public static float getDifference(float base, float yaw) { float bigger; if (base >= yaw) bigger = base - yaw; else bigger = yaw - base; return bigger; } public static long getDifference(long base, long yaw) { long bigger; if (base >= yaw) bigger = base - yaw; else bigger = yaw - base; return bigger; } public static double round(double value, int scale, double inc) { final double halfOfInc = inc / 2.0; final double floored = Math.floor(value / inc) * inc; if (value >= floored + halfOfInc) return new BigDecimal(Math.ceil(value / inc) * inc) .setScale(scale, RoundingMode.HALF_UP) .doubleValue(); else return new BigDecimal(floored) .setScale(scale, RoundingMode.HALF_UP) .doubleValue(); } }
MoveUtil
public class MoveUtil { public void strafe(MoveEvent event) { strafe(event, getSpeed()); } public static void strafe(MoveEvent moveEvent, double movementSpeed) { if (mc.thePlayer.movementInput.moveForward > 0.0) { mc.thePlayer.movementInput.moveForward = (float) 1.0; } else if (mc.thePlayer.movementInput.moveForward < 0.0) { mc.thePlayer.movementInput.moveForward = (float) -1.0; } if (mc.thePlayer.movementInput.moveStrafe > 0.0) { mc.thePlayer.movementInput.moveStrafe = (float) 1.0; } else if (mc.thePlayer.movementInput.moveStrafe < 0.0) { mc.thePlayer.movementInput.moveStrafe = (float) -1.0; } if (mc.thePlayer.movementInput.moveForward == 0.0 && mc.thePlayer.movementInput.moveStrafe == 0.0) { mc.thePlayer.motionX = 0.0; mc.thePlayer.motionZ = 0.0; } if (mc.thePlayer.movementInput.moveForward != 0.0 && mc.thePlayer.movementInput.moveStrafe != 0.0) { mc.thePlayer.movementInput.moveForward *= ApacheMath.sin(0.6398355709958845); mc.thePlayer.movementInput.moveStrafe *= ApacheMath.cos(0.6398355709958845); } if (moveEvent != null) { moveEvent.setX(mc.thePlayer.motionX = mc.thePlayer.movementInput.moveForward * movementSpeed * -ApacheMath.sin(ApacheMath.toRadians(mc.thePlayer.rotationYaw)) + mc.thePlayer.movementInput.moveStrafe * movementSpeed * ApacheMath.cos(ApacheMath.toRadians(mc.thePlayer.rotationYaw))); moveEvent.setZ(mc.thePlayer.motionZ = mc.thePlayer.movementInput.moveForward * movementSpeed * ApacheMath.cos(ApacheMath.toRadians(mc.thePlayer.rotationYaw)) - mc.thePlayer.movementInput.moveStrafe * movementSpeed * -ApacheMath.sin(ApacheMath.toRadians(mc.thePlayer.rotationYaw))); } else { mc.thePlayer.motionX = mc.thePlayer.movementInput.moveForward * movementSpeed * -ApacheMath.sin(ApacheMath.toRadians(mc.thePlayer.rotationYaw)) + mc.thePlayer.movementInput.moveStrafe * movementSpeed * ApacheMath.cos(ApacheMath.toRadians(mc.thePlayer.rotationYaw)); mc.thePlayer.motionZ = mc.thePlayer.movementInput.moveForward * movementSpeed * ApacheMath.cos(ApacheMath.toRadians(mc.thePlayer.rotationYaw)) - mc.thePlayer.movementInput.moveStrafe * movementSpeed * -ApacheMath.sin(ApacheMath.toRadians(mc.thePlayer.rotationYaw)); } } public static boolean isBlockUnderneath(BlockPos pos) { for (int k = 0; k < pos.getY() + 1; k++) { if (mc.theWorld.getBlockState(new BlockPos(pos.getX(), k, pos.getZ())).getBlock().getMaterial() != Material.air) { return true; } } return false; } public static float getSpeed2() { return (float) Math.sqrt(mc.thePlayer.motionX * mc.thePlayer.motionX + mc.thePlayer.motionZ * mc.thePlayer.motionZ); } private static final Minecraft mc = Minecraft.getMinecraft(); public static Float movementYaw; public static double getMotion(final EntityLivingBase player) { return MathUtils.distance(player.prevPosX, player.prevPosZ, player.posX, player.posZ); } public static void setSpeed(final MoveEvent moveEvent, final double moveSpeed) { setSpeed(moveEvent, moveSpeed, mc.thePlayer.rotationYaw, mc.thePlayer.movementInput.moveStrafe, mc.thePlayer.movementInput.moveForward); } public static void setSpeed(final MoveEvent moveEvent, final double moveSpeed, final float pseudoYaw, final double pseudoStrafe, final double pseudoForward) { double forward = pseudoForward; double strafe = pseudoStrafe; float yaw = pseudoYaw; if (forward != 0.0) { if (strafe > 0.0) { yaw += ((forward > 0.0) ? -25 : 25); } else if (strafe < 0.0) { yaw += ((forward > 0.0) ? 25 : -25); } strafe = 0.0F; if (forward > 0.0) { forward = 0.1F; } else if (forward < 0.0) { forward = -0.1F; } } if (strafe > 0.0) { strafe = 1F; } else if (strafe < 0.0) { strafe = -1F; } double mx = Math.cos(Math.toRadians((yaw + 90.0F))); double mz = Math.sin(Math.toRadians((yaw + 90.0F))); moveEvent.setX((forward * moveSpeed * mx + strafe * moveSpeed * mz)); moveEvent.setZ((forward * moveSpeed * mz - strafe * moveSpeed * mx)); } public static void setSpeed( MoveEvent e, double speed, float forward, float strafing, float yaw) { boolean reversed = forward < 0.0f; float strafingYaw = 90.0f * (forward > 0.0f ? 0.5f : reversed ? -0.5f : 1.0f); if (reversed) yaw += 180.0f; if (strafing > 0.0f) yaw -= strafingYaw; else if (strafing < 0.0f) yaw += strafingYaw; double x = Math.cos(Math.toRadians(yaw + 90.0f)); double z = Math.cos(Math.toRadians(yaw)); e.setX(x * speed); e.setZ(z * speed); } public static void setSpeed(double moveSpeed, float yaw, double strafe, double forward) { double fforward = forward; double sstrafe = strafe; float yyaw = yaw; if (forward != 0.0D) { if (strafe > 0.0D) { yaw += ((forward > 0.0D) ? -45 : 45); } else if (strafe < 0.0D) { yaw += ((forward > 0.0D) ? 45 : -45); } strafe = 0.0D; if (forward > 0.0D) { forward = 1.0D; } else if (forward < 0.0D) { forward = -1.0D; } } if (strafe > 0.0D) { strafe = 1.0D; } else if (strafe < 0.0D) { strafe = -1.0D; } double mx = Math.cos(Math.toRadians((yaw + 90.0F))); double mz = Math.sin(Math.toRadians((yaw + 90.0F))); mc.thePlayer.motionX = forward * moveSpeed * mx + strafe * moveSpeed * mz; mc.thePlayer.motionZ = forward * moveSpeed * mz - strafe * moveSpeed * mx; } public static double getDirection(final float yaw) { float rotationYaw = yaw; if (movementYaw != null) { rotationYaw = movementYaw; } if (mc.thePlayer.moveForward < 0F) rotationYaw += 180F; float forward = 1F; if (mc.thePlayer.moveForward < 0F) forward = -0.5F; else if (mc.thePlayer.moveForward > 0F) forward = 0.5F; if (mc.thePlayer.moveStrafing > 0F) rotationYaw -= 90F * forward; if (mc.thePlayer.moveStrafing < 0F) rotationYaw += 90F * forward; return Math.toRadians(rotationYaw); } public static double getAllowedHorizontalDistance() { double horizontalDistance; boolean useBaseModifiers = false; if (PlayerUtil.getBlockRelativeToPlayer(0, 0, 0) instanceof BlockWeb) { horizontalDistance = 0.105; } else if (isInLiquid()) { horizontalDistance = 0.115F; } else if (mc.thePlayer.isSneaking()) { horizontalDistance = 0.3F * 0.221; } else { horizontalDistance = 0.221; useBaseModifiers = true; } if (useBaseModifiers) { if (Math.abs(mc.thePlayer.moveForward) >= 0.8F || Math.abs(mc.thePlayer.moveStrafing) >= 0.8F) { horizontalDistance *= 1.3F; } if (mc.thePlayer.isPotionActive(Potion.moveSpeed) && mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getDuration() > 0) { horizontalDistance *= 1 + (0.2 * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1)); } if (mc.thePlayer.isPotionActive(Potion.moveSlowdown)) { horizontalDistance = 0.29; } } final Block below = PlayerUtil.getBlockRelativeToPlayer(0, -1, 0); if (below == Blocks.ice || below == Blocks.packed_ice) { horizontalDistance *= 2.5F; } return horizontalDistance; } public static boolean isOnGround(final double height) { return !mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0.0, -height, 0.0)).isEmpty(); } /** * Used to get the players speed */ public static double getSpeed() { // nigga hypot heavy return Math.hypot(mc.thePlayer.motionX, mc.thePlayer.motionZ); } /** * Sets current speed to itself make strafe */ public static void strafe() { strafe(getSpeed()); } /** * Checks if the player is moving */ public static boolean isMoving() { return mc.thePlayer != null && (mc.thePlayer.movementInput.moveForward != 0F || mc.thePlayer.movementInput.moveStrafe != 0F); } public static void stop() { mc.thePlayer.motionX = mc.thePlayer.motionZ = 0; } /** * Sets players speed, with floats */ public static void strafe(final float speed) { if (!isMoving()) return; final double yaw = getDirection(); mc.thePlayer.motionX = -MathHelper.sin((float) yaw) * speed; mc.thePlayer.motionZ = MathHelper.cos((float) yaw) * speed; } /** * Used to get the players speed, with doubles */ public static void strafe(final double speed) { if (!isMoving()) return; final double yaw = getDirection(); mc.thePlayer.motionX = -MathHelper.sin((float) yaw) * speed; mc.thePlayer.motionZ = MathHelper.cos((float) yaw) * speed; } public static void strafe(final double speed, double yaw) { if (!isMoving()) return; if (Helper.INSTANCE.getMoveYaw() != 0) { yaw = Helper.INSTANCE.getMoveYaw(); } mc.thePlayer.motionX = -MathHelper.sin((float) yaw) * speed; mc.thePlayer.motionZ = MathHelper.cos((float) yaw) * speed; } public static void forward(final double speed) { final double yaw = getDirection(); mc.thePlayer.motionX = -Math.sin(yaw) * speed; mc.thePlayer.motionZ = Math.cos(yaw) * speed; } public static double moveSpeed() { if (mc.gameSettings.keyBindSprint.isKeyDown()) { if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) { if (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1 == 1) { return 0.18386012061481244; } else { return 0.21450346015841276; } } else { return 0.15321676228437875; } } else { if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) { if (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1 == 1) { return 0.14143085686761; } else { return 0.16500264553372018; } } else { return 0.11785905094607611; } } } /** * Gets the direction of were the player is looking */ public static double getDirection() { float rotationYaw = mc.thePlayer.rotationYaw; if (mc.thePlayer.moveForward < 0F) rotationYaw += 180F; float forward = 1F; if (mc.thePlayer.moveForward < 0F) forward = -0.5F; else if (mc.thePlayer.moveForward > 0F) forward = 0.5F; if (mc.thePlayer.moveStrafing > 0F) rotationYaw -= 90F * forward; if (mc.thePlayer.moveStrafing < 0F) rotationYaw += 90F * forward; return Math.toRadians(rotationYaw); } public static double getDirectionWrappedTo90() { float rotationYaw = mc.thePlayer.rotationYaw; if (mc.thePlayer.moveForward < 0F && mc.thePlayer.moveStrafing == 0F) rotationYaw += 180F; final float forward = 1F; if (mc.thePlayer.moveStrafing > 0F) rotationYaw -= 90F * forward; if (mc.thePlayer.moveStrafing < 0F) rotationYaw += 90F * forward; return Math.toRadians(rotationYaw); } /** * Used to get base movement speed */ public static double getBaseMoveSpeed() { double baseSpeed = 0.2873D; if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) baseSpeed *= 1.0D + 0.2D * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1); return baseSpeed; } public static double getBaseMoveSpeedOther() { double baseSpeed = 0.2875D; if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) baseSpeed *= 1.0D + 0.2D * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1); return baseSpeed; } public static double getJumpMotion(float motionY) { final Potion potion = Potion.jump; if (mc.thePlayer.isPotionActive(potion)) { final int amplifier = mc.thePlayer.getActivePotionEffect(potion).getAmplifier(); motionY += (amplifier + 1) * 0.1F; } return motionY; } public static double getPredictedMotionY(final double motionY) { return (motionY - 0.08) * 0.98F; } public static void setMoveEventSpeed(final MoveEvent moveEvent, final double moveSpeed) { setMoveEvent(moveEvent, moveSpeed, mc.thePlayer.rotationYaw, mc.thePlayer.movementInput.moveStrafe, mc.thePlayer.movementInput.moveForward); } // jumps without setting motionY to 0.42F // in other words, increases motionX/Z and everything else that the jump method does, allowing a custom motionY public static void jumpNoMotionY() { double motionY = mc.thePlayer.motionY; mc.thePlayer.jump(); mc.thePlayer.motionY = motionY; } public static Vector2d getMotion(final double moveSpeed) { final MovementInput movementInput = mc.thePlayer.movementInput; double moveForward = movementInput.moveForward; double moveStrafe = movementInput.moveStrafe; double rotationYaw = mc.thePlayer.rotationYaw; if (moveForward != 0.0D || moveStrafe != 0.0D) { if (moveStrafe > 0) { moveStrafe = 1; } else if (moveStrafe < 0) { moveStrafe = -1; } if (moveForward != 0.0D) { if (moveStrafe > 0.0D) { rotationYaw += moveForward > 0.0D ? -45 : 45; } else if (moveStrafe < 0.0D) { rotationYaw += moveForward > 0.0D ? 45 : -45; } moveStrafe = 0.0D; if (moveForward > 0.0D) { moveForward = 1.0D; } else if (moveForward < 0.0D) { moveForward = -1.0D; } } rotationYaw *= 0.995; final double cos = Math.cos(Math.toRadians(rotationYaw + 90.0F)); final double sin = Math.sin(Math.toRadians(rotationYaw + 90.0F)); return new Vector2d(moveForward * moveSpeed * cos + moveStrafe * moveSpeed * sin, moveForward * moveSpeed * sin - moveStrafe * moveSpeed * cos); } return new Vector2d(0, 0); } public static void setMoveEvent(final MoveEvent moveEvent, final double moveSpeed, final float pseudoYaw, final double pseudoStrafe, final double pseudoForward) { double forward = pseudoForward; double strafe = pseudoStrafe; float yaw = pseudoYaw; if (forward != 0.0D) { if (strafe > 0.0D) { yaw += ((forward > 0.0D) ? -45 : 45); } else if (strafe < 0.0D) { yaw += ((forward > 0.0D) ? 45 : -45); } strafe = 0.0D; if (forward > 0.0D) { forward = 1.0D; } else if (forward < 0.0D) { forward = -1.0D; } } if (strafe > 0.0D) { strafe = 1.0D; } else if (strafe < 0.0D) { strafe = -1.0D; } final double mx = Math.cos(Math.toRadians((yaw + 90.0F))); final double mz = Math.sin(Math.toRadians((yaw + 90.0F))); moveEvent.setX(forward * moveSpeed * mx + strafe * moveSpeed * mz); moveEvent.setZ(forward * moveSpeed * mz - strafe * moveSpeed * mx); } }
speed codes form Azura-X : )