mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add Ore infrastructure and l_register_ore()
This commit is contained in:
parent
f70378f7f5
commit
57cbb8bfd8
10 changed files with 248 additions and 17 deletions
43
src/mapgen.h
43
src/mapgen.h
|
@ -97,5 +97,48 @@ struct MapgenFactory {
|
|||
virtual MapgenParams *createMapgenParams() = 0;
|
||||
};
|
||||
|
||||
enum OreType {
|
||||
ORE_SCATTER,
|
||||
ORE_SHEET,
|
||||
ORE_CLAYLIKE
|
||||
};
|
||||
|
||||
class Ore {
|
||||
public:
|
||||
std::string ore_name;
|
||||
std::string wherein_name;
|
||||
|
||||
content_t ore;
|
||||
content_t wherein; // the node to be replaced
|
||||
s16 clust_scarcity; //
|
||||
s16 clust_num_ores; // how many ore nodes are in a chunk
|
||||
s16 clust_size; // how large (in nodes) a chunk of ore is
|
||||
s16 height_min;
|
||||
s16 height_max;
|
||||
float nthresh; // threshhold for noise at which an ore is placed
|
||||
NoiseParams *np; // noise for distribution of clusters (NULL for uniform scattering)
|
||||
Noise *noise;
|
||||
|
||||
Ore() {
|
||||
ore = CONTENT_IGNORE;
|
||||
wherein = CONTENT_IGNORE;
|
||||
np = NULL;
|
||||
noise = NULL;
|
||||
}
|
||||
|
||||
void resolveNodeNames(INodeDefManager *ndef);
|
||||
virtual void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) = 0;
|
||||
};
|
||||
|
||||
class OreScatter : public Ore {
|
||||
void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
||||
};
|
||||
|
||||
class OreSheet : public Ore {
|
||||
void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
||||
};
|
||||
|
||||
Ore *createOre(OreType type);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue