mirror of
https://github.com/luanti-org/luanti.git
synced 2026-01-12 12:15:26 +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:
@@ -49,26 +49,24 @@ FlagDesc flagdesc_mapgen_flat[] = {
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
MapgenFlat::MapgenFlat(int mapgenid, MapgenParams *params, EmergeManager *emerge)
|
||||
MapgenFlat::MapgenFlat(int mapgenid, MapgenFlatParams *params, EmergeManager *emerge)
|
||||
: MapgenBasic(mapgenid, params, emerge)
|
||||
{
|
||||
MapgenFlatParams *sp = (MapgenFlatParams *)params->sparams;
|
||||
|
||||
this->spflags = sp->spflags;
|
||||
this->ground_level = sp->ground_level;
|
||||
this->large_cave_depth = sp->large_cave_depth;
|
||||
this->cave_width = sp->cave_width;
|
||||
this->lake_threshold = sp->lake_threshold;
|
||||
this->lake_steepness = sp->lake_steepness;
|
||||
this->hill_threshold = sp->hill_threshold;
|
||||
this->hill_steepness = sp->hill_steepness;
|
||||
this->spflags = params->spflags;
|
||||
this->ground_level = params->ground_level;
|
||||
this->large_cave_depth = params->large_cave_depth;
|
||||
this->cave_width = params->cave_width;
|
||||
this->lake_threshold = params->lake_threshold;
|
||||
this->lake_steepness = params->lake_steepness;
|
||||
this->hill_threshold = params->hill_threshold;
|
||||
this->hill_steepness = params->hill_steepness;
|
||||
|
||||
//// 2D noise
|
||||
noise_terrain = new Noise(&sp->np_terrain, seed, csize.X, csize.Z);
|
||||
noise_filler_depth = new Noise(&sp->np_filler_depth, seed, csize.X, csize.Z);
|
||||
noise_terrain = new Noise(¶ms->np_terrain, seed, csize.X, csize.Z);
|
||||
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
||||
|
||||
MapgenBasic::np_cave1 = sp->np_cave1;
|
||||
MapgenBasic::np_cave2 = sp->np_cave2;
|
||||
MapgenBasic::np_cave1 = params->np_cave1;
|
||||
MapgenBasic::np_cave2 = params->np_cave2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user