forked from Sandertv/gophertunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unlocked_recipes.go
33 lines (28 loc) · 936 Bytes
/
unlocked_recipes.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
package packet
import (
"github.com/Adrian8115/gophertunnel-Amethyst-Protocol/minecraft/protocol"
)
const (
UnlockedRecipesTypeEmpty = iota
UnlockedRecipesTypeInitiallyUnlocked
UnlockedRecipesTypeNewlyUnlocked
UnlockedRecipesTypeRemoveUnlocked
UnlockedRecipesTypeRemoveAllUnlocked
)
// UnlockedRecipes gives the client a list of recipes that have been unlocked, restricting the recipes that appear in
// the recipe book.
type UnlockedRecipes struct {
// UnlockType is the type of unlock that the packet represents, and can either be adding or removing a list of recipes.
// It is one of the constants listed above.
UnlockType uint32
// Recipes is a list of recipe names that have been unlocked.
Recipes []string
}
// ID ...
func (*UnlockedRecipes) ID() uint32 {
return IDUnlockedRecipes
}
func (pk *UnlockedRecipes) Marshal(io protocol.IO) {
io.Uint32(&pk.UnlockType)
protocol.FuncSlice(io, &pk.Recipes, io.String)
}