1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00: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:
kwolekr 2016-06-24 18:15:56 -04:00
parent 92705306bf
commit 3c63c3044d
31 changed files with 890 additions and 315 deletions

View file

@ -97,8 +97,16 @@ public:
u32 gen_notify_on;
std::set<u32> gen_notify_on_deco_ids;
// Map generation parameters
MapgenParams params;
// Parameters passed to mapgens owned by ServerMap
// TODO(hmmmm): Remove this after mapgen helper methods using them
// are moved to ServerMap
MapgenParams *mgparams;
// Hackish workaround:
// For now, EmergeManager must hold onto a ptr to the Map's setting manager
// since the Map can only be accessed through the Environment, and the
// Environment is not created until after script initialization.
MapSettingsManager *map_settings_mgr;
// Managers of various map generation-related components
BiomeManager *biomemgr;
@ -110,8 +118,7 @@ public:
EmergeManager(IGameDef *gamedef);
~EmergeManager();
void loadMapgenParams();
void initMapgens();
bool initMapgens(MapgenParams *mgparams);
void startThreads();
void stopThreads();