setSpeed(9.9);
if (mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY + 0.0000001, mc.player.posZ)).getBlock() == Block.getBlockById(9)) {
mc.player.fallDistance = 0.0 f;
mc.player.motionX = 0.0;
mc.player.motionY = 0.06 f;
mc.player.jumpMovementFactor = 0.01 f;
mc.player.motionZ = 0.0;
}
public static void setSpeed(double speed) {
double forward = MovementInput.field_192832_b;
double strafe = MovementInput.moveStrafe;
float yaw = Minecraft.player.rotationYaw;
if (forward == 0.0 && strafe == 0.0) {
Minecraft.player.motionX = 0.0;
Minecraft.player.motionZ = 0.0;
} else {
if (forward != 0.0) {
if (strafe > 0.0) {
yaw += (float)(forward > 0.0 ? -45 : 45);
} else if (strafe < 0.0) {
yaw += (float)(forward > 0.0 ? 45 : -45);
}
strafe = 0.0;
if (forward > 0.0) {
forward = 1.0;
} else if (forward < 0.0) {
forward = -1.0;
}
}
Minecraft.player.motionX = forward * speed * Math.cos(Math.toRadians(yaw + 90.0 f)) + strafe * speed * Math.sin(Math.toRadians(yaw + 90.0 f));
Minecraft.player.motionZ = forward * speed * Math.sin(Math.toRadians(yaw + 90.0 f)) - strafe * speed * Math.cos(Math.toRadians(yaw + 90.0 f));
}
}
}