убираем костыли в сериализации чанков
This commit is contained in:
@@ -151,14 +151,15 @@ public class ChunkDataPacket implements SCPacket {
|
||||
|
||||
for (int y = 0; y < 16; y++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
for (int x = 15; x >= 0; x--) {
|
||||
palettedChunkSection.addBlock(chunkSection.getBlockLocal(x, y, z));
|
||||
palettedChunkSection.addBlockLight(15-x, y, z, chunkSection.getBlockLocal(15-x, y, z).getLight());
|
||||
palettedChunkSection.addSkyLight(15-x, y, z, chunkSection.getSkyLightLocal(15-x, y, z));
|
||||
for (int x = 0; x < 16; x++) {
|
||||
palettedChunkSection.addBlock(
|
||||
chunkSection.getBlockLocal(x, y, z),
|
||||
chunkSection.getSkyLightLocal(x, y, z)
|
||||
);
|
||||
|
||||
if (biomeWrite) {
|
||||
biomes.writeByte(chunkSection.getBiomeLocal(x, z).getId());
|
||||
if (x == 0 && z == 15) {
|
||||
if (x == 15 && z == 15) {
|
||||
biomeWrite = false;
|
||||
}
|
||||
}
|
||||
@@ -219,17 +220,11 @@ public class ChunkDataPacket implements SCPacket {
|
||||
return (byte) idx;
|
||||
}
|
||||
|
||||
void addBlockLight(int x, int y, int z, int value) {
|
||||
blockLight.set(x, y, z, value);
|
||||
}
|
||||
|
||||
void addSkyLight(int x, int y, int z, int value) {
|
||||
skyLight.set(x, y, z, value);
|
||||
}
|
||||
|
||||
void addBlock(Block block) {
|
||||
void addBlock(Block block, int skyLight) {
|
||||
BlockLocation location = block.getLocation().toLocal();
|
||||
blocks[coordsToIndex(location)] = addBlockType(block.getBlockType());
|
||||
blockLight.set(location, block.getLight());
|
||||
this.skyLight.set(location, skyLight);
|
||||
}
|
||||
|
||||
void writeToNetStream(final NetOutputStream netOutputStream) {
|
||||
|
||||
Reference in New Issue
Block a user