func (h PlayerAuthInputHandler) handleActions(pk *packet.PlayerAuthInput, s *Session) error {
	if pk.InputData&packet.InputFlagPerformItemInteraction != 0 {
		if err := h.handleUseItemData(pk.ItemInteractionData, s); err != nil {
			return err
		}
	}
	if pk.InputData&packet.InputFlagPerformItemStackRequest != 0 {
		s.log.Debugf("PlayerAuthInput: unexpected item stack request: %#v\n", pk.ItemStackRequest)
	}
	if pk.InputData&packet.InputFlagPerformBlockActions != 0 {
		if err := h.handleBlockActions(pk.BlockActions, s); err != nil {
			return err
		}
	}
	h.handleInputFlags(pk.InputData, s)
	return nil
}
handleActions handles the actions with the world that are present in the PlayerAuthInput packet.
package session
import (
	"fmt"
	"github.com/df-mc/dragonfly/server/block/cube"
	"github.com/df-mc/dragonfly/server/entity"
	"github.com/go-gl/mathgl/mgl32"
	"github.com/go-gl/mathgl/mgl64"
	"github.com/sandertv/gophertunnel/minecraft/protocol"
	"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
	"math"
)
type PlayerAuthInputHandler struct{}
func (h PlayerAuthInputHandler) Handle(p packet.Packet, s *Session) error {
	pk := p.(*packet.PlayerAuthInput)
	if err := h.handleMovement(pk, s); err != nil {
		return err
	}
	return h.handleActions(pk, s)
}
func (h PlayerAuthInputHandler) handleMovement(pk *packet.PlayerAuthInput, s *Session) error {
	for _, v := range [...]float32{pk.Pitch, pk.Yaw, pk.HeadYaw, pk.Position[0], pk.Position[1], pk.Position[2]} {
		f := float64(v)
		if math.IsNaN(f) || math.IsInf(f, 1) || math.IsInf(f, 0) {
			return fmt.Errorf("player auth input packet must never send nan/inf values")
		}
	}
	pk.Position = pk.Position.Sub(mgl32.Vec3{0, 1.62})  
	newPos := vec32To64(pk.Position)
	yaw, pitch := s.c.Rotation()
	deltaPos, deltaYaw, deltaPitch := newPos.Sub(s.c.Position()), float64(pk.Yaw)-yaw, float64(pk.Pitch)-pitch
	if mgl64.FloatEqual(deltaPos.Len(), 0) && mgl64.FloatEqual(deltaYaw, 0) && mgl64.FloatEqual(deltaPitch, 0) {
		return nil
	}
	s.teleportMu.Lock()
	if s.teleportPos != nil {
		if newPos.Sub(*s.teleportPos).Len() > 0.5 {
			s.teleportMu.Unlock()
			s.ViewEntityTeleport(s.c, s.c.Position())
			return nil
		}
		s.teleportPos = nil
	}
	s.teleportMu.Unlock()
	_, submergedBefore := s.c.World().Liquid(cube.PosFromVec3(entity.EyePosition(s.c)))
	s.c.Move(deltaPos, deltaYaw, deltaPitch)
	_, submergedAfter := s.c.World().Liquid(cube.PosFromVec3(entity.EyePosition(s.c)))
	if submergedBefore != submergedAfter {
		s.ViewEntityState(s.c)
	}
	s.chunkLoader.Move(s.c.Position())
	s.writePacket(&packet.NetworkChunkPublisherUpdate{
		Position: protocol.BlockPos{int32(pk.Position[0]), int32(pk.Position[1]), int32(pk.Position[2])},
		Radius:   uint32(s.chunkRadius) << 4,
	})
	return nil
}