improve chunk section palette handling for blocks
This commit is contained in:
@@ -44,11 +44,17 @@ func (c Chunk) ToStorage(version string) (toChunk *level.Chunk, err error) {
|
||||
}
|
||||
toChunk.Sections[i].BlockCount = int16(level.BlocksPerChunkSection - level.CountStorage(toChunk.Sections[i].Blocks, 0))
|
||||
} else {
|
||||
toChunk.Sections[i].Blocks, err = f.FullWith(0) //TODO PALLETE index 0 if avial
|
||||
var fillerId = int32(0)
|
||||
if len(pallete) == 1 {
|
||||
fillerId = pallete[0]
|
||||
if fillerId != 0 {
|
||||
toChunk.Sections[i].BlockCount = level.BlocksPerChunkSection
|
||||
}
|
||||
}
|
||||
toChunk.Sections[i].Blocks, err = f.FullWith(fillerId)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
toChunk.Sections[i].BlockCount = 0
|
||||
}
|
||||
}
|
||||
f = level.MakeBiomeFormat(version)
|
||||
@@ -78,7 +84,7 @@ func (c Chunk) ToStorage(version string) (toChunk *level.Chunk, err error) {
|
||||
if len(pallete) == 1 {
|
||||
fillerId = pallete[0]
|
||||
}
|
||||
toChunk.Sections[i].Biomes, err = f.FullWith(fillerId) //TODO PALLETE index 0 if avial
|
||||
toChunk.Sections[i].Biomes, err = f.FullWith(fillerId)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -113,9 +113,9 @@ func Limbo(c *proto.Conn) (err error) {
|
||||
}
|
||||
err = s.Send(&v1_21_8.PlayToClientPacketPosition{
|
||||
TeleportId: 0,
|
||||
X: 0,
|
||||
X: 0.5,
|
||||
Y: 100,
|
||||
Z: 0,
|
||||
Z: 0.5,
|
||||
Dx: 0,
|
||||
Dy: 0,
|
||||
Dz: 0,
|
||||
|
||||
Reference in New Issue
Block a user