Exemplo n.º 1
0
    public void OnPlayerPosition(IMinecraftUser user, IMinecraftPacket packet)
    {
        Position destinationPosition = packet.ReadAbsolutePosition();
        bool     isOnGround          = packet.ReadBoolean();

        user.Player.Move(destinationPosition, isOnGround);
    }
    public void OnPlayerPositionAndRotation(IMinecraftUser user, IMinecraftPacket packet)
    {
        Position destinationPosition = packet.ReadAbsolutePosition();
        float    yawAngle            = packet.ReadSingle();
        float    pitchAngle          = packet.ReadSingle();
        bool     isOnGround          = packet.ReadBoolean();

        user.Player.MoveAndRotate(destinationPosition, yawAngle, pitchAngle, isOnGround);
    }