summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mapgen.cpp
Commit message (Collapse)AuthorAge
* Fix broken `BiomeGen` abstraction (#11107)sfan52021-03-23
|
* Schematic: Properly deal with before/after node resolving and document (#11011)SmallJoker2021-03-20
| | | | This fixes an out-of-bounds index access when the node resolver was already applied to the schematic (i.e. biome decoration). Also improves the handling of the two cases: prior node resolving (m_nodenames), and after node resolving (manual lookup)
* Reduce ore noise_parms error to deprecation warning (#10921)rubenwardy2021-02-06
| | | | Fixes #10914
* Settings: Proper priority hierarchySmallJoker2021-01-29
| | | | | | | | | | | Remove old defaults system Introduce priority-based fallback list Use new functions for map_meta special functions Change groups to use end tags Unittest changes: * Adapt unittest to the new code * Compare Settings objects
* MgOre: Fix invalid field polymorphism (#10846)rubenwardy2021-01-21
|
* Removed some obsolete code (#10562)Zughy2021-01-21
| | | Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
* Allow more than 255 biomes, document new maximum (#9855)Paramat2020-05-20
| | | | Change biomemap data type from u8 to u16. New technical (not practical) maximum is 65535 biomes.
* Fix remaining issues with mapgen scriptapisfan52020-05-05
|
* Give the Mapgen on each EmergeThread its own Biome/Ore/Deco/SchemManager copysfan52020-05-05
|
* scriptapi: Some small optimizations to value pushing (#9669)sfan52020-04-14
|
* Change some usages of "deprecated" to "obsolete" (#9062)random-geek2019-10-29
| | | | "Deprecated" means that something is still in use, but is unsupported and needs to be removed. "Obsolete" means it is already out of use.
* Add function `minetest.read_schematic`upsilon2019-08-14
|
* l_mapgen.cpp: Fix LINT broken since b1b40feSmallJoker2019-05-21
|
* Allow multiple cave liquids in a biome definition (#8481)Paramat2019-05-18
| | | | | | | | | | | | | This allows games to specify biome cave liquids and avoid the old hardcoded behaviour, but preserves the ability to have multiple cave liquids in one biome, such as lava and water. When multiple cave liquids are defined by the biome definition, make each entire cave use a randomly chosen liquid, instead of every small cave segment using a randomly chosen liquid. Plus an optimisation: Don't place nodes if cave liquid is defined as 'air'
* Fix various bugs (Anticheat, Lua helpers) (#8013)SmallJoker2019-01-06
| | | | | | | | | | | * Fix various bugs (Anticheat, Lua helpers) Anticheat: Use camera position instead of player position for shoot line calculations Lua helpers: Increase 'i' to not overwrite earlier added table values * Remove lag compensation * * 1.5 for larger selection boxes
* Modernize lua read (part 2 & 3): C++ templating assurance (#7410)Loïc Blot2018-06-30
| | | | | | | | | * Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
* Biome API / dungeons: Add biome-defined dungeon nodesParamat2018-04-07
| | | | | | | | | | Add new biome fields 'node_dungeon', 'node_dungeon_alt', 'node_dungeon_stair'. If 'node_dungeon' is not defined dungeons fall back to classic behaviour. Remove messy and imprecise dungeon material code from 'generateBiomes()'. Code deciding dungeon materials is now in 'generateDungeons()' and uses the biome at mapchunk centre for more precision. Remove hardcoded 'MG_STONE' types as long intended.
* Biome API / cavegen: Add definable cave liquid for a biome (#7192)Paramat2018-04-05
| | | | Add 'node_cave_liquid' as a new field in biome registration. If field is absent cave liquids fall back to classic behaviour.
* Mapgen: Remove unused mgv7 code and some unused biometypesParamat2018-03-26
|
* Biome API: Add 'get_biome_name(biome_id)' APIparamat2018-03-11
| | | | Change name of default biome to a more suitable lowercase 'default'.
* Spawn level: Add 'get_spawn_level(x, z)' APIparamat2018-03-10
| | | | Returns a suitable player spawn y co-ordinate for unmodified terrain.
* Biomes: Add 'min_pos'/'max_pos' xyz biome limitsparamat2018-03-09
| | | | 'y_min' and 'y_max' are still accepted for compatibility.
* Gennotify: Add 'minetest.get_decoration_id' APIparamat2018-03-03
| | | | | | Returns the decoration ID for the provided decoration name string. For use with gennotify, to know the decoration IDs for use in 'minetest.set_gen_notify'.
* Place schematic (on vmanip): Enable use of 'place center' flagsparamat2018-02-27
| | | | | | For 'place schematic' and 'place schematic on vmanip' APIs. Fix 'place center' code to properly centre schematics. Fix some comments.
* Node definition manager refactor (#7016)Dániel Juhász2018-02-10
| | | | | | | | | * Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
* Biomes: Add 'get heat', 'get humidity', 'get biome data' APIsparamat2018-01-16
| | | | | 'get biome data' returns biome id, heat and humidity. Clean up nearby lines in lua_api.txt.
* Biomes: Add vertical biome blend (#6853)Paramat2018-01-05
| | | | Add 'vertical blend' parameter to biome registration that defines how many nodes above the biome's 'y max' limit the blend will extend.
* Stratum ore: Add option for a constant thickness stratumparamat2017-11-19
| | | | | Add a 'stratum thickness' integer parameter, as an alternative to providing a 2nd noise parameter for thickness variation.
* Move files to subdirectories (#6599)Vitaliy2017-11-08
| | | | * Move files around
* Simple decorations: Make 'place_offset_y' usable with simple decorationsparamat2017-10-10
| | | | | | Necessary for placing the base cube of 'plantlike_rooted' drawtype in the seabed instead of on it. Useful for placing decorations sunk into, or buried in, the ground.
* Simple decorations: Add 'param2_max' parameter for random param2paramat2017-10-09
| | | | | | | If 'param2_max' is not used, parameter 'param2' works as before for compatibility. If 'param2_max' is used, 'param2' and 'param2_max' become the lower and upper bounds of a per-decoration random param2.
* Stratum ore: Allow use with no noise for simple horizontal strataparamat2017-10-01
| | | | | | | | If either of the 2 noise parameters are omitted the ore will occur from y_min to y_max in a simple horizontal stratum. As this does not compute noise performance improves, and is ideal for placing many layers. Clean up some nearby ore documentation.
* Schematic decorations: Add 'place_offset_y' placement parameterparamat2017-09-10
| | | | | | | | | For precise control of schematic vertical position relative to the 'place_on' node. Avoids workarounds that add empty nodes to a schematic and therefore reduce performance. Also remove long-unused decoration cutoff code.
* Ores: Add stratum ore (#6352)Paramat2017-09-03
| | | | | | | | Creates a single undulating ore stratum that is continuous across mapchunk borders and horizontally spans the world. Due to being continuous is ideal for creating bands of alternative stone type running through cliffs and mountains, or underground layers. Add missing documentation of 'ore_param2' parameter.
* Modernize code: very last fixes (#6290)Loïc Blot2017-08-20
| | | Last modernization fixes
* Modernize source code: last part (#6285)Loïc Blot2017-08-20
| | | | | | | | | | | * Modernize source code: last par * Use empty when needed * Use emplace_back instead of push_back when needed * For range-based loops * Initializers fixes * constructors, destructors default * c++ C stl includes
* C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)Loïc Blot2017-06-04
|
* read_schematic_replacements: ensure fields are strings (#5726)Loïc Blot2017-05-08
| | | | | | | | * read_schematic_replacements: ensure fields are strings add a type check before reading strings on read_schematic_replacements deserializer * throw LuaError instead of asserting the whole client
* Get biome list: Downgrade missing biome message to infostreamparamat2017-03-16
| | | | | | | | | | It is harmless for a biome listed in an ore or decoration registration to be missing. Now that we are registering certain biomes or not based on options (such as floatland biomes), the biome lists in ore and decoration registrations trigger these error messages, avoiding these error messages would need a large amount of duplication of ore and decoration registrations.
* Light calculation: New bulk node lighting codeDániel Juhász2017-03-11
| | | | | | | | | | | This commit introduces a new bulk node lighting algorithm to minimize lighting bugs during l-system tree generation, schematic placement and non-mapgen-object lua voxelmanip light calculation. If the block above the changed area is not loaded, it gets loaded to avoid lighting bugs. Light is updated as soon as write_to_map is called on a voxel manipulator, therefore update_map does nothing.
* Mod security: Allow read-only access to all mod pathsShadowNinja2016-12-20
|
* Simple decorations: Fix range check for deco->deco_param2Auke Kok2016-12-08
| | | | Allow any int value, and properly range check it before casting.
* Simple deco: Allow setting param2 value on placementAuke Kok2016-12-07
| | | | | | | | | | | | | Schematics can already be placed with a param2 value, but not simple 1-node plant decorations of the simple type. This adds a `param2` field to the simple deco type that is checked to be between 0 and 255, and put to the placed node at mapgen. This can be used to put a degrotate value in, or e.g. a fill value for leveltype nodes, or a place_param2 value at mapgen placement, or vary the shape of meshoptions plantlike drawtype.
* Use more unordered_maps to improve performance in c++11 buildsLoic Blot2016-10-06
|
* Decorations: Generalise 'spawn by' to be used by all decoration typesparamat2016-09-14
| | | | In lua_api.txt, make clear that 'place on' and 'spawn by' can be lists.
* Permit usage of std::unordered_map & std::unorderered_set on c++11 compilers ↵Ner'zhul2016-08-10
| | | | | | | | | (#4430) This fallback to std::map & std::set for older compilers Use UNORDERED_SET as an example in decoration and ore biome sets Use UNORDERED_MAP as an example in nameidmapping
* Add MapSettingsManager and new mapgen setting script API functionskwolekr2016-07-03
| | | | | | | | | | | | | | | 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.
* Biome API: Add per-biome riverbed material and depthparamat2016-06-05
| | | | | | Mgvalleys: Remove riverbed sand placement from base terrain generation Riverbed material placement moved to MapgenBasic::generateBiomes() Document fields and add note that the biome API is still unstable
* Fix MgStoneType and BiomeType enum nameskwolekr2016-05-27
|
* Move biome calculation to BiomeGenkwolekr2016-05-27
| | | | | | | BiomeGen defines an interface that, given a set of BiomeParams, computes biomes for a given area using the algorithm implemented by that specific BiomeGen. This abstracts away the old system where each mapgen supplied the noises required for biome generation.