var scriptName = "OldPingspoof";
var scriptVersion = 1.0;
var scriptAuthor = "Soulplexis";

function randomIntFrom(min,max) // Get a random integer from [min] to [max] 
{
    return Math.floor(Math.random()*(max-min+1)+min);
} 
var C00PacketKeepAlive = Java.type('net.minecraft.network.play.client.C00PacketKeepAlive');


function RealBob() {
	//var LagAmount = value.createInteger("Milliseconds", 500, 0, 1200);
    this.getName = function () {
        return "OldPingspoof";
    };

    this.getDescription = function () {
        return "Spoofs ping to 0.";
    };

    this.getCategory = function () {
        return "Exploit";
    };
    this.onMotion = function () {
		x++;
    } 
    this.onPacket = function(event) {
		var packet = event.getPacket();
		if(packet instanceof C00PacketKeepAlive /* && x >= LagAmount.get() + randomIntFrom(-50,50) */) {
			event.cancelEvent();
			//x = 0;
		}
    }
    
    this.onEnable = function() {
		//var x = 0;
    }

    this.addValues = function(values) {
        //values.add(LagAmount);
    }
}
var RealBob = new RealBob();
var RealBobClient;

function onEnable() {
    RealBobClient = moduleManager.registerModule(RealBob);
};

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