Commit Graph

104 Commits

Author SHA1 Message Date
paramat
4adbd69a37 FindSpawnPos: Let mapgens decide what spawn altitude is suitable
To avoid spawn search failing in new specialised mapgens
Increase spawn search range to 4000 nodes
Add getSpawnLevelAtPoint() functions to EmergeManager, class Mapgen
and all mapgens
Remove getGroundLevelAtPoint() functions from all mapgens except mgv6
(possibly to be re-added later in the correct form to return actual
ground level)
Make mgvalleys flag names consistent with other mapgens
Remove now unused 'vertical spawn range' setting
2016-02-09 07:14:45 +00:00
paramat
49073ba2c3 Mapgen: Add propagate_shadow bool to calcLighting
To terminate unwanted shadows from floatlands or realms above
Also add to LuaVoxelManip calc_lighting for use in mapgen mods
Remove the 2 argument calcLighting, mapgens now use the 5
argument form to specify the volumes for propagateSunlight and
spreadLight
In mgsinglenode replace calcLighting with setLighting and
clean-up use of tabs and spaces
2015-12-07 03:18:24 +00:00
paramat
d7bbe81726 Mapgen: Add global 'decorations' flag
Flag is set by default in MapgenParams
The global 'trees' flag remains but is now
undocumented and unset by default in MapgenParams
Add mgv6_spflag 'trees' set by default in
defaultsettings.cpp to affect new worlds only
This is automatically backwards
compatible for existing worlds
2015-11-21 00:10:08 +00:00
kwolekr
c56d7fe0eb Add DISABLE_CLASS_COPY macro (and use it)
Use this macro to disallow copying of an object using the assignment
operator or copy constructor.  This catches otherwise silent-but-deadly
mistakes such as "ServerMap map = env->getMap();" at compile time.

