mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-12 09:59:05 +02:00
World: Section: implement new section-based biome data format
This commit is contained in:
parent
76e5d322b1
commit
baa20494bf
4 changed files with 113 additions and 8 deletions
|
@ -79,6 +79,14 @@ uint8_t Chunk::getBiome(block_idx_t x, y_idx_t y, block_idx_t z) const {
|
|||
return biomeInts->getValue(z*SIZE + x);
|
||||
case BYTE_ARRAY:
|
||||
return biomeBytes->getValue(z*SIZE + x);
|
||||
case SECTION: {
|
||||
section_idx_t Y = (y >> HSHIFT) - sectionOffset;
|
||||
|
||||
if (Y < 0 || size_t(Y) >= sections.size() || !sections[Y])
|
||||
break;
|
||||
|
||||
return sections[Y]->getBiomeAt(x, y & HMASK, z);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue