rewrite chunk data decoder

This commit is contained in:
Tnze
2020-05-17 13:35:52 +08:00
parent ab9db15d0b
commit eba832b424
4 changed files with 89 additions and 159 deletions

View File

@ -10,19 +10,14 @@ type World struct {
Chunks map[ChunkLoc]*Chunk
}
//Chunk store a 256*16*16 clolumn blocks
//Chunk store a 256*16*16 column blocks
type Chunk struct {
sections [16]Section
}
//Section store a 16*16*16 cube blocks
type Section struct {
blocks [16][16][16]Block
}
//Block is the base of world
type Block struct {
id uint
type Section interface {
GetBlock(x, y, z int) (blockID uint32)
}
type ChunkLoc struct {