diff options
Diffstat (limited to 'src/emerge.cpp')
-rw-r--r-- | src/emerge.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp index 15f264c1a..bb2590641 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -54,6 +54,7 @@ with this program; if not, write to the Free Software Foundation, Inc., struct MapgenDesc { const char *name; MapgenFactory *factory; + bool is_user_visible; }; class EmergeThread : public Thread { @@ -100,10 +101,10 @@ private: //// MapgenDesc g_reg_mapgens[] = { - {"v5", new MapgenFactoryV5}, - {"v6", new MapgenFactoryV6}, - {"v7", new MapgenFactoryV7}, - {"singlenode", new MapgenFactorySinglenode}, + {"v5", new MapgenFactoryV5, true}, + {"v6", new MapgenFactoryV6, true}, + {"v7", new MapgenFactoryV7, true}, + {"singlenode", new MapgenFactorySinglenode, false}, }; //// @@ -343,10 +344,13 @@ bool EmergeManager::isBlockUnderground(v3s16 blockpos) } -void EmergeManager::getMapgenNames(std::vector<const char *> *mgnames) +void EmergeManager::getMapgenNames( + std::vector<const char *> *mgnames, bool include_hidden) { - for (u32 i = 0; i != ARRLEN(g_reg_mapgens); i++) - mgnames->push_back(g_reg_mapgens[i].name); + for (u32 i = 0; i != ARRLEN(g_reg_mapgens); i++) { + if (include_hidden || g_reg_mapgens[i].is_user_visible) + mgnames->push_back(g_reg_mapgens[i].name); + } } |