Archived
0

добавлена возможность указывать произвольные слои блоков

This commit is contained in:
2018-08-16 14:28:35 +03:00
parent 39d7872d6a
commit d7c0a7078f
4 changed files with 56 additions and 10 deletions

View File

@@ -102,6 +102,7 @@ public class ChunkDataPacket implements SCPacket {
netStream.writeInt(z); // Chunk Y
netStream.writeBoolean(initChunk); // Init Chunk
int maxH = 0;
if (sectionList == null && chunk != null) {
int bitMask = 0;
for (int h = 15; h >= 0; h--) {
@@ -109,6 +110,7 @@ public class ChunkDataPacket implements SCPacket {
ChunkSection chunkSection = chunk.getChunkSection(h);
if (chunkSection != null && chunkSection.getY() == h) {
bitMask |= 0x01;
maxH++;
} else {
bitMask |= 0x00;
}
@@ -123,6 +125,7 @@ public class ChunkDataPacket implements SCPacket {
ChunkSection chunkSection = sectionList.get(i);
if (chunkSection != null && chunkSection.getY() == h) {
bitMask |= 0x01;
maxH++;
} else {
bitMask |= 0x00;
}
@@ -138,7 +141,7 @@ public class ChunkDataPacket implements SCPacket {
int dataItems = 0;
final int airBlockPalette = serializeBlockState(BlockType.AIR);
for (int h = 0; h < 16; h++) {
for (int h = 0; h < maxH; h++) {
ChunkSection chunkSection = null;
if (chunk != null) {