- Joined
- Jul 11, 2020
- Messages
- 303
- Reaction score
- 116
- Points
- 43
Nothing special, but could be useful for some clowns who still cant do a single bit of "math"
want something just comment in this thread
want something just comment in this thread
public class MoveUtil implements IMinecraft { //its obv what it does bruh public static double getDirection() { float moveSpeed = (float) 1.0; float yaw = mc.thePlayer.rotationYaw; boolean movingForwards = mc.thePlayer.moveForward < 0; boolean movingBackwards = mc.thePlayer.moveForward > 0; boolean movingLeft = mc.thePlayer.moveStrafing > 0; boolean movingRight = mc.thePlayer.moveStrafing < 0; if (movingForwards) { yaw += 180; } if (movingForwards) { moveSpeed = -0.5F; } if (movingBackwards) { moveSpeed = 0.5F; } if (movingLeft) { yaw -= 90.0 * moveSpeed; } if (movingRight) { yaw += 90.0 * moveSpeed; } return Math.toRadians(yaw); } public static void setSpeed(final double Speed) { double direction = getDirection(); mc.thePlayer.motionX = -MathHelper.sin((float) direction) * Speed; mc.thePlayer.motionZ = MathHelper.cos((float) direction) * Speed; } public static double getBaseMoveSpeed() { double baseSpeed = 0.28746801192563104D; //last airtick speed, 0.21 lowest value when falling straight down if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) { final double fixedSpeedMotion = 0.20000000298023224D; //Potion.java#moveSpeed = (new Potion( baseSpeed *= 1.0D + fixedSpeedMotion * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1); } return baseSpeed; } public static double getFixedMotionY(double baseJumpHeight) { if (mc.thePlayer.isPotionActive(Potion.jump)) { baseJumpHeight += (float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F; } return baseJumpHeight; } public static double getSpeed() { return Math.sqrt(mc.thePlayer.motionX * mc.thePlayer.motionX + mc.thePlayer.motionZ * mc.thePlayer.motionZ); } /* speed = calculateMoveSpeed(speed, lastDistance, divisor); aka speed = calculateMoveSpeed(speed, lastDistance, 159); */ public static float calculateMoveSpeed(final float speed, final double lastDist, final float divisor) { return (float) (speed - (lastDist / divisor)); } }