Java Code Examples for net.minecraft.entity.player.EntityPlayer.sendPlayerAbilities()

The following are Jave code examples for showing how to use sendPlayerAbilities() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Zombe-Modpack   File: Fly.java   View Source Code Vote up 5 votes
private static void afterMove(EntityPlayer ent, Vec3d move) {
    if (isSleeping(ent) || ent.isRiding()) return;
    if (ent == flyPlayer) {
        playerClassActive = true;
        playerOnGround = getOnGround(ent);

        if (modFlyAllowed) {
            if (getMotionX(ent) != 0) setMotionX(ent, motionX);
            if (getMotionY(ent) != 0) setMotionY(ent, motionY);
            if (getMotionZ(ent) != 0) setMotionZ(ent, motionZ);
            if (playerFly) {
                flyPlayer.movementInput.sneak = false;
                setFall(ent, 0f); setOnGround(ent, true);
                setSteps(ent, flySteps);
                setFlying(ent, true);
                if (ent.capabilities.allowFlying)
                ent.sendPlayerAbilities();
            } else if (flew && !getOnGround(ent)) {
                setFall(ent, 0f); setOnGround(ent, true);
                if (ent.capabilities.allowFlying)
                ent.sendPlayerAbilities();
            }
            else flew = false;
        }
    }
    if (ent == flyDummy) {
        dummyOnGround = getOnGround(ent);
        if (getMotionX(ent) != 0) setMotionX(ent, motionX);
        if (getMotionY(ent) != 0) setMotionY(ent, motionY);
        if (getMotionZ(ent) != 0) setMotionZ(ent, motionZ);
        if (dummyFly) {
            flyDummy.movementInput.sneak = false;
            setSteps(ent, flySteps);
            setFlying(ent, true);
        }
        setFall(ent, 0f);
        setOnGround(ent, true);
    }
}