convert between save.Chunk and level.Chunk
This commit is contained in:
@ -9,8 +9,8 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Column is 16* chunk
|
||||
type Column struct {
|
||||
// Chunk is 16* chunk
|
||||
type Chunk struct {
|
||||
DataVersion int32
|
||||
XPos int32 `nbt:"xPos"`
|
||||
YPos int32 `nbt:"yPos"`
|
||||
@ -23,19 +23,21 @@ type Column struct {
|
||||
OceanFloor []int64 `nbt:"OCEAN_FLOOR"`
|
||||
WorldSurface []int64 `nbt:"WORLD_SURFACE"`
|
||||
}
|
||||
Sections []struct {
|
||||
Y byte
|
||||
BlockStates struct {
|
||||
Palette []BlockState `nbt:"palette"`
|
||||
Data []int64 `nbt:"data"`
|
||||
} `nbt:"block_states"`
|
||||
Biomes struct {
|
||||
Palette []string `nbt:"palette"`
|
||||
Data []int64 `nbt:"data"`
|
||||
} `nbt:"biomes"`
|
||||
SkyLight []byte
|
||||
BlockLight []byte
|
||||
} `nbt:"sections"`
|
||||
Sections []Section `nbt:"sections"`
|
||||
}
|
||||
|
||||
type Section struct {
|
||||
Y byte
|
||||
BlockStates struct {
|
||||
Palette []BlockState `nbt:"palette"`
|
||||
Data []int64 `nbt:"data"`
|
||||
} `nbt:"block_states"`
|
||||
Biomes struct {
|
||||
Palette []string `nbt:"palette"`
|
||||
Data []int64 `nbt:"data"`
|
||||
} `nbt:"biomes"`
|
||||
SkyLight []byte
|
||||
BlockLight []byte
|
||||
}
|
||||
|
||||
type BlockState struct {
|
||||
@ -44,7 +46,7 @@ type BlockState struct {
|
||||
}
|
||||
|
||||
// Load read column data from []byte
|
||||
func (c *Column) Load(data []byte) (err error) {
|
||||
func (c *Chunk) Load(data []byte) (err error) {
|
||||
var r io.Reader = bytes.NewReader(data[1:])
|
||||
|
||||
switch data[0] {
|
||||
|
Reference in New Issue
Block a user