From b88595050f3af5ccac06aac331ead4ebdcb9deb9 Mon Sep 17 00:00:00 2001 From: paramat Date: Sun, 11 Sep 2016 23:34:43 +0100 Subject: Decorations: Generalise 'spawn by' to be used by all decoration types In lua_api.txt, make clear that 'place on' and 'spawn by' can be lists. --- src/mg_decoration.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/mg_decoration.h') diff --git a/src/mg_decoration.h b/src/mg_decoration.h index da98fd482..be0ba44d7 100644 --- a/src/mg_decoration.h +++ b/src/mg_decoration.h @@ -68,6 +68,7 @@ public: virtual void resolveNodeNames(); + bool canPlaceDecoration(MMVManip *vm, v3s16 p); size_t placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); //size_t placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); @@ -82,6 +83,8 @@ public: s16 y_max; float fill_ratio; NoiseParams np; + std::vector c_spawnby; + s16 nspawnby; UNORDERED_SET biomes; //std::list cutoffs; @@ -90,17 +93,13 @@ public: class DecoSimple : public Decoration { public: + virtual void resolveNodeNames(); virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p); - bool canPlaceDecoration(MMVManip *vm, v3s16 p); virtual int getHeight(); - virtual void resolveNodeNames(); - std::vector c_decos; - std::vector c_spawnby; s16 deco_height; s16 deco_height_max; - s16 nspawnby; }; class DecoSchematic : public Decoration { -- cgit v1.2.3