github.com/df-mc/dragonfly@v0.9.13/server/session/handler_block_pick_request.go (about)

     1  package session
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/block/cube"
     5  	"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
     6  )
     7  
     8  // BlockPickRequestHandler handles the BlockPickRequest packet.
     9  type BlockPickRequestHandler struct{}
    10  
    11  // Handle ...
    12  func (b BlockPickRequestHandler) Handle(p packet.Packet, s *Session) error {
    13  	pk := p.(*packet.BlockPickRequest)
    14  	s.c.PickBlock(cube.Pos{int(pk.Position.X()), int(pk.Position.Y()), int(pk.Position.Z())})
    15  	return nil
    16  }