If so desired, it is still possible to copy a class, but it now requires
an explicit call to memcpy or std::copy.
2015-10-27 22:05:08 -04:00
paramat
59fa117d13 Decoration API: Add flag for placement on liquid surface
Add findLiquidSurface() function to mapgen.cpp
Update lua_api.txt
2015-10-23 21:30:20 +01:00
paramat
4967e483b6 Mgv5/mgv7 biomes: Reduce heat and humidity noise spreads to former value of 750 2015-09-07 02:56:20 +01:00
onkrot
5556ba168f Remove unused functions. 2015-08-16 14:29:33 +02:00
paramat
91f95fd4df Biome API: Increase heat and humidity noise spreads to 1000 2015-06-30 07:04:18 +01:00
paramat
70da8a940b Mapgen objects: Enable heatmap and humidmap for all biome api mapgens 2015-06-20 04:16:17 +01:00
paramat
e45ecad3ab Biome API: Add noise defined biome blend 2015-06-18 07:05:22 +01:00
paramat
774e5d17c4 Biome API, mgv7: Increase heat/humidity spreads. Improve mgv7 noise parameters 2015-05-24 04:33:09 +01:00
kwolekr
6c5a6967ec Split ObjDef/ObjDefManager out to objdef.cpp 2015-05-18 22:30:25 -04:00
paramat
c0edb8e313 Mapgen v5/v7: Detect sandstone, enable sandstone brick dungeons 2015-05-17 06:07:39 +01:00
kwolekr
5b237b4d94 ObjDefManager: Set replacement object's handle info after calling set()
Make gamedef optional when constructing an ObjDefManager
Add note about object ownership
2015-05-03 22:19:35 -04:00
kwolekr
821d0025da Biomes: Remove referenced biomes from Decorations on clear 2015-04-16 23:38:05 -04:00
kwolekr
337e79c656 ObjDefManager, Mapgen SAPI: Huge refactoring
- General code cleanup
 - Unified object creation and loading
 - Specifying objects in APIs is now orthogonal (i.e. anything can take an ID,
   name string, or the raw table definition (and automatically registers if present
2015-03-31 23:27:58 -04:00
kwolekr
ed10005d38 GenElementManager: Pass opaque handles to Lua and rename to ObjDefManager
Add core.clear_registered_schematics() and refactor schematics somewhat
2015-03-31 01:11:51 -04:00
kwolekr
732d7b9a7c Add core.register_schematic() and cache schematics on use 2015-03-23 22:23:38 -04:00
kwolekr
26153bab7d Revert "Fix issue #2441: crash on respawn, since a conversion std::list to std::vector on Environment.cpp"
This reverts parts of commit 9749d9fee6db99da1ab861dc04ec63ef973db3e0, which breaks node resolver
list clearing
2015-03-20 18:41:26 -04:00
ShadowNinja
adfcdc5484 Silence Clang warning 2015-03-10 20:47:52 -04:00
paramat
d463000595 Heightmaps: Fix uninitialised values in mgv5/mgv6. findGroundLevel: Return -MAP_GENERATION_LIMIT if surface not found 2015-03-08 03:54:03 +00:00
ngosang
f6e4c5d9cf Respect game mapgen flags and save world noise params 2015-03-07 15:53:39 -05:00
Craig Robbins
daa1c30b35 Fix mapgen using unitialised height map values 2015-03-06 01:42:55 +10:00
Loic Blot
9749d9fee6 Fix issue #2441: crash on respawn, since a conversion std::list to std::vector on Environment.cpp
* Also change some std::list to std::vector for ClientMap::renderMap
* Remove disabled code in ClientMap::renderMap, disabled since a long time
2015-03-05 15:36:20 +01:00
kwolekr
2d849b0a19 Shorten ManualMapVoxelManipulator to MMVManip 2015-01-05 02:42:27 -05:00
kwolekr
7289d61e99 Optionally specify propagateSunlight area in calcLighting
This fixes the Mapgen V5 calcLighting segfault
2015-01-05 01:20:36 -05:00
kwolekr
7233a1228e Lighting: Fix nearly all issues
The cause of a single light source seemingly being lit without spread
was due to its creation in the +Y mapblock boundary layer during map
generation, which was ignored as the overtop.  This overtop explicitly
needs to be omitted during sunlight propagation, however.  To accomplish
this, Mapgen::calcLighting() was split into separate functions taking
separate parameters.
Additionally, do not diminish light too early during spread.  This fixes the
output inconsistency between Map::updateLighting and Mapgen::calcLighting.
2015-01-04 02:42:31 -05:00
kwolekr
0974337804 Mapgen: Use getBlockSeed2() for blockseeds (much better uniformity) 2014-12-29 21:44:52 -05:00
kwolekr
b67f37f27e Redefine NodeResolver interface and replace with callback mechanism 2014-12-27 02:12:21 -05:00
kwolekr
cf8213ea82 Add minetest.clear_registered_decorations() and clear_registered_ores() 2014-12-12 14:08:04 -05:00
paramat
4cf8042b7c Biome API: Reduce heat and humidity persistences to 0.5 2014-12-10 01:39:08 -05:00
kwolekr
29b413b376 Biomes: Make biome heat and humidity noise parameters user-configurable 2014-12-09 00:38:04 -05:00
kwolekr
60feb4ad25 Add minetest.clear_registered_biomes() api 2014-12-06 18:08:23 -05:00
kwolekr
5062b99cb0 Rewrite generate notification mechanism
Add support for notify-on-decoration
Clean up mapgen constructors
Clean up mapgen.cpp code style somewhat
Remove trailing whitespace from some files
2014-12-06 13:53:35 -05:00
Craig Robbins
f0a8f655c0 Fix double free bug when server is shut down
Thanks @oleastre
2014-11-15 22:33:52 +10:00
kwolekr
b57478b93b Fix compilation under some Linux distributions 2014-11-13 00:16:37 -05:00
kwolekr
7616537bc0 Add Generator Element Management framework
Add BiomeManager, OreManager, DecorationManager, and SchematicManager
2014-11-12 23:02:41 -05:00
kwolekr
9e811a92e7 Split up mapgen.cpp 2014-11-01 13:16:23 -04:00
kwolekr
1cb6ea6346 Refactor decoration-related code
Split up ModApiMapgen::l_register_decoration()
Define and make use of CONTAINS() and ARRLEN() macros
2014-10-29 01:56:37 -04:00
kwolekr
d274cbfce6 Add NodeResolver and clean up node name -> content ID resolution system 2014-10-26 23:55:45 -04:00
ShadowNinja
6bc4cad0ed Split settings into seperate source and header files
This also cleans up settings a bit
2014-09-21 14:39:35 -04:00
Sfan5
118e2ae865 Fix all warnings reported by clang 2014-04-15 21:34:53 +02:00
kwolekr
c163859057 Schematic: Add force_placement parameter to minetest.place_structure API 2014-02-15 19:46:57 -05:00
kwolekr
83bafbe08b Make flag strings clear specified flag with 'no' prefix
Remove flagmask field from set_mapgen_params table
Add small bits of needed documentation
2014-02-08 17:50:59 -05:00
kwolekr
5a34f40d80 Huge overhaul of the entire MapgenParams system
MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations.
Separation between the common and mapgen-specific parameters is now strongly defined.
Mapgen parameters objects are now properly encapsulated within the proper subsystems.
2014-02-03 22:50:14 -05:00
kwolekr
a358c040f2 Mapgen V6: Add flag to stop mud flow 2014-01-12 18:21:28 -05:00
kwolekr
c3708b456e Add map feature generation notify Lua API 2013-12-14 01:52:24 -05:00
kwolekr
83cc882335 EmergeManager: Fix Lua mapgen override param handling 2013-12-08 01:31:06 -05:00
kwolekr
20e3d550fa Decoration: Add schematic Y-slice probability support 2013-12-01 01:24:59 -05:00
Kahrl
4e1f50035e Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00