Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final class Strafe
- extends ModBase
- {
- public Strafe()
- {
- super("Strafe", "0", true, ".t strafe", Category.Combat);
- setColor(9883085);
- setDescription("Skip much faster at the time of PvP");
- setEnabled(true);
- }
- public void postUpdate()
- {
- if (Minecraft.thePlayer.onGround) {
- return;
- }
- if ((!Minecraft.thePlayer.onGround) && (!Minecraft.thePlayer.isInWater()))
- {
- float dir = Minecraft.thePlayer.rotationYaw;
- if (Minecraft.thePlayer.moveForward < 0.0F) {
- dir += 180.0F;
- }
- if (Minecraft.thePlayer.moveStrafing > 0.0F) {
- dir -= 90.0F * (Minecraft.thePlayer.moveForward < 0.0F ? -0.5F : Minecraft.thePlayer.moveForward > 0.0F ? 0.5F : 1.0F);
- }
- if (Minecraft.thePlayer.moveStrafing < 0.0F) {
- dir += 90.0F * (Minecraft.thePlayer.moveForward < 0.0F ? -0.5F : Minecraft.thePlayer.moveForward > 0.0F ? 0.5F : 1.0F);
- }
- double hOff = 0.221D;
- if (Minecraft.thePlayer.isSprinting()) {
- hOff *= 1.3190000119209289D;
- }
- if (Minecraft.thePlayer.isSneaking()) {
- hOff *= 0.3D;
- }
- if (Minecraft.thePlayer.getActivePotionEffect(Potion.moveSpeed) != null) {
- for (int xD = 0; xD < Minecraft.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1; xD++) {
- hOff *= 1.2000000029802322D;
- }
- }
- float var9 = (float)((float)Math.cos((dir + 90.0F) * 3.141592653589793D / 180.0D) * hOff);
- float zD = (float)((float)Math.sin((dir + 90.0F) * 3.141592653589793D / 180.0D) * hOff);
- if ((Minecraft.getMinecraft().gameSettings.keyBindForward.pressed) || (Minecraft.getMinecraft().gameSettings.keyBindLeft.pressed) || (Minecraft.getMinecraft().gameSettings.keyBindRight.pressed) || (Minecraft.getMinecraft().gameSettings.keyBindBack.pressed))
- {
- Minecraft.thePlayer.motionX = var9;
- Minecraft.thePlayer.motionZ = zD;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement