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

Method Block

server/world/chunk/section/section.go:57–67  ·  view source on GitHub ↗

X, Y, Z should be relative to the chunk section (AKA x&0x0f, y&0x0f, z&0x0f)

(x, y, z byte)

Source from the content-addressed store, hash-verified

55
56// X, Y, Z should be relative to the chunk section (AKA x&0x0f, y&0x0f, z&0x0f)
57func (s *Section) Block(x, y, z byte) AnvilBlock {
58 if len(s.BlockStates.Data) == 0 {
59 return s.BlockStates.Palette[0]
60 }
61
62 long, off := s.offset(int(x), int(y), int(z))
63 l := s.BlockStates.Data[long]
64 index := (l >> off) & (1<<s.blockBitsPerEntry - 1)
65
66 return s.BlockStates.Palette[index]
67}
68
69func (s *Section) blockState(x, y, z byte) int64 {
70 if len(s.BlockStates.Data) == 0 {

Callers

nothing calls this directly

Calls 1

offsetMethod · 0.95

Tested by

no test coverage detected