diff options
| author | Mel <einebeere@gmail.com> | 2023-08-14 03:40:10 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-08-14 03:40:10 +0200 |
| commit | 7562a79fa214245544cb379423314c3a0766a7f2 (patch) | |
| tree | 0aaafd06c6026fabc82dbc3454487d009c9043e7 /src/World/Generation/Decoration.cpp | |
| parent | 5a1b126f1f6d55226c2b5068d0c17c428fd29ba8 (diff) | |
| download | meowcraft-7562a79fa214245544cb379423314c3a0766a7f2.tar.zst meowcraft-7562a79fa214245544cb379423314c3a0766a7f2.zip | |
Generate AABBs for terrain that collides with Player
Diffstat (limited to 'src/World/Generation/Decoration.cpp')
| -rw-r--r-- | src/World/Generation/Decoration.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/World/Generation/Decoration.cpp b/src/World/Generation/Decoration.cpp index 556b5e7..0623c05 100644 --- a/src/World/Generation/Decoration.cpp +++ b/src/World/Generation/Decoration.cpp @@ -4,11 +4,11 @@ namespace MC::World::Generation { void Decorator::put_block(Chunk& chunk, Pos pos, BlockType block) { - if (!Chunk::is_valid_position(pos.x(), pos.y(), pos.z())) { + if (!Chunk::is_valid_position(pos)) { return; } - auto& place = chunk.at(pos.x(), pos.y(), pos.z()); + auto& place = chunk.at(pos); if (place.empty()) { place = {block}; } @@ -88,7 +88,7 @@ void TreeDecorator::draw_tree(Chunk& chunk, Pos pos) const { } } -Bool TreeDecorator::is_valid_position(Vector<3, UInt> pos) { +Bool TreeDecorator::is_valid_position(Pos pos) { Int tree_radius = s_tree_radius; return (Int)pos.x() - tree_radius >= 0 && pos.x() + tree_radius <= Chunk::Width |
