(x, y, z byte)
| 67 | } |
| 68 | |
| 69 | func (s *Section) blockState(x, y, z byte) int64 { |
| 70 | if len(s.BlockStates.Data) == 0 { |
| 71 | return 0 |
| 72 | } |
| 73 | |
| 74 | long, off := s.offset(int(x), int(y), int(z)) |
| 75 | l := s.BlockStates.Data[long] |
| 76 | index := (l >> off) & (1<<s.blockBitsPerEntry - 1) |
| 77 | |
| 78 | return index |
| 79 | } |
| 80 | |
| 81 | // Sets the block at the position to the index in the palette. Errors if the state is bigger than the length of the palette or negative |
| 82 | // X, Y, Z should be relative to the chunk section (AKA x&0x0f, y&0x0f, z&0x0f) |