Commit Graph

145 Commits

Author SHA1 Message Date
cx384 60810c2d37
Add L-system trees as decorations (#14355) 2024-03-12 20:10:28 +01:00
sfan5 3cac17d23e
Lua on each mapgen thread (#13092) 2024-02-13 22:47:30 +01:00
Desour 2ad4c9e0ce Fix -Wunused-but-set-variable warnings 2023-09-09 18:48:56 +02:00
sfan5 2c987b66c1 Move implementations of some LuaVoxelManip functions to l_mapgen 2023-08-14 18:16:36 +02:00
sfan5 524d446757 Minor script api fixes/cleanups 2023-06-23 09:05:26 +02:00
Pascal Abresch ba80d1ce1f Implement check_offset for decorations 2023-06-15 10:36:46 +02:00
Jude Melton-Houghton b3ffc4b327
Add `minetest.get_mapgen_edges` (#12999) 2022-12-03 10:40:46 -05:00
Jude Melton-Houghton 386bfcda2b
Fix reading schematics after their resolution (#12985) 2022-11-23 11:53:21 -05:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Jude Melton-Houghton 7632af3c73
Consolidate API object code (#12728)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-04 08:31:36 -04:00
sfan5 75bf9b75ca
Make sure relevant std::stringstreams are set to binary 2021-09-11 21:06:57 +02:00
sfan5 2da1eee394
Fix broken `BiomeGen` abstraction (#11107) 2021-03-23 15:43:26 +01:00
SmallJoker 05719913ac
Schematic: Properly deal with before/after node resolving and document (#11011)
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)
2021-03-20 13:02:15 +01:00
rubenwardy fbb9ef3818
Reduce ore noise_parms error to deprecation warning (#10921)
Fixes #10914
2021-02-06 13:46:45 +01:00
SmallJoker 37a05ec8d6 Settings: Proper priority hierarchy
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
2021-01-29 17:32:35 +01:00
rubenwardy 4fcd000e20
MgOre: Fix invalid field polymorphism (#10846) 2021-01-21 19:08:06 +00:00
Zughy 45ccfe26fb
Removed some obsolete code (#10562)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2021-01-21 18:17:09 +00:00
Paramat 42fcfb75e8
Allow more than 255 biomes, document new maximum (#9855)
Change biomemap data type from u8 to u16.
New technical (not practical) maximum is 65535 biomes.
2020-05-20 22:16:14 +01:00
sfan5 c28fbd06a8 Fix remaining issues with mapgen scriptapi 2020-05-05 19:26:59 +02:00
sfan5 3c65d1acec Give the Mapgen on each EmergeThread its own Biome/Ore/Deco/SchemManager copy 2020-05-05 19:26:59 +02:00
sfan5 2d5bd3bf79
scriptapi: Some small optimizations to value pushing (#9669) 2020-04-14 20:44:18 +02:00
random-geek f2e62298a5 Change some usages of "deprecated" to "obsolete" (#9062)
"Deprecated" means that something is still in use, but is unsupported and needs to be removed.
"Obsolete" means it is already out of use.
2019-10-29 19:23:12 +01:00
upsilon b2065756cf Add function `minetest.read_schematic` 2019-08-14 13:15:41 +02:00
SmallJoker cfef466d4e l_mapgen.cpp: Fix LINT broken since b1b40fe 2019-05-21 19:16:01 +02:00
Paramat b1b40fef16
Allow multiple cave liquids in a biome definition (#8481)
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'
2019-05-18 21:13:14 +01:00
SmallJoker a122ba0ef4 Fix various bugs (Anticheat, Lua helpers) (#8013)
* 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
2019-01-06 10:24:44 +01:00
Loïc Blot eef62c82a2
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* 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
2018-06-30 17:11:38 +02:00
Paramat 746ca41f58
Biome API / dungeons: Add biome-defined dungeon nodes
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.
2018-04-07 22:09:54 +01:00
Paramat 32d456bd2d
Biome API / cavegen: Add definable cave liquid for a biome (#7192)
Add 'node_cave_liquid' as a new field in biome registration.
If field is absent cave liquids fall back to classic behaviour.
2018-04-05 17:21:41 +01:00
Paramat 2f280cc672
Mapgen: Remove unused mgv7 code and some unused biometypes 2018-03-26 04:59:49 +01:00
paramat 7ad6cdd09b Biome API: Add 'get_biome_name(biome_id)' API
Change name of default biome to a more suitable lowercase 'default'.
2018-03-11 23:06:17 +00:00
paramat 644d0ab2bb Spawn level: Add 'get_spawn_level(x, z)' API
Returns a suitable player spawn y co-ordinate for unmodified terrain.
2018-03-10 03:38:27 +00:00
paramat cbb9301bea Biomes: Add 'min_pos'/'max_pos' xyz biome limits
'y_min' and 'y_max' are still accepted for compatibility.
2018-03-09 03:16:25 +00:00
paramat 48493a979b Gennotify: Add 'minetest.get_decoration_id' API
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'.
2018-03-03 23:00:08 +00:00
paramat c610643c4c Place schematic (on vmanip): Enable use of 'place center' flags
For 'place schematic' and 'place schematic on vmanip' APIs.
Fix 'place center' code to properly centre schematics.
Fix some comments.
2018-02-27 19:39:05 +00:00
Dániel Juhász 3face01a20 Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
2018-02-10 21:04:16 +01:00
paramat d45e5da8ca Biomes: Add 'get heat', 'get humidity', 'get biome data' APIs
'get biome data' returns biome id, heat and humidity.
Clean up nearby lines in lua_api.txt.
2018-01-16 08:47:07 +00:00
Paramat 549cfd9db8 Biomes: Add vertical biome blend (#6853)
Add 'vertical blend' parameter to biome registration that defines how
many nodes above the biome's 'y max' limit the blend will extend.
2018-01-05 00:10:55 +01:00
paramat 4b553ece09 Stratum ore: Add option for a constant thickness stratum
Add a 'stratum thickness' integer parameter, as an alternative
to providing a 2nd noise parameter for thickness variation.
2017-11-19 00:25:39 +00:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
paramat 9a41a3d0f1 Simple decorations: Make 'place_offset_y' usable with simple decorations
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.
2017-10-10 19:57:28 +01:00
paramat 0c9ca27ffc Simple decorations: Add 'param2_max' parameter for random param2
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.
2017-10-09 18:27:17 +01:00
paramat e2afcf85ce Stratum ore: Allow use with no noise for simple horizontal strata
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.
2017-10-01 22:31:44 +01:00
paramat 51002b1629 Schematic decorations: Add 'place_offset_y' placement parameter
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.
2017-09-10 01:31:30 +01:00
Paramat 9f6d90aa81 Ores: Add stratum ore (#6352)
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.
2017-09-03 22:32:21 +02:00
Loïc Blot ae9b5e0098 Modernize code: very last fixes (#6290)
Last modernization fixes
2017-08-20 19:37:29 +02:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* 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
2017-08-20 13:30:50 +02:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
Loïc Blot c07c642ab0 read_schematic_replacements: ensure fields are strings (#5726)
* 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
2017-05-08 20:43:03 +02:00
paramat 46276414ed Get biome list: Downgrade missing biome message to infostream
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.
2017-03-16 02:56:03 +00:00