94 Commits

Author SHA1 Message Date
ShadowNinja
79c3da8546 Mod security: Allow read-only access to all mod paths 2016-12-20 06:34:04 +00:00
Auke Kok
28c2f61e19 Simple decorations: Fix range check for deco->deco_param2
Allow any int value, and properly range check it before casting.
2016-12-08 08:38:10 +00:00
Auke Kok
2f71a16b08 Simple deco: Allow setting param2 value on placement
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.
2016-12-07 04:17:17 +00:00
Loic Blot
2b5c276768 Use more unordered_maps to improve performance in c++11 builds 2016-10-06 12:33:35 +02:00
paramat
f932e5d286 Decorations: Generalise 'spawn by' to be used by all decoration types
In lua_api.txt, make clear that 'place on' and 'spawn by' can be lists.
2016-09-14 09:19:54 +01:00
Ner'zhul
8cd0dac7b3 Permit usage of std::unordered_map & std::unorderered_set on c++11 compilers (#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
2016-08-10 12:08:05 +02:00
kwolekr
7af0dede5f 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.
2016-07-03 15:38:36 -04:00
paramat
3616e70c58 Biome API: Add per-biome riverbed material and depth
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
2016-06-05 16:37:02 +01:00
kwolekr
67e06fbbec Fix MgStoneType and BiomeType enum names 2016-05-27 23:23:58 -04:00
kwolekr
18c17ff1fd Move biome calculation to BiomeGen
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.
2016-05-27 23:23:58 -04:00
est31
d0423e299b Fix threshold type
Fix the type of the threshold value for mapgen.
The commit

a78dd7f2b6b0e1fefdbaa1ae21b722dd4459e4f4 "Fix spelling of noise_threshold"

has changed it to be read as int, but it can have non-integral values too.

Thanks to @kwolekr for pointing this out.
2015-12-07 09:57:45 +01:00
Jun Zhang
3c28fc24a8 Fix spelling of noise_threshold 2015-12-06 11:38:03 +01:00
kwolekr
d93a706ccb Schematics: Add core.place_schematic_on_vmanip API
Fix memory leak in minetest.place_schematic
Slightly refactor Schematic code
2015-11-05 01:18:32 -05:00
kwolekr
8772291962 SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread 2015-10-25 23:15:57 -04:00
kwolekr
47189162aa SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
kwolekr
321e32b612 Allow setting chunksize in core.set_mapgen_params 2015-10-04 17:26:08 -04:00
kwolekr
3079eaa37e Define and use limit constants for Irrlicht fixed-width types 2015-10-04 04:00:16 -04:00
Duane Robertson
3416bf155f Add get_biome_id(biome_name) callback
It returns the index used in mg->biomemap for a given biome name.
The biomemap is useless without this unless you re-register all existing biomes,
which could cause problems for anyone else trying to use biomemap.
With this, you can quickly create a lookup table of ids and names.
2015-10-02 22:49:31 +02:00
kwolekr
6831884d5c Ore: Add puff ore type 2015-09-17 03:04:50 -04:00
kwolekr
f24947f903 Ore: Add ore sheet column height range selection
Modders are now able to select the range of ore column height,
and the midpoint at which they 'grow' starting from.
This commit adds three new parameters for the 'sheet' ore type:
column_height_min, column_height_max, and column_midpoint_factor.
clust_size is now deprecated for this ore type.
2015-09-13 00:11:50 -04:00
paramat
b1fdade2be Biome API: Make fallback biome stone and water, disable filler 2015-08-03 02:34:32 +01:00
SmallJoker
5442818d56 Fix MSVC number conversion warning 2015-07-25 17:38:04 +02:00
paramat
063ca7aa52 Mapgen objects: Enable heatmap and humidmap for all biome api mapgens 2015-06-20 04:16:17 +01:00
kwolekr
3c87e26ee0 Make get_biome_list() error message more helpful 2015-05-28 20:04:50 -04:00
TeTpaAka
4573eef202 Add some missing getter functions to the lua API
ObjectRef:
get_properties
get_armor_groups
get_animation
get_attach
get_bone_position

Players:
get_physics_override
hud_get_hotbar_itemcount
hud_get_hotbar_image
hud_get_hotbar_selected_image
get_sky
get_day_night_ratio
get_local_animation
get_eye_offset

Global:
minetest.get_gen_notify
minetest.get_noiseparams
2015-05-28 16:46:35 +02:00
kwolekr
e2e354061a Fix null dereference when loading schematic from definition without a NodeDefManager 2015-05-17 22:32:35 -04:00
ShadowNinja
1008aefa8c Add mod security
Due to compatibility concerns, this is temporarily disabled.
2015-05-16 18:32:31 -04:00
est31
24ab05ab83 Fix compiler warning about sign comparison 2015-05-13 00:04:30 +02:00
kwolekr
4a54c965a5 Schematics: Add per-node force placement option 2015-05-09 18:44:00 -04:00
kwolekr
9f679f6b11 Tests: Add schematic unittests
Improve schematic file-saving interface
Add ability to create temporary test files
2015-05-08 00:55:42 -04:00
kwolekr
097b9ead50 Schematics: Add indent-with-space option for schematic Lua table serialization 2015-05-07 02:54:35 -04:00
kwolekr
e8fb94705c NodeResolver: Remove NodeResolveMethod
This simplifies NodeResolver logic and makes some interfaces cleaner.
2015-05-07 02:36:01 -04:00
kwolekr
6495b9b57b Ore: Add biomes parameter 2015-04-20 20:25:33 -04:00
paramat
11013edeb8 Biome API: Add biome-specific river water 2015-04-19 06:09:57 +01:00
kwolekr
9c2f472c09 Schematics: Fix core.schematic_create() 2015-04-17 18:39:37 -04:00
kwolekr
04dcd9ff2b Switch to check_v3s16 in l_mapgen.cpp and l_vmanip.cpp for type safety 2015-04-17 01:03:13 -04:00
kwolekr
2522c53f17 Biomes: Remove referenced biomes from Decorations on clear 2015-04-16 23:38:05 -04:00
kwolekr
737d4078c9 Schematics: Refactor NodeResolver and add NodeResolveMethod
NodeResolver name lists now belong to the NodeResolver object instead of
the associated NodeDefManager.  In addition to minimizing unnecessary
abstraction and overhead, this move permits NodeResolvers to look up nodes
that they had previously set pending for resolution.  So far, this
functionality has been used in the case of schematics for
serialization/deserialization.
2015-04-16 16:27:05 -04:00
kwolekr
4c5f712673 Schematics: Reorganize (de)serialization and add Lua serialization API 2015-04-13 03:10:52 -04:00
kwolekr
55d3aa7960 Schematics: Prepend mod path to relative schematic filepaths 2015-04-08 00:28:56 -04:00
Craig Robbins
0731f9ed2a Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
kwolekr
87ea5c96a6 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
ae55a60e16 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
paramat
c4d375a253 lua_api/l_mapgen: generate_ores/decorations: make p1, p2 optional 2015-03-24 18:07:29 +00:00
kwolekr
4174dde376 Add core.register_schematic() and cache schematics on use 2015-03-23 22:23:38 -04:00
kwolekr
67a32d0c03 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
paramat
6817647244 lua_api/l_mapgen: Fix overlapping areas of minetest.generate_ores/decorations 2015-03-11 03:36:39 +00:00
Loic Blot
5e4c5bfb4f 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
paramat
a5bcca8305 Biome API: Re-calculate biome at every surface in a mapchunk column 2015-02-26 03:35:25 +00:00
kwolekr
02e06b423e Shorten ManualMapVoxelManipulator to MMVManip 2015-01-05 02:42:27 -05:00