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

Method ViewDistance

server/player/player.go:84–91  ·  view source on GitHub ↗

* ViewDistance returns the view distance of the client, in chunks, or the server's render distance if the client's view distance is bigger or not set */

()

Source from the content-addressed store, hash-verified

82ViewDistance returns the view distance of the client, in chunks, or the server's render distance if the client's view distance is bigger or not set
83*/
84func (p *Player) ViewDistance() int32 {
85 plVd := int32(p.ClientInformation.Load().ViewDistance)
86 if plVd == 0 || plVd > p.serverProperties.ViewDistance {
87 return p.serverProperties.ViewDistance
88 }
89
90 return plVd
91}
92
93// writeOrKill tries to write the packet to the player and kills the connection on failure
94func (p *Player) writeOrKill(pk packet.Encodeable) {

Callers 1

sendSpawnChunksMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected