forked from Sandertv/gophertunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
block_pick_request.go
29 lines (25 loc) · 939 Bytes
/
block_pick_request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package packet
import (
"github.com/Adrian8115/gophertunnel-Amethyst-Protocol/minecraft/protocol"
)
// BlockPickRequest is sent by the client when it requests to pick a block in the world and place its item in
// their inventory.
type BlockPickRequest struct {
// Position is the position at which the client requested to pick the block. The block at that position
// should have its item put in HotBarSlot if it is empty.
Position protocol.BlockPos
// AddBlockNBT specifies if the item should get all NBT tags from the block, meaning the item places a
// block practically always equal to the one picked.
AddBlockNBT bool
// HotBarSlot is the slot that was held at the time of picking a block.
HotBarSlot byte
}
// ID ...
func (*BlockPickRequest) ID() uint32 {
return IDBlockPickRequest
}
func (pk *BlockPickRequest) Marshal(io protocol.IO) {
io.BlockPos(&pk.Position)
io.Bool(&pk.AddBlockNBT)
io.Uint8(&pk.HotBarSlot)
}