X, Y, Z should be relative to the chunk section (AKA x&0x0f, y&0x0f, z&0x0f)
(x, y, z byte)
| 55 | |
| 56 | // X, Y, Z should be relative to the chunk section (AKA x&0x0f, y&0x0f, z&0x0f) |
| 57 | func (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 | |
| 69 | func (s *Section) blockState(x, y, z byte) int64 { |
| 70 | if len(s.BlockStates.Data) == 0 { |