-
-
Notifications
You must be signed in to change notification settings - Fork 89
/
set_player_inventory_options.go
58 lines (51 loc) · 1.74 KB
/
set_player_inventory_options.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package packet
import (
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
const (
InventoryLayoutNone = iota
InventoryLayoutSurvival
InventoryLayoutRecipeBook
InventoryLayoutCreative
)
const (
InventoryLeftTabNone = iota
InventoryLeftTabConstruction
InventoryLeftTabEquipment
InventoryLeftTabItems
InventoryLeftTabNature
InventoryLeftTabSearch
InventoryLeftTabSurvival
)
const (
InventoryRightTabNone = iota
InventoryRightTabFullScreen
InventoryRightTabCrafting
InventoryRightTabArmour
)
// SetPlayerInventoryOptions is a bidirectional packet that can be used to update the inventory options of a player.
type SetPlayerInventoryOptions struct {
// LeftInventoryTab is the tab that is selected on the left side of the inventory. This is usually for the creative
// inventory. It is one of the InventoryLeftTab constants above.
LeftInventoryTab byte
// RightInventoryTab is the tab that is selected on the right side of the inventory. This is usually for the player's
// own inventory. It is one of the InventoryRightTab constants above.
RightInventoryTab byte
// Filtering is whether the player has enabled the filtering between recipes they have unlocked or not.
Filtering bool
// InventoryLayout is the layout of the inventory. It is one of the InventoryLayout constants above.
InventoryLayout byte
// CraftingLayout is the layout of the crafting inventory. It is one of the InventoryLayout constants above.
CraftingLayout byte
}
// ID ...
func (*SetPlayerInventoryOptions) ID() uint32 {
return IDSetPlayerInventoryOptions
}
func (pk *SetPlayerInventoryOptions) Marshal(io protocol.IO) {
io.Uint8(&pk.LeftInventoryTab)
io.Uint8(&pk.RightInventoryTab)
io.Bool(&pk.Filtering)
io.Uint8(&pk.InventoryLayout)
io.Uint8(&pk.CraftingLayout)
}