World: Chunk: remove unnecessary level class member

This commit is contained in:
Matthias Schiffer 2021-12-03 23:45:31 +01:00
parent 0f6c467566
commit 16a1258f08
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 2 additions and 6 deletions

View file

@ -18,7 +18,8 @@ namespace MinedMap {
namespace World {
Chunk::Chunk(const ChunkData *data) {
level = assertValue(data->getRoot().get<NBT::CompoundTag>("Level"));
std::shared_ptr<const NBT::CompoundTag> level =
assertValue(data->getRoot().get<NBT::CompoundTag>("Level"));
std::shared_ptr<const NBT::ListTag> sectionsTag = level->get<NBT::ListTag>("Sections");
if (!sectionsTag || sectionsTag->empty())

View file

@ -55,7 +55,6 @@ public:
};
private:
std::shared_ptr<const NBT::CompoundTag> level;
std::vector<std::unique_ptr<Section>> sections;
std::shared_ptr<const NBT::ByteArrayTag> biomeBytes;
@ -80,10 +79,6 @@ private:
public:
Chunk(const ChunkData *data);
const NBT::CompoundTag & getLevel() const {
return *level;
}
uint8_t getBiome(block_idx_t x, y_idx_t y, block_idx_t z) const;
Block getBlock(block_idx_t x, Height y, block_idx_t z) const;