12345678910111213 |
- #include "common/world/World.h"
- void World::setBlock(u32 x, u32 y, u32 z, const Block& block) {
- u32 cx = (x >> Chunk::CHUNK_BIT_SIZE) & BITMASK;
- u32 cz = (z >> Chunk::CHUNK_BIT_SIZE) & BITMASK;
- chunks[cx][cz].setBlock(x, y, z, block);
- }
- const Block& World::getBlock(u32 x, u32 y, u32 z) const {
- u32 cx = (x >> Chunk::CHUNK_BIT_SIZE) & BITMASK;
- u32 cz = (z >> Chunk::CHUNK_BIT_SIZE) & BITMASK;
- return chunks[cx][cz].getBlock(x, y, z);
- }
|