summaryrefslogtreecommitdiffstats
path: root/src/World/Section.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World/Section.hpp')
-rw-r--r--src/World/Section.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/World/Section.hpp b/src/World/Section.hpp
index a4686e3..3444bce 100644
--- a/src/World/Section.hpp
+++ b/src/World/Section.hpp
@@ -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> &section,
+ 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;
+};
+
}
}