-
Notifications
You must be signed in to change notification settings - Fork 6
/
gui_data_pick_item.go
37 lines (32 loc) · 1.13 KB
/
gui_data_pick_item.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
30
31
32
33
34
35
36
37
package packet
import (
"dotcs/minecraft/protocol"
)
// GUIDataPickItem is sent by the server to make the client 'select' a hot bar slot. It currently appears to
// be broken however, and does not actually set the selected slot to the hot bar slot set in the packet.
type GUIDataPickItem struct {
// ItemName is the name of the item that shows up in the top part of the popup that shows up when
// selecting an item. It is shown as if an item was selected by the player itself.
ItemName string
// ItemEffects is the line under the ItemName, where the effects of the item are usually situated.
ItemEffects string
// HotBarSlot is the hot bar slot to be selected/picked. This does not currently work, so it does not
// matter what number this is.
HotBarSlot int32
}
// ID ...
func (*GUIDataPickItem) ID() uint32 {
return IDGUIDataPickItem
}
// Marshal ...
func (pk *GUIDataPickItem) Marshal(w *protocol.Writer) {
w.String(&pk.ItemName)
w.String(&pk.ItemEffects)
w.Int32(&pk.HotBarSlot)
}
// Unmarshal ...
func (pk *GUIDataPickItem) Unmarshal(r *protocol.Reader) {
r.String(&pk.ItemName)
r.String(&pk.ItemEffects)
r.Int32(&pk.HotBarSlot)
}