diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-06-21 16:26:25 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-06-21 16:26:25 +0200 |
commit | f5aa7827af55342a1ec714d366944b3e3f3129b2 (patch) | |
tree | 4f4885d2ae0f46004a22e7d4dc34f80c11ecee0c /src/world/World.cpp | |
parent | 2017-06-20 (diff) | |
download | AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.gz AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.bz2 AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.lz AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.xz AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.zst AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.zip |
Diffstat (limited to 'src/world/World.cpp')
-rw-r--r-- | src/world/World.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/world/World.cpp b/src/world/World.cpp index 394598b..abcfebf 100644 --- a/src/world/World.cpp +++ b/src/world/World.cpp @@ -1,4 +1,4 @@ -#include "World.hpp" +#include <world/World.hpp> void World::ParseChunkData(std::shared_ptr<PacketChunkData> packet) { StreamBuffer chunkData(packet->Data.data(), packet->Data.size()); @@ -6,7 +6,7 @@ void World::ParseChunkData(std::shared_ptr<PacketChunkData> packet) { for (int i = 0; i < 16; i++) { if (bitmask[i]) { Vector chunkPosition = Vector(packet->ChunkX, i, packet->ChunkZ); - Section section = ParseSection(&chunkData); + Section section = ParseSection(&chunkData, chunkPosition); auto it = sections.find(chunkPosition); if (it == sections.end()) { sections.insert(std::make_pair(chunkPosition, section)); @@ -19,7 +19,7 @@ void World::ParseChunkData(std::shared_ptr<PacketChunkData> packet) { } } -Section World::ParseSection(StreamInput *data) { +Section World::ParseSection(StreamInput *data, Vector position) { unsigned char bitsPerBlock = data->ReadUByte(); int paletteLength = data->ReadVarInt(); std::vector<unsigned short> palette; @@ -32,7 +32,7 @@ Section World::ParseSection(StreamInput *data) { std::vector<unsigned char> skyLight; if (dimension == 0) skyLight = data->ReadByteArray(4096 / 2); - return Section(dataArray.data(), dataArray.size(), blockLight.data(), + return Section(position, dataArray.data(), dataArray.size(), blockLight.data(), (skyLight.size() > 0 ? skyLight.data() : nullptr), bitsPerBlock, palette); } |