mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-03 06:09:07 +02:00
Add support for Minecraft 1.13 sections
This commit is contained in:
parent
210f651807
commit
b6f14f0c72
2 changed files with 80 additions and 0 deletions
|
@ -29,6 +29,8 @@
|
|||
|
||||
#include "../NBT/ByteArrayTag.hpp"
|
||||
#include "../NBT/CompoundTag.hpp"
|
||||
#include "../NBT/ListTag.hpp"
|
||||
#include "../NBT/LongArrayTag.hpp"
|
||||
#include "../Resource/BlockType.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
@ -106,5 +108,27 @@ public:
|
|||
virtual const Resource::BlockType * getBlockStateAt(size_t x, size_t y, size_t z) const;
|
||||
};
|
||||
|
||||
class PaletteSection : public Section {
|
||||
private:
|
||||
std::shared_ptr<const NBT::LongArrayTag> blockStates;
|
||||
std::vector<const Resource::BlockType *> palette;
|
||||
size_t bits;
|
||||
uint16_t mask;
|
||||
|
||||
|
||||
static size_t mangleByteIndex(size_t index) {
|
||||
return (index & ~(size_t)7) + 7 - (index & 7);
|
||||
}
|
||||
|
||||
public:
|
||||
PaletteSection(
|
||||
const std::shared_ptr<const NBT::CompoundTag> §ion,
|
||||
std::shared_ptr<const NBT::LongArrayTag> &&blockStates0,
|
||||
const std::shared_ptr<const NBT::ListTag> &paletteData
|
||||
);
|
||||
|
||||
virtual const Resource::BlockType * getBlockStateAt(size_t x, size_t y, size_t z) const;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue