274 Commits

Author SHA1 Message Date
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
Craig Robbins
00b9ca5e77 Fix typo 2015-03-29 22:08:14 +10:00
Craig Robbins
918e2548d0 Add Lua function get_video_modes() for main menu
Also updates and uses porting::getSupportedVideoModes()
2015-03-28 13:26:03 +10:00
ShadowNinja
2de60ae349 Clean up and tweak build system
* Combine client and server man pages.
  * Update unit test options and available databases in man page.
  * Add `--worldname` to man page.
  * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
  * Disable server build by default on all operating systems.
  * Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
  * Enable LevelDB, Redis, and FreeType detection by default.
  * Remove the `VERSION_PATCH_ORIG` hack.
  * Add option to search for and use system JSONCPP.
  * Remove broken LuaJIT version detection.
  * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
  * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
  * Clean up style of CMake files.
2015-03-27 15:00:48 -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
est31
e431f47da1 Fix minetest.get_craft_recipe function
Previously, calling it resulted in a crash.
2015-03-23 13:40:20 +10:00
Loic Blot
455863a38f Revert "Add a Lua call to do damages / heals" ok @ShadowNinja
This reverts commit 467fc0ddc912ae38c3bf9fcb99e0b66d7478eec0.
2015-03-22 18:01:56 +01:00
kwolekr
16407b9f46 Add support for the PCG32 PRNG algo (and associated script APIs) 2015-03-22 00:48:08 -04:00
gregorycu
304a9e8016 Optimize minetest.get_(all)_craft_recipe(s)
Signed off by: ShadowNinja, kwolekr
2015-03-20 21:41:18 -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
est31
256e16dbea Fix game minetest.conf default settings
This was a regression introduced by f6e4c5d9cf459e8278a76a2beaee59732e841458 .
2015-03-18 13:03:02 -04:00
Loic Blot
7caacf745b Add a Lua call to do damages / heals 2015-03-18 14:52:35 +01:00
Loic Blot
554575520c Prepare Protocol v25 init & authentication.
* TOSERVER_INIT and TOCLIENT_INIT renamed to _LEGACY
* TOSERVER_PASSWORD merged from dev-0.5, can use protocol v24 and v25
* TOCLIENT_ACCESS_DENIED merged from dev-0.5, can use protocol v24 and v25, with normalized strings an a custom id for custom errors
* new TOSERVER_INIT packet only send MT version, supported compressions, protocols and serialization, this permit to rework everything later without break the _INIT packet
* new TOSERVER_AUTH packet which auth the client
* new TOCLIENT_HELLO packet which send server serialization version atm
* new TOCLIENT_AUTH_ACCEPTED which is send when TOCLIENT_AUTH was okay. After this packet, the client load datas from servers, like after TOCLIENT_INIT_LEGACY packet
2015-03-13 20:23:03 +01:00
paramat
6817647244 lua_api/l_mapgen: Fix overlapping areas of minetest.generate_ores/decorations 2015-03-11 03:36:39 +00:00
Craig Robbins
27791ee1aa For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
Loic Blot
caba8fcd93 l_get_modnames: Compare using std::sort instead of a custom function which does same work 2015-03-05 20:12:54 +01: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
Loic Blot
b6a8f1e7c4 Performance improvement: Use std::list instead of std::vector for request_media, Server::getModNames, Environment::m_simple_objects.
* Also remove unused Server::m_modspaths
2015-03-05 10:44:48 +01:00
Loic Blot
fa9145128a We always know playerSAO when calling SendInventory. Using it instead of searching it via peer_id 2015-03-04 15:28:33 +01:00
Loic Blot
c468ca4821 Send Inventory packet on event, don't check it at each AsyncRunStep.
* Call UpdateCrafting into SendInventory because this functions is only called before SendInventory
* Use Player* instead of peer_id for UpdateCrafting because SendInventory already has the Player* pointer, then don't loop for searching Player* per peer_id
* m_env_mutex don't need to be used with this modification because it's already locked before the calls
2015-03-04 11:29:39 +01:00
Loic Blot
ee42254b45 Send Breath packet on event, don't check it at each AsyncRunStep 2015-03-03 16:33:20 +01:00
Loic Blot
14e866c4a6 Send Player HP when setHP (or a setHP caller) is called instead of looping and testing the state change. 2015-03-03 16:06:04 +01:00
Craig Robbins
102e0ee00d Change find_surface_nodes_in_area to find_nodes_in_area_under_air 2015-02-27 21:42:00 +10:00
Loic Blot
0d823b300e Add find_surface_nodes_in_area LUA call which permit to only get the nodes which touch air. This permit to massively improve performance for mods like plantlife 2015-02-27 21:34:33 +10:00
paramat
a5bcca8305 Biome API: Re-calculate biome at every surface in a mapchunk column 2015-02-26 03:35:25 +00:00
Kahrl
eb49a8d55e Disallow object:remove() if the object is a player
Rebased by Zeno- (conflict in lua_api.txt)
2015-02-23 16:49:48 +10:00
est31
22ea6a5d81 Server: announce MIN/MAX protocol version supported to serverlist. Client: check serverlist
Client now informs about incompatible servers from the list, this permits to prevent the protocol movements.
Server announces its supported protocol versions to master server
2015-02-18 16:09:59 +01:00
Loic Blot
ad693a80de Fix unused (and so, broken) enable_rollback_recording. This option must be reloaded at server loop but loaded when server starts, for data consistency (not a hot load variable)
ok @ShadowNinja
2015-02-18 09:28:39 +01:00
Loic Blot
1905f12b61 SAO work: ActiveObject types & SAO cleanup * Replace u8 types with ActiveObjectType. * Merge content_object.h into activeobject.h * Remove DummyLoadSAO, it's now unused. * Remove ItemSAO, it's also unused 2015-02-17 09:09:50 +01:00
Loic Blot
eb9db33a62 Performance Improvement: Use a cache which caches result for getFacePositions.
This greatly reduce the number of std::list generated by caching the result, which is always constant for each radius selected.
In the callgrind map, you will see original:
  * 3.3M calls to std::list for 9700 calls to getFacePositions
