aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2016-06-24 18:15:56 -0400
committerkwolekr <kwolekr@minetest.net>2016-07-03 15:38:36 -0400
commit3c63c3044d5e4ca36c2649c530f31622581d90fd (patch)
treeb7924100f14f5626c11d534e2ad3602e269ac1df /doc
parent92705306bfb4994107a43514f29997cea15d48dc (diff)
downloadminetest-3c63c3044d5e4ca36c2649c530f31622581d90fd.tar.gz
minetest-3c63c3044d5e4ca36c2649c530f31622581d90fd.tar.bz2
minetest-3c63c3044d5e4ca36c2649c530f31622581d90fd.zip
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.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 6d359379e..297566068 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2089,7 +2089,9 @@ and `minetest.auth_reload` call the authetification handler.
given biome_name string.
* `minetest.get_mapgen_params()` Returns mapgen parameters, a table containing
`mgname`, `seed`, `chunksize`, `water_level`, and `flags`.
+ * Deprecated: use minetest.get_mapgen_setting(name) instead
* `minetest.set_mapgen_params(MapgenParams)`
+ * Deprecated: use minetest.set_mapgen_setting(name, value, override) instead
* Set map generation parameters
* Function cannot be called after the registration period; only initialization
and `on_mapgen_init`
@@ -2099,6 +2101,23 @@ and `minetest.auth_reload` call the authetification handler.
* `flags` contains a comma-delimited string of flags to set,
or if the prefix `"no"` is attached, clears instead.
* `flags` is in the same format and has the same options as `mg_flags` in `minetest.conf`
+* `minetest.get_mapgen_setting(name)`
+ * Gets the *active* mapgen setting (or nil if none exists) in string format with the following
+ order of precedence:
+ 1) Settings loaded from map_meta.txt or overrides set during mod execution
+ 2) Settings set by mods without a metafile override
+ 3) Settings explicitly set in the user config file, minetest.conf
+ 4) Settings set as the user config default
+* `minetest.get_mapgen_setting_noiseparams(name)`
+ * Same as above, but returns the value as a NoiseParams table if the setting `name` exists
+ and is a valid NoiseParams
+* `minetest.set_mapgen_setting(name, value, [override_meta=false])`
+ * Sets a mapgen param to `value`, and will take effect if the corresponding mapgen setting
+ is not already present in map_meta.txt. If the optional boolean override_meta is set to true,
+ this setting will become the active setting regardless of the map metafile contents.
+ * Note: to set the seed, use "seed", not "fixed_map_seed"
+* `minetest.set_mapgen_setting_noiseparams(name, value, [override_meta=false])`
+ * Same as above, except value is a NoiseParams table
* `minetest.set_noiseparams(name, noiseparams, set_default)`
* Sets the noiseparams setting of `name` to the noiseparams table specified in `noiseparams`.
* `set_default` is an optional boolean (default: `true`) that specifies whether the setting