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

Method SkyLightLevel

server/world/chunk/section/section.go:145–161  ·  view source on GitHub ↗
(x, y, z int)

Source from the content-addressed store, hash-verified

143}
144
145func (s *Section) SkyLightLevel(x, y, z int) (byte, error) {
146 index := (y << 8) | (z << 4) | x
147 if index < 0 || int(index) > len(s.SkyLight) {
148 return 0, fmt.Errorf("light index exceeds light length")
149 }
150
151 var mask uint8 = 0x0f
152 var shift uint8 = 0
153 if math.Remainder(float64(index), 2) != 0 {
154 mask = 0xf0
155 shift = 4
156 }
157
158 index /= 2
159
160 return (uint8(s.SkyLight[index]) & mask) >> shift, nil
161}
162
163func (s *Section) SetSkylightLevel(x, y, z int, level byte) error {
164 if level > 0x0F {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected