fix: savanna biome + savanna tree

used compilation to change savanna biome generation and savanna tree teatures using abstractTreeFeature that was missing.
This commit is contained in:
Lord_Cambion
2026-04-26 16:12:20 +02:00
parent 35500de3cc
commit 41d4334e80
6 changed files with 230 additions and 122 deletions
+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include "Feature.h"
#include "Level.h"
#include "Tile.h"
class AbstractTreeFeature : public Feature
{
public:
AbstractTreeFeature(bool doUpdate) : Feature(doUpdate) {}
virtual ~AbstractTreeFeature() {}
static bool isFree(Level* level, int x, int y, int z)
{
int tile = level->getTile(x, y, z);
return tile == 0
|| tile == Tile::leaves_Id
|| tile == Tile::leaves2_Id
|| tile == Tile::treeTrunk_Id
|| tile == Tile::tree2Trunk_Id
|| tile == Tile::vine_Id
|| tile == Tile::tallgrass_Id
|| tile == Tile::flower_Id;
}
void setDirtAt(Level* level, int x, int y, int z)
{
if (level->getTile(x, y, z) != Tile::dirt_Id)
{
placeBlock(level, x, y, z, Tile::dirt_Id, 0);
}
}
virtual void postPlaceTree() {}
};