Added slabs

This commit is contained in:
2022-10-12 08:24:00 +08:00
parent 5f66b792c7
commit e4fc6f4d96
6 changed files with 230 additions and 5 deletions

View File

@@ -17,7 +17,8 @@ const (
type Chunk struct {
X, Z int // Chunk coordinate in global coordinate (y is always zero)
Id, Aux [ChunkSizeX][ChunkSizeY][ChunkSizeZ]uint16
Id [ChunkSizeX][ChunkSizeY][ChunkSizeZ]uint16
Aux [ChunkSizeX][ChunkSizeY][ChunkSizeZ]int16
// render data kept unexported (therefore excluded from gob encoding)
renderChanged bool
@@ -40,7 +41,7 @@ func (c *Chunk) SetChunkID(x, z int) {
func (c *Chunk) SetBlock(x, y, z int, id, aux int) {
c.Id[x][y][z] = uint16(id)
c.Aux[x][y][z] = uint16(aux)
c.Aux[x][y][z] = int16(aux)
c.renderChanged = true
switch x {