mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-12 09:59:05 +02:00
Add quirk for stone_slab rename
The old stone_slab block from pre-1.14 has been renamed to smooth_stone_slab, and the name stone_slab was reused for a new block. Resolve the palette entry depending on the chunk's dataVersion.
This commit is contained in:
parent
359ace4932
commit
ae68c3bab4
4 changed files with 24 additions and 9 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
|
||||
#include "Chunk.hpp"
|
||||
#include "../NBT/IntTag.hpp"
|
||||
#include "../NBT/ListTag.hpp"
|
||||
#include "../NBT/StringTag.hpp"
|
||||
|
||||
|
@ -51,9 +52,12 @@ Chunk::Chunk(const ChunkData *data) {
|
|||
else if (biomeInts && biomeInts->getLength() != SIZE*SIZE)
|
||||
throw std::invalid_argument("corrupt biome data");
|
||||
|
||||
auto dataVersionTag = data->getRoot().get<NBT::IntTag>("DataVersion");
|
||||
uint32_t dataVersion = dataVersionTag ? dataVersionTag->getValue() : 0;
|
||||
|
||||
for (auto &sTag : *sectionsTag) {
|
||||
auto s = std::dynamic_pointer_cast<const NBT::CompoundTag>(sTag);
|
||||
std::unique_ptr<Section> section = Section::makeSection(s);
|
||||
std::unique_ptr<Section> section = Section::makeSection(s, dataVersion);
|
||||
size_t Y = section->getY();
|
||||
sections.resize(Y);
|
||||
sections.push_back(std::move(section));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue