MCPcopy Create free account
hub / github.com/TyphoonMC/TyphoonCore / writeProperties

Method writeProperties

command_parser.go:88–116  ·  view source on GitHub ↗
(player *Player)

Source from the content-addressed store, hash-verified

86 return CommandSuggestionNone
87}
88func (c *CommandParserDouble) writeProperties(player *Player) (err error) {
89 flags := uint8(0)
90 if c.Min.Used {
91 flags |= 0x01
92 }
93 if c.Max.Used {
94 flags |= 0x02
95 }
96 err = player.WriteUInt8(flags)
97 if err != nil {
98 log.Print(err)
99 return
100 }
101 if c.Min.Used {
102 err = player.WriteFloat64(c.Min.Value)
103 if err != nil {
104 log.Print(err)
105 return
106 }
107 }
108 if c.Max.Used {
109 err = player.WriteFloat64(c.Max.Value)
110 if err != nil {
111 log.Print(err)
112 return
113 }
114 }
115 return
116}
117
118type CommandParserFloat struct {
119 Min OptFloat

Callers

nothing calls this directly

Calls 2

WriteUInt8Method · 0.80
WriteFloat64Method · 0.80

Tested by

no test coverage detected