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

Method Encode

protocol/net/packet/play/commands.go:54–64  ·  view source on GitHub ↗
(w encoding.Writer)

Source from the content-addressed store, hash-verified

52}
53
54func (c *Commands) Encode(w encoding.Writer) error {
55 if err := w.VarInt(int32(len(c.Nodes))); err != nil {
56 return err
57 }
58 for _, node := range c.Nodes {
59 if err := c.encodeNode(w, node); err != nil {
60 return err
61 }
62 }
63 return w.VarInt(c.RootIndex)
64}
65
66func (c *Commands) encodeNode(w encoding.Writer, node Node) error {
67 if err := w.Byte(node.Flags); err != nil {

Callers

nothing calls this directly

Calls 2

encodeNodeMethod · 0.95
VarIntMethod · 0.45

Tested by

no test coverage detected