Search in sources :

Example 1 with PlayerAbilitiesMessage

use of net.glowstone.net.message.play.player.PlayerAbilitiesMessage in project Glowstone by GlowstoneMC.

the class GlowPlayer method sendAbilities.

////////////////////////////////////////////////////////////////////////////
// Experience and levelling
private void sendAbilities() {
    boolean creative = getGameMode() == GameMode.CREATIVE;
    int flags = (creative ? 8 : 0) | (canFly ? 4 : 0) | (flying ? 2 : 0) | (creative ? 1 : 0);
    // division is conversion from Bukkit to MC units
    session.send(new PlayerAbilitiesMessage(flags, flySpeed / 2f, walkSpeed / 2f));
}
Also used : PlayerAbilitiesMessage(net.glowstone.net.message.play.player.PlayerAbilitiesMessage)

Aggregations

PlayerAbilitiesMessage (net.glowstone.net.message.play.player.PlayerAbilitiesMessage)1