content: package myau.module.modules;
  
  import myau.event.EventTarget;
  import myau.event.types.EventType;
  import myau.events.StrafeEvent;
  import myau.events.UpdateEvent;
  import myau.module.Module;
  import myau.util.KeyBindUtil;
  import myau.util.MoveUtil;
  import myau.property.properties.FloatProperty;
  import net.minecraft.client.Minecraft;
  
  public class Fly extends Module {
      private static final Minecraft mc = Minecraft.getMinecraft();
      private double verticalMotion = 0.0;
      public final FloatProperty hSpeed = new FloatProperty("horizontal-speed", 1.0F, 0.0F, 100.0F);
      public final FloatProperty vSpeed = new FloatProperty("vertical-speed", 1.0F, 0.0F, 100.0F);
  
      public Fly() {
          super("Fly", false);
      }
  
      @EventTarget
      public void onStrafe(StrafeEvent event) {
          if (this.isEnabled()) {
              if (mc.thePlayer.posY % 1.0 != 0.0) {
                  mc.thePlayer.motionY = this.verticalMotion;
              }
              MoveUtil.setSpeed(0.0);
              event.setFriction((float) MoveUtil.getBaseMoveSpeed() * this.hSpeed.getValue());
          }
      }
  
      @EventTarget
      public void onUpdate(UpdateEvent event) {
          if (this.isEnabled() && event.getType() == EventType.PRE) {
              this.verticalMotion = 0.0;
              if (mc.currentScreen == null) {
                  if (KeyBindUtil.isKeyDown(mc.gameSettings.keyBindJump.getKeyCode())) {
                      this.verticalMotion = this.verticalMotion + this.vSpeed.getValue().doubleValue() * 0.42F;
                  }
                  if (KeyBindUtil.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) {
                      this.verticalMotion = this.verticalMotion - this.vSpeed.getValue().doubleValue() * 0.42F;
                  }
                  KeyBindUtil.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), false);
              }
          }
      }
  
      @Override
      public void onDisabled() {
          mc.thePlayer.motionY = 0.0;
          MoveUtil.setSpeed(0.0);
          KeyBindUtil.updateKeyState(mc.gameSettings.keyBindSneak.getKeyCode());
      }
  }
  