mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-12 09:59:05 +02:00
Use biome data
This commit is contained in:
parent
143b9f6c78
commit
9b1d92387d
5 changed files with 20 additions and 4 deletions
|
@ -105,6 +105,13 @@ void Chunk::analyzeChunk() {
|
|||
sections = assertValue(level->get<NBT::ListTag<NBT::CompoundTag>>("Sections"));
|
||||
maxY = (assertValue(sections->back()->get<NBT::ByteTag>("Y"))->getValue() + 1) * SIZE;
|
||||
|
||||
|
||||
std::shared_ptr<const NBT::ByteArrayTag> biomeTag = assertValue(level->get<NBT::ByteArrayTag>("Biomes"));
|
||||
if (biomeTag->getLength() != SIZE*SIZE)
|
||||
throw std::invalid_argument("corrupt biome data");
|
||||
|
||||
biomes = biomeTag->getValue();
|
||||
|
||||
blockIDs.reset(new uint8_t[maxY * SIZE * SIZE]);
|
||||
blockData.reset(new uint8_t[maxY * SIZE * SIZE / 2]);
|
||||
blockSkyLight.reset(new uint8_t[maxY * SIZE * SIZE / 2]);
|
||||
|
@ -170,6 +177,8 @@ Chunk::Blocks Chunk::getTopLayer() const {
|
|||
|
||||
b.height = h;
|
||||
|
||||
b.biome = getBiomeAt(x, z);
|
||||
|
||||
done++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue