[MC] Oldschool fly

Discussion in 'Source Code' started by Cre3per, Nov 15, 2014.

  1. Cre3per

    Cre3per Addicted Member Inventar

    Joined:
    Oct 22, 2012
    Messages:
    697
    Likes Received:
    2
    Code:
    private static void HandleFlight()
        {
            Minecraft mc = Minecraft.getMinecraft();
            
            if (!Variables.misc_fly.current.enabled)
                return;
            if (mc.theWorld == null)
                return;
            
            float flForward = 0.0f;
            float flSide = 0.0f;
            float flUp = 0.0f;
            float flSpeed = Variables.misc_fly_speed.current.value;
            
            
            if (mc.gameSettings.keyBindJump.getIsKeyPressed())
                flUp = 1.0f;
            else if (mc.gameSettings.keyBindSneak.getIsKeyPressed())
                flUp = -1.0f;
            
            flForward = mc.thePlayer.moveForward;
            flSide = mc.thePlayer.moveStrafing;
            
            flForward *= flSpeed;
            flSide *= flSpeed;
            flUp *= flSpeed;
      
            float flDir_01 = MathHelper.sin(mc.thePlayer.rotationYaw * (float)java.lang.Math.PI / 180.0F);
            float flDir_02 = MathHelper.cos(mc.thePlayer.rotationYaw * (float)java.lang.Math.PI / 180.0F);
    
            mc.thePlayer.motionX = (double)(flSide * flDir_02 - flForward * flDir_01);
            mc.thePlayer.motionZ = (double)(flForward * flDir_02 + flSide * flDir_01);
            mc.thePlayer.motionY = (double) flUp;
        }
    
    Macht mal mehr code-highlighting ihr faulen Admins [​IMG]
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.