-
-
Notifications
You must be signed in to change notification settings - Fork 89
/
resource_pack_stack.go
48 lines (44 loc) · 2.22 KB
/
resource_pack_stack.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
package packet
import (
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
// ResourcePackStack is sent by the server to send the order in which resource packs and behaviour packs
// should be applied (and downloaded) by the client.
type ResourcePackStack struct {
// TexturePackRequired specifies if the client must accept the texture packs the server has in order to
// join the server. If set to true, the client gets the option to either download the resource packs and
// join, or quit entirely. Behaviour packs never have to be downloaded.
TexturePackRequired bool
// BehaviourPack is a list of behaviour packs that the client needs to download before joining the server.
// All of these behaviour packs will be applied together, and the order does not necessarily matter.
BehaviourPacks []protocol.StackResourcePack
// TexturePacks is a list of texture packs that the client needs to download before joining the server.
// The order of these texture packs specifies the order that they are applied in on the client side. The
// first in the list will be applied first.
TexturePacks []protocol.StackResourcePack
// BaseGameVersion is the vanilla version that the client should set its resource pack stack to.
BaseGameVersion string
// Experiments holds a list of experiments that are either enabled or disabled in the world that the
// player spawns in.
// It is not clear why experiments are sent both here and in the StartGame packet.
Experiments []protocol.ExperimentData
// ExperimentsPreviouslyToggled specifies if any experiments were previously toggled in this world. It is
// probably used for some kind of metrics.
ExperimentsPreviouslyToggled bool
// IncludeEditorPacks specifies if vanilla editor packs should be included in the resource pack stack when
// connecting to an editor world.
IncludeEditorPacks bool
}
// ID ...
func (*ResourcePackStack) ID() uint32 {
return IDResourcePackStack
}
func (pk *ResourcePackStack) Marshal(io protocol.IO) {
io.Bool(&pk.TexturePackRequired)
protocol.Slice(io, &pk.BehaviourPacks)
protocol.Slice(io, &pk.TexturePacks)
io.String(&pk.BaseGameVersion)
protocol.SliceUint32Length(io, &pk.Experiments)
io.Bool(&pk.ExperimentsPreviouslyToggled)
io.Bool(&pk.IncludeEditorPacks)
}