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

Method WriteStringRestricted

utils.go:282–293  ·  view source on GitHub ↗
(s string, max int)

Source from the content-addressed store, hash-verified

280}
281
282func (player *Player) WriteStringRestricted(s string, max int) (err error) {
283 buff := []byte(s)
284 if len(buff) > max {
285 buff = buff[:max]
286 }
287 err = player.WriteVarInt(len(buff))
288 if err != nil {
289 return err
290 }
291 _, err = player.io.wtr.Write(buff)
292 return err
293}
294
295func (player *Player) WriteUUID(uid uuid.UUID) (err error) {
296 _, err = player.io.wtr.Write(uid[:])

Callers

nothing calls this directly

Calls 2

WriteVarIntMethod · 0.95
WriteMethod · 0.65

Tested by

no test coverage detected