MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / Encode

Method Encode

protocol/net/packet/play/entitySoundEffect.go:26–56  ·  view source on GitHub ↗
(w encoding.Writer)

Source from the content-addressed store, hash-verified

24}
25
26func (s *EntitySoundEffect) Encode(w encoding.Writer) error {
27 if err := w.VarInt(s.SoundId + 1); err != nil {
28 return err
29 }
30 if s.SoundId == -1 {
31 if err := w.Identifier(s.SoundName); err != nil {
32 return err
33 }
34 if err := w.Bool(s.FixedRange); err != nil {
35 return err
36 }
37 if s.FixedRange {
38 if err := w.Float(s.Range); err != nil {
39 return err
40 }
41 }
42 }
43 if err := w.VarInt(s.SoundCategory); err != nil {
44 return err
45 }
46 if err := w.VarInt(s.EntityId); err != nil {
47 return err
48 }
49 if err := w.Float(s.Volume); err != nil {
50 return err
51 }
52 if err := w.Float(s.Pitch); err != nil {
53 return err
54 }
55 return w.Long(s.Seed)
56}
57
58func (s *EntitySoundEffect) Decode(r encoding.Reader) error {
59 return nil //TODO

Callers

nothing calls this directly

Calls 5

VarIntMethod · 0.45
IdentifierMethod · 0.45
BoolMethod · 0.45
FloatMethod · 0.45
LongMethod · 0.45

Tested by

no test coverage detected