In the modified version, you will see:
  * 3.3K calls to std::list for 6900 call to getFacePositions
Callgrind map is here: #2321

it's a huge performance improvement to l_find_node_near
2015-02-16 11:27:44 +01:00
ngosang
b19cbb43a0 Fix .zip extraction (mod store) 2015-02-12 15:27:20 +01:00
ShadowNinja
0a2e53077b Reduce gettext wide/narrow and string/char* conversions 2015-02-05 03:24:22 -05:00
kwolekr
87330183bf Fix all warnings and remove -Wno-unused-but-set cflag 2015-01-18 23:29:19 -05:00
kwolekr
5bb6adee32 Reorganize supported video driver query mechanisms 2015-01-18 13:24:25 -05:00
kwolekr
66b0d25786 Add ability to delete MapBlocks from map
Also add a Lua API and chatcommand for this
2015-01-15 16:48:56 -05:00
rubenwardy
056427477e Fix direction property of HUD 2015-01-07 20:51:47 +01:00
kwolekr
02e06b423e Shorten ManualMapVoxelManipulator to MMVManip 2015-01-05 02:42:27 -05:00
kwolekr
97c7e9a5f6 Optionally specify propagateSunlight area in calcLighting
This fixes the Mapgen V5 calcLighting segfault
2015-01-05 01:20:36 -05:00
kwolekr
c659967d1c Exclude vertical mapblock borders when setting light 2015-01-04 23:14:16 -05:00
kwolekr
5370bf9a50 Add minetest.generate_ores() and minetest.generate_decorations() 2015-01-04 22:38:48 -05:00
kwolekr
1c2805b733 Add warning about using deprecated fields in Mapgen API and update docs 2015-01-04 03:24:40 -05:00
kwolekr
8d594e6799 LuaVoxelManip: Error when given out-of-bounds area 2015-01-04 03:07:28 -05:00
kwolekr
7ba812f028 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
d49f1250f5 Replace instances of height_min/height_max with y_min/y_max to remove ambiguity 2014-12-30 01:48:20 -05:00
kwolekr
7866b3811f Decoration: Fix default parameter values 2014-12-30 00:52:40 -05:00
kwolekr
6a136cf876 Add core.get_mapgen_names() to Main Menu API (and use it)
Also rewrite mapgen registration for static initialization
2014-12-29 21:23:51 -05:00
kwolekr
eb208e6b75 Expose mapgen parameters on scripting init
Add minetest.get_mapgen_params()
Deprecate minetest.register_on_mapgen_init()
2014-12-29 12:59:59 -05:00
kwolekr
2e5d9bb332 LuaVoxelManip: Remove blank allocator 2014-12-29 01:31:37 -05:00