-
Notifications
You must be signed in to change notification settings - Fork 6
/
stop_sound.go
33 lines (28 loc) · 852 Bytes
/
stop_sound.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 (
"dotcs/minecraft/protocol"
)
// StopSound is sent by the server to stop a sound playing to the player, such as a playing music disk track
// or other long-lasting sounds.
type StopSound struct {
// SoundName is the name of the sound that should be stopped from playing. If no sound with this name is
// currently active, the packet is ignored.
SoundName string
// StopAll specifies if all sounds currently playing to the player should be stopped. If set to true, the
// SoundName field may be left empty.
StopAll bool
}
// ID ...
func (*StopSound) ID() uint32 {
return IDStopSound
}
// Marshal ...
func (pk *StopSound) Marshal(w *protocol.Writer) {
w.String(&pk.SoundName)
w.Bool(&pk.StopAll)
}
// Unmarshal ...
func (pk *StopSound) Unmarshal(r *protocol.Reader) {
r.String(&pk.SoundName)
r.Bool(&pk.StopAll)
}