mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-29 20:25:19 +01:00
Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system.
- MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap,
instead of the EmergeManager.
- New Script API functions added:
core.get_mapgen_setting
core.get_mapgen_setting_noiseparams,
core.set_mapgen_setting, and
core.set_mapgen_setting_noiseparams.
- minetest.get/set_mapgen_params are deprecated by the above new functions.
- It is now possible to view and modify any arbitrary mapgen setting from a mod,
rather than the base MapgenParams structure.
- MapgenSpecificParams has been removed.
This commit is contained in:
10
src/map.h
10
src/map.h
@@ -33,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "modifiedstate.h"
|
||||
#include "util/container.h"
|
||||
#include "nodetimer.h"
|
||||
#include "map_settings_manager.h"
|
||||
|
||||
class Settings;
|
||||
class Database;
|
||||
@@ -46,8 +47,6 @@ class IRollbackManager;
|
||||
class EmergeManager;
|
||||
class ServerEnvironment;
|
||||
struct BlockMakeData;
|
||||
struct MapgenParams;
|
||||
|
||||
|
||||
/*
|
||||
MapEditEvent
|
||||
@@ -463,9 +462,8 @@ public:
|
||||
void save(ModifiedState save_level);
|
||||
void listAllLoadableBlocks(std::vector<v3s16> &dst);
|
||||
void listAllLoadedBlocks(std::vector<v3s16> &dst);
|
||||
// Saves map seed and possibly other stuff
|
||||
void saveMapMeta();
|
||||
void loadMapMeta();
|
||||
|
||||
MapgenParams *getMapgenParams();
|
||||
|
||||
/*void saveChunkMeta();
|
||||
void loadChunkMeta();*/
|
||||
@@ -506,6 +504,8 @@ public:
|
||||
u64 getSeed();
|
||||
s16 getWaterLevel();
|
||||
|
||||
MapSettingsManager settings_mgr;
|
||||
|
||||
private:
|
||||
// Emerge manager
|
||||
EmergeManager *m_emerge;
|
||||
|
||||
Reference in New Issue
Block a user