recive Chunk data

This commit is contained in:
JunDao
2019-05-19 21:27:07 +08:00
parent 845b7949dd
commit bb7fffbce6
7 changed files with 187 additions and 159 deletions

View File

@ -1,29 +1,33 @@
package world
// //World record all of the things in the world where player at
// type world struct {
// Entities map[int32]Entity
// chunks map[chunkLoc]*Chunk
// }
import (
"github.com/Tnze/go-mc/bot/world/entity"
)
// //Chunk store a 256*16*16 clolumn blocks
// type Chunk struct {
// sections [16]Section
// }
//World record all of the things in the world where player at
type World struct {
Entities map[int32]entity.Entity
Chunks map[ChunkLoc]*Chunk
}
// //Section store a 16*16*16 cube blocks
// type Section struct {
// blocks [16][16][16]Block
// }
//Chunk store a 256*16*16 clolumn blocks
type Chunk struct {
sections [16]Section
}
// //Block is the base of world
// type Block struct {
// id uint
// }
//Section store a 16*16*16 cube blocks
type Section struct {
blocks [16][16][16]Block
}
// type chunkLoc struct {
// X, Y int
// }
//Block is the base of world
type Block struct {
id uint
}
type ChunkLoc struct {
X, Z int
}
// //Entity 表示一个实体
// type Entity interface {