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

Method writeProperties

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

Source from the content-addressed store, hash-verified

149 return CommandSuggestionNone
150}
151func (c *CommandParserFloat) writeProperties(player *Player) (err error) {
152 flags := uint8(0)
153 if c.Min.Used {
154 flags |= 0x01
155 }
156 if c.Max.Used {
157 flags |= 0x02
158 }
159 err = player.WriteUInt8(flags)
160 if err != nil {
161 log.Print(err)
162 return
163 }
164 if c.Min.Used {
165 err = player.WriteFloat32(c.Min.Value)
166 if err != nil {
167 log.Print(err)
168 return
169 }
170 }
171 if c.Max.Used {
172 err = player.WriteFloat32(c.Max.Value)
173 if err != nil {
174 log.Print(err)
175 return
176 }
177 }
178 return
179}
180
181type CommandParserInteger struct {
182 Min OptInteger

Callers

nothing calls this directly

Calls 2

WriteUInt8Method · 0.80
WriteFloat32Method · 0.80

Tested by

no test coverage detected