aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mg_ore.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-07-18 13:53:15 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-07-18 13:53:15 +0200
commitffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f (patch)
treecc7d9f74a43215c5d8e3965a2bfc2aea5867a7a0 /src/mapgen/mg_ore.h
parent45aa2516b2fc675df7049bc9ed713600c95b6423 (diff)
parent82731d0d3d8bfe9e56f89466991f13c037f3a61e (diff)
downloaddragonfireclient-ffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f.tar.xz
Update to minetest 5.4.0-dev
Diffstat (limited to 'src/mapgen/mg_ore.h')
-rw-r--r--src/mapgen/mg_ore.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/mapgen/mg_ore.h b/src/mapgen/mg_ore.h
index d89360c3c..76420fab4 100644
--- a/src/mapgen/mg_ore.h
+++ b/src/mapgen/mg_ore.h
@@ -1,7 +1,7 @@
/*
Minetest
-Copyright (C) 2014-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
-Copyright (C) 2015-2018 paramat
+Copyright (C) 2015-2020 paramat
+Copyright (C) 2014-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "noise.h"
#include "nodedef.h"
+typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include
+
class Noise;
class Mapgen;
class MMVManip;
@@ -64,7 +66,7 @@ public:
float nthresh; // threshold for noise at which an ore is placed
NoiseParams np; // noise for distribution of clusters (NULL for uniform scattering)
Noise *noise = nullptr;
- std::unordered_set<u8> biomes;
+ std::unordered_set<biome_t> biomes;
Ore() = default;;
virtual ~Ore();
@@ -73,33 +75,42 @@ public:
size_t placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap) = 0;
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap) = 0;
+
+protected:
+ void cloneTo(Ore *def) const;
};
class OreScatter : public Ore {
public:
static const bool NEEDS_NOISE = false;
+ ObjDef *clone() const;
+
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreSheet : public Ore {
public:
static const bool NEEDS_NOISE = true;
+ ObjDef *clone() const;
+
u16 column_height_min;
u16 column_height_max;
float column_midpoint_factor;
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OrePuff : public Ore {
public:
static const bool NEEDS_NOISE = true;
+ ObjDef *clone() const;
+
NoiseParams np_puff_top;
NoiseParams np_puff_bottom;
Noise *noise_puff_top = nullptr;
@@ -109,21 +120,25 @@ public:
virtual ~OrePuff();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreBlob : public Ore {
public:
static const bool NEEDS_NOISE = true;
+ ObjDef *clone() const;
+
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreVein : public Ore {
public:
static const bool NEEDS_NOISE = true;
+ ObjDef *clone() const;
+
float random_factor;
Noise *noise2 = nullptr;
int sizey_prev = 0;
@@ -132,13 +147,15 @@ public:
virtual ~OreVein();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreStratum : public Ore {
public:
static const bool NEEDS_NOISE = false;
+ ObjDef *clone() const;
+
NoiseParams np_stratum_thickness;
Noise *noise_stratum_thickness = nullptr;
u16 stratum_thickness;
@@ -147,7 +164,7 @@ public:
virtual ~OreStratum();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreManager : public ObjDefManager {
@@ -155,6 +172,8 @@ public:
OreManager(IGameDef *gamedef);
virtual ~OreManager() = default;
+ OreManager *clone() const;
+
const char *getObjectTitle() const
{
return "ore";
@@ -183,4 +202,7 @@ public:
void clear();
size_t placeAllOres(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
+
+private:
+ OreManager() {};
};