mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-05-22 04:46:07 +00:00
used compilation to change savanna biome generation and savanna tree teatures using abstractTreeFeature that was missing.
33 lines
885 B
C++
33 lines
885 B
C++
#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() {}
|
|
}; |