From 74e17d4c8375e6822b8b508abf94d200f763bb7c Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Sun, 11 Nov 2018 02:55:56 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D0=BC=20?= =?UTF-8?q?=D0=BA=D0=BE=D1=81=D1=82=D1=8B=D0=BB=D0=B8=20=D0=B2=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D1=87=D0=B0=D0=BD=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proto_1_12_2/packets/ChunkDataPacket.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/packets/ChunkDataPacket.java b/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/packets/ChunkDataPacket.java index 5d74739..cb19e6d 100644 --- a/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/packets/ChunkDataPacket.java +++ b/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/packets/ChunkDataPacket.java @@ -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) {