aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
AgeCommit message (Collapse)Author
2016-03-09Add consistent monotonic day counter - get_day_count()Auke Kok
I've written several experimental bits of code that revolve around the need for a consistent calendar, but implementing one is extremely hard in mods due to time changes and mods overriding core.get_timeofday(), which will conflict. The second part of the problem is that doing this from a mod requires constant maintenance of a settings file. An implementation in core is trivial, however, and solves all of these problems at virtually no cost: No extra branches in server steps, and a single branch when minetest.set_time_of_day(), which is entirely reasonable. We store the day_count value in env_meta.txt. The use case is obvious: This change allows mods to create an actual virtual calendar, or properly account for seasonal changes, etc.. We add a "/days" chatcommand that displays the current day count. No permissions are needed. It can only retrieve the day count, not modify it.
2016-03-07Add AreaStore custom ID APIShadowNinja
2016-03-07Implement AreaStore serializationShadowNinja
2016-03-07Simplify AreaStore ID managementShadowNinja
2016-03-07Add minetest.register_lbm() to run code on block load onlyest31
2016-03-04Decoration API: Allow force_placement of simple decorationsparamat
2016-03-03Require minetest.request_http_api to be called from the mod's main scopeJeija
Fixes #3764
2016-02-22Add Lua interface to HTTPFetchRequestJeija
This allows mods to perform both asynchronous and synchronous HTTP requests. Mods are only granted access to HTTP APIs if either mod security is disabled or if they are whitelisted in any of the the secure.http_mods and secure.trusted_mods settings. Adds httpfetch_caller_alloc_secure to generate random, non-predictable caller IDs so that lua mods cannot spy on each others HTTP queries.
2016-02-19Require request_insecure_environment to be called from the mod's main scopeShadowNinja
Previously you could steal a secure environment from a trusted mod by wrapping request_insecure_environment with some code like this: local rie_cp = minetest.request_insecure_environment local stolen_ie function minetest.request_insecure_environment() local ie = rie_cp() stolen_ie = stolen_ie or ie return ie end
2016-02-11Initialize facedir and wallmounted tables only once.Diego Martinez
This makes the functions a bit faster since they don't have to recreate the tables every invocation, and makes the code more readable. Also, document `wallmounted_to_dir`. The function was implemented but not documented in `lua_api.txt`.
2016-02-11Add '/clearobjects quick'Kahrl
2016-01-29New timer design.Auke Kok
I could honestly not make much sense of the timer implementation that was here. Instead I've implemented the type of timer algorithm that I've used before, and tested it instead. The concept is extremely simple: all timers are put in an ordered list. We check every server tick if any of the timers have elapsed, and execute the function associated with this timer. We know that many timers by themselves cause new timers to be added to this list, so we iterate *backwards* over the timer list. This means that new timers being added while timers are being executed, can never be executed in the same function pass, as they are always appended to the table *after* the end of the table, which we will never reach in the current pass over all the table elements. We switch time keeping to minetest.get_us_time(). dtime is likely unreliable and we have our own high-res timer that we can fix if it is indeed broken. This removes the need to do any sort of time keeping.
2016-01-29Clocksource: use a better clock if available.Auke Kok
clock_gettime() is a far better clock than gettimeofday(). Even better than clock_gettime() is that you can select either CLOCK_MONOTONIC, or even CLOCK_MONOTONIC_RAW. These clocks offer high precision time. And the _RAW variant will never roll back due to NTP drift or daylight savings, or otherwise. I've adjusted this code to select the right clock method auto- matically based on what's available in the OS. This means that if you're running a very old linux version, MacOS or other, you will automatically get the best clocksource available. I've tested all Linux clocksources by selectively compiling and running a 10k+ timer test suite. In all cases I confirmed that the 3 POSIX Linux clocksources worked properly, and were selected properly. I've modified the OS X compile path to use the high-res clock source for all time functions, but I can't confirm it works or that it compiles. As for WIN32, I confirmed that the used clocksource is indeed a Monotonic clocksource, so good news: that code section appears to be exactly what it should be.
2016-01-20Allow per-tiles culling.Auke Kok
Backface culling is enabled by default for all tiles, as this is how the lua parser initializes each tiledef. We revert to always using the value from the tiledef since it is always read and serialized. Mods that wish to enable culling for e.g. mesh nodes, now can specify the following to enable backface culling: tiles = {{ name = "tex.png", backface_culling = true }}, Note the double '{' and use of 'name' key here! In the same fashion, backface_culling can be disabled for any node now. I've tested this against the new door models and this properly allows me to disable culling per node. I've also tested this against my crops mod which uses mesh nodes where culling needs to be disabled, and tested also with plantlike drawtype nodes where we want this to continue to be disabled. No default setting has changed. The defaults are just migrated from nodedef.cpp to c_content.cpp.
2016-01-18Show infotext with description for item entitiesRealBadAngel
2016-01-16corrected minetest.pos_to_string()Pinky Snow
corrected this bit reflect the function properly.
2016-01-11Mapgen: Various fixes and improvementsparamat
Lua_api.txt: Document 'minetest.registered_biomes' Minimal: Remove 'mapgen_air' alias Cavegen: Add fallback node for 'mapgen_ice' Dungeongen: Add fallback node for 'mapgen_river_water_source' Mgv5: Remove unnecessary '#include util/directiontables.h' Add missing 'this->'s in makeChunk() Mgv6: Edit empty line formatting Remove leading spaces in makeChunk() Add missing spaces after 'for' and 'if' Mgv7: Edit empty line formatting
2016-01-09fixed spellingPinky Snow
Fixed spelling mistake!
2016-01-09Clarified what get_node does.Robert Zenz
2016-01-09Update lua_api.txtslemonide
set_sky does work with on_joinplayer
2016-01-07Liquids: Flow into and destroy 'floodable' nodesparamat
Add new node property 'floodable', default false Define "air" as floodable = true in C++ and lua
2016-01-03Made it more clear that "[combine" does accept a list of files.Robert Zenz
2015-12-25Add missing documentation of automatic_face_movement_max_rotation_per_sec ↵Sapier
entity parameter
2015-12-15Add option to give every object a nametagBlockMen
or change the nametag text of players
2015-12-07lua_api.txt: add blank lines before * listsest31
If rendered as markdown, lists need a blank line before them so that they are recognized as such.
2015-12-07Mapgen: Add propagate_shadow bool to calcLightingparamat
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-06Fix spelling of noise_thresholdJun Zhang
2015-12-02Document limitations of minetest.get_password_hashest31
2015-12-02Add on_secondary_use when right clicking an item in the airAlex Ford
2015-11-29Lua_api.txt: Add documentation for biome definitionparamat
2015-11-08Add LuaSecureRandomest31
2015-11-07Improve LuaVoxelManip documentationkwolekr
2015-11-07Add support for audio feedback if placing node failedBlockMen
2015-11-05Schematics: Add core.place_schematic_on_vmanip APIkwolekr
Fix memory leak in minetest.place_schematic Slightly refactor Schematic code
2015-11-02Add callback parameter for core.emerge_area()kwolekr
2015-10-25Add option to disable backface culling for modelsBlockMen
- Disabled by default (except players) - Fixes #2984
2015-10-24Improve Lua settings menuPilzAdam
* Add key settings to setting table and ignore them later This way they are added to the auto-generated minetest.conf.example * Add flags type * Add input validation for int, float and flags * Break in-game graphic settings into multiple sections * Parse settingtpes.txt in mods and games * Improve description for a lot of settings * Fix typos and wording in settingtypes.txt * Convert language setting to an enum
2015-10-23Decoration API: Add flag for placement on liquid surfaceparamat
Add findLiquidSurface() function to mapgen.cpp Update lua_api.txt
2015-10-22Add more ways to pass data to check_player_privsRobert Zenz
The callback can now be invoked with either the player object or name as the first parameter, and with either a table or a list of strings, like this: minetest.check_player_privs(player_name, { shout = true, fly = true }) minetest.check_player_privs(player_name, "shout", "fly") minetest.check_player_privs(player, { shout = true, fly = true }) minetest.check_player_privs(player, "shout", "fly")
2015-10-18ABMs: Make catch-up behaviour optionalparamat
Default is true for backwards compatibility Update lua_api.txt
2015-10-14Refactor loggingShadowNinja
- Add warning log level - Change debug_log_level setting to enumeration string - Map Irrlicht log events to MT log events - Encapsulate log_* functions and global variables into a class, Logger - Unify dstream with standard logging mechanism - Unify core.debug() with standard core.log() script API
2015-10-04Add new ContentParamType2 "CPT2_DEGROTATE"est31
This might break some mods, but it is important for all uses of the param2 to be documented. This doesn't need a serialisation version or network protocol version change, as old clients will still work on new servers, and it is bearable to have new clients getting non rotated plants on old servers.
2015-10-04doc: Update node callback documentationkwolekr
2015-10-02Add get_biome_id(biome_name) callbackDuane Robertson
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-09-26Clarify radii and distance types in documentationTim
Because not all circles are round: * circles using an euclidean metric are what we usually call "round" * circles using a maximum metric look like euclidean rectangles with equal adjacent sides (squares) * circles using a manhattan metric look like an euclidean right angled rhombus (squares, but 45° rotated to the former one) [ci skip]
2015-09-23Add /emergeblocks command and core.emerge_area() Lua APIkwolekr
2015-09-21lua_api.txt: fix typoest31
Thanks to @kaadmy (NeD) for pointing this out.
2015-09-17Ore: Add puff ore typekwolekr
2015-09-13Ore: Add ore sheet column height range selectionkwolekr
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-08Add more information about how get_node_light works.Robert Zenz