var scriptName = "MineverseFly";
var scriptAuthor = "jody_snake";
var scriptVersion = 1.0;

 Math.rad = function(deg) {
    return deg * Math.PI / 180;
  };

 Math.radians = function(degrees) {
    return degrees * Math.PI / 180;
  };
  
var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition');

function ExampleModule() {
    this.getName = function() {
        return "MineverseLongJump";
    }
    this.getDescription = function() {
        return "LongJump";
    }
    this.getCategory = function() {
        return "Fun";
    }
    this.onEnable = function() {
        chat.print("§bThe LongJump script Make by jody_snake");
    }
    this.onDisable = function() {
		mc.timer.timerSpeed = 1;
    }
    this.onUpdate = function() {
		var yaw = Math.radians(mc.thePlayer.rotationYaw);
		var mx = mc.thePlayer.posX - (Math.sin(yaw) * 4)
		var mz = mc.thePlayer.posZ + (Math.cos(yaw) * 4)
        if(mc.thePlayer.onGround && mc.gameSettings.keyBindJump.pressed){
			mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mx, mc.thePlayer.posY + 2, mz, true));
		}
    }
}
var exampleModule = new ExampleModule();
var exampleModuleClient;

function onLoad() {}

function onEnable() {
    exampleModuleClient = moduleManager.registerModule(exampleModule);
}

function onDisable() {
    moduleManager.unregisterModule(exampleModuleClient);
}