Commit Graph

615 Commits (e98d421aff046a2d9a9b87516779603dc170b209)

Author SHA1 Message Date
Maksim Gamarnik 0e40320816 Merge 2016-05-07 23:57:42 +03:00
paramat a238027e59 Lua_api.txt: Add warnings of l-system lighting bug 2016-05-06 00:29:16 +01:00
Maksim Gamarnik d5854e5cf7 Merge minetest commits / WIP!
Java part WIP, pls, use prev commits!
2016-04-29 10:11:25 +03:00
rubenwardy 21e176b7a0 Builtin: Add basic_privs setting 2016-04-28 07:19:07 +01:00
SmallJoker 6569e39099 tile.cpp: Automatically upscale lower resolution texture 2016-04-25 06:39:32 +01:00
Maksim Gamarnik 6d3bdc5a7d Merge 2016-04-12 21:28:50 +03:00
rubenwardy cbff06cadc Hud: Fix offset being ignored by inventory bar 2016-04-10 23:54:23 -04:00
raymoo 900d0fdfb6 Document hpchange callback ordering thing (#3981)
Document hpchange callback ordering thing

Callbacks registered by register_on_player_hpchange are ordered so that non-modifiers are called after modifiers are called. Credit to @TeTpaAka who mentioned this previously-undocumented feature in #3799.

See also commit

aa13baa30a45b0f834c23bd5c0407895eb8ec0ee "Add minetest.register_on_player_hpchange"
2016-04-10 13:52:18 +02:00
Samuel Sieb 12a67a4f51 Clearer explanation of [colorize with alpha 2016-04-07 03:55:17 -04:00
Samuel Sieb b378092691 Add an option to colorize to respect the destination alpha
Also, rework the colorizing code to be more efficient.
2016-04-03 04:24:28 -04:00
Maksim Gamarnik f56e578960 Merge remote-tracking branch 'upstream1/master' 2016-03-21 01:45:56 +02:00
est31 869c043af8 lua_api.txt: improve vector documentation
Before it rendered very badly in HTML.
Also point out what vector.round does.
2016-03-19 15:34:51 +01:00
Maksim Gamarnik 8f6ddcc57c Merge branch 'upstream/master' 2016-03-14 11:44:17 +02:00
Auke Kok 14a15265db Allow nodes to specify which sides to connect to.
NDT_CONNECTED attempts to connect to any side of nodes that it can
connect to, which is troublesome for FACEDIR type nodes that generally
may only have one usable face, and can be rotated.

We introduce a node parameter `connect_sides` that is valid for
any node type. If specified, it lists faces of the node (in "top",
"bottom", "front", "left", "back", "right", form, as array) that
connecting nodeboxes can connect to. "front" corresponds to the south
facing side of a node with facedir = 0.

If the node is rotatable using *simple* FACEDIR, then the attached
face is properly rotated before checking. This allows e.g. a chest
to be attached to only from the rear side.
2016-03-12 12:08:17 -05:00
Auke Kok f11d473497 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
Auke Kok 9cf7a3ef96 Add consistent monotonic day counter - get_day_count()
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-09 01:45:23 +01:00
ShadowNinja 3e9b7d3da7 Add AreaStore custom ID API 2016-03-07 16:33:20 -05:00
ShadowNinja e666e6c109 Implement AreaStore serialization 2016-03-07 16:33:20 -05:00
ShadowNinja 9ae267cae5 Simplify AreaStore ID management 2016-03-07 16:33:20 -05:00
est31 fd7cbba94b Add minetest.register_lbm() to run code on block load only 2016-03-07 19:54:26 +01:00
Maksim Gamarnik 00b6a43c2e Merge 2016-03-04 16:30:16 +02:00
paramat 367d489b5e Decoration API: Allow force_placement of simple decorations 2016-03-04 02:38:55 +00:00
Jeija 9f33a11cea Require minetest.request_http_api to be called from the mod's main scope
Fixes #3764
2016-03-03 22:42:00 +01:00
Maksim Gamarnik 76ef29709c v. 1.1.2-pre | build1 2016-02-23 06:40:14 +02:00
Maksim Gamarnik 40b3667bd2 Merge remote-tracking branch 'upstream/master' 2016-02-23 00:38:30 +02:00
Jeija 6128dc7a07 Add Lua interface to HTTPFetchRequest
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-22 15:39:41 +01:00
ShadowNinja 6cf6c8f25d Require request_insecure_environment to be called from the mod's main scope
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-19 14:52:10 +00:00
Maksim Gamarnik d7c0fad71f Merge Minetest commits 2016-02-11 22:35:23 +02:00
Diego Martinez 5c79a36617 Initialize facedir and wallmounted tables only once.
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-11 04:23:17 +00:00
Kahrl 02cbda530b Add '/clearobjects quick' 2016-02-11 04:22:58 +00:00
Maksim Gamarnik 2520ca3ed1 Merge branch 'master' of https://github.com/minetest/minetest 2016-01-31 20:57:03 +02:00
Auke Kok b37d266632 New timer design.
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-29 01:04:51 -05:00
Auke Kok fcec96372d Clocksource: use a better clock if available.
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-29 00:58:08 -05:00
Auke Kok 7fa4045b59 Allow per-tiles culling.
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-20 00:36:48 +00:00
RealBadAngel 40ce082cfb Show infotext with description for item entities 2016-01-18 17:21:41 +00:00
Pinky Snow c4a877903b corrected minetest.pos_to_string()
corrected this bit reflect the function properly.
2016-01-16 13:06:41 +00:00
paramat a50cbcb7f6 Mapgen: Various fixes and improvements
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-11 01:32:20 +00:00
Pinky Snow d17619fb09 fixed spelling
Fixed spelling mistake!
2016-01-09 02:29:07 +00:00
Robert Zenz 931463a1f9 Clarified what get_node does. 2016-01-09 01:07:03 +00:00
slemonide 41b0bfff33 Update lua_api.txt
set_sky does work with on_joinplayer
2016-01-09 01:06:45 +00:00
paramat ce609f9e68 Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false
Define "air" as floodable = true in C++ and lua
2016-01-07 05:57:19 +00:00
Robert Zenz 33956c3d39 Made it more clear that "[combine" does accept a list of files. 2016-01-03 01:05:04 +01:00
Maksim Gamarnik 23614e9479 Merge
I have not tested this
2015-12-28 11:26:50 +02:00
Sapier ff88067514 Add missing documentation of automatic_face_movement_max_rotation_per_sec entity parameter 2015-12-25 14:11:39 +01:00
BlockMen 8b2e696093 Add option to give every object a nametag
or change the nametag text of players
2015-12-15 23:32:19 +01:00
Maksim Gamarnik ba2e36fd37 Merge 2015-12-09 12:56:21 +02:00
est31 32a68076a2 lua_api.txt: add blank lines before * lists
If rendered as markdown, lists need a blank line before them
so that they are recognized as such.
2015-12-07 07:27:51 +01:00
paramat 26728947bc 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
Maksim Gamarnik 1797862bf9 Merge 2015-12-06 15:00:12 +02:00
Jun Zhang 3c28fc24a8 Fix spelling of noise_threshold 2015-12-06 11:38:03 +01:00
est31 ee0564abf5 Document limitations of minetest.get_password_hash 2015-12-02 18:32:14 +01:00
Alex Ford 3d8a7bc124 Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
paramat 6daea5adfc Lua_api.txt: Add documentation for biome definition 2015-11-29 21:55:58 +00:00
Maksim Gamarnik bcf249297c Merge last Minetest commits 2015-11-10 20:29:00 +02:00
Maksim Gamarnik 919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
est31 a61208d92d Add LuaSecureRandom 2015-11-08 15:57:15 -05:00
kwolekr 897caf3178 Improve LuaVoxelManip documentation 2015-11-07 11:59:24 -05:00
BlockMen 7477ba044c Add support for audio feedback if placing node failed 2015-11-07 13:23:38 +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 4072700558 Add callback parameter for core.emerge_area() 2015-11-02 18:43:09 -05:00
BlockMen 0e8e40eaa9 Add option to disable backface culling for models
- Disabled by default (except players)
- Fixes #2984
2015-10-25 12:06:08 +01:00
PilzAdam 2fb30ef4d3 Improve Lua settings menu
* 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-24 19:39:15 +02:00
paramat ae975d7c91 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
Robert Zenz b52fd16e28 Add more ways to pass data to check_player_privs
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-22 19:55:48 +02:00
paramat d21809ec2e ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility
Update lua_api.txt
2015-10-18 16:42:59 +01:00
ShadowNinja 677ab7463d Refactor logging
- 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-14 01:03:54 -04:00
est31 e2613ec422 Add new ContentParamType2 "CPT2_DEGROTATE"
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-04 23:59:41 +02:00
kwolekr 726f62097c doc: Update node callback documentation 2015-10-04 15:34:56 -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
Tim 0b892a0499 Clarify radii and distance types in documentation
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-26 21:28:50 +02:00
kwolekr 23316c9f92 Add /emergeblocks command and core.emerge_area() Lua API 2015-09-23 15:56:24 -04:00
est31 3b175acadd lua_api.txt: fix typo
Thanks to @kaadmy (NeD) for pointing this out.
2015-09-21 18:10:05 +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
Robert Zenz cd033fc5f4 Add more information about how get_node_light works. 2015-09-08 21:14:56 +02:00
est31 9721b4cf60 Bump version to 0.4.13 2015-08-20 04:02:00 +02:00
kwolekr 925187a32b minimap: Add ability to disable from server 2015-08-13 15:05:48 -04:00
rubenwardy 3a5596ccc8 Fix segfaults caused by the Environment not being initialized yet 2015-08-09 23:36:55 +02:00
est31 2bebf6466b Actually document what minetest.is_protected should do 2015-08-02 19:09:55 +02:00
est31 d4a7cfcd71 Add AreaStore data structure 2015-07-27 06:42:56 +02:00
est31 713002778f Optional reconnect functionality
Enable the server to request the client to reconnect.

This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
2015-07-23 07:38:13 +02:00
Robert Zenz 85f7c44568 Add note that chat messages can be marked as handled. 2015-07-22 05:43:30 +02:00
est31 93d11fe669 Document game main menu image system 2015-07-21 17:17:46 +02:00
Elia Argentieri 44d030306e Added get_player_velocity() method. Fixes #1176 2015-07-20 05:40:44 +02:00
RealBadAngel dd9ca2e7ed Fix relief mapping issues 2015-07-16 15:36:48 +02:00
paramat 3b67110599 Biome API decorations: 'spawnby' searches a 3D neighbourhood
The neighbours checked are the 8 nodes horizontally surrounding the decoration base
and the 8 nodes horizontally surrounding the ground node below the decoration
2015-07-08 22:44:10 +01:00
TeTpaAka af7af11b4a Fix bug when craft input isn't replaced 2015-06-22 19:30:35 +02:00
MirceaKitsune ee7dfd7ba0 Fix some issues with animations, and allow non-looped animations to be defined 2015-06-22 01:53:38 +02:00
est31 571e159a1a Add list-rings
Adds list-rings, a method to implement item sending between inventories via shift-click.
Nice insider feature: a ring consisting of a single inventory list serves as nice clean-up method.
Also adds them to minimal game, and the standard inventory.
Craft output slots are not supported.
2015-06-16 14:51:26 +02:00
TeTpaAka 14b9820f48 Add minetest.register_on_player_hpchange 2015-06-13 19:40:31 +02:00
TeTpaAka db4fc8326e Add return list of individual counts to find_node_in_area 2015-06-13 19:39:18 +02:00
TeTpaAka 76c89a3f84 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-31 23:21:45 +10:00
kwolekr 482b1c3b13 SAPI/Noise: Add PerlinNoiseMap:getMapSlice() function
This adds the ability to grab 'slices' of noise calculated by PerlinNoiseMap.
Retrieving smaller slices of noise from the computation result as needed
optimizes memory usage while maintaining a reasonable amount of CPU overhead.
2015-05-31 23:20:49 +10:00
kwolekr c98bc68584 Add optional buffer param for bulk data array writes in Lua 2015-05-31 23:20:45 +10:00
kwolekr 3793a8ee42 SAPI: Accept either ARGB8 table or ColorString to specify colors 2015-05-31 23:20:32 +10:00
ShadowNinja fc80cc0daf Add core.get_dir_list
Conflicts:
	builtin/mainmenu/tab_texturepacks.lua
2015-05-31 23:20:28 +10:00
ShadowNinja f52eb6a064 Add core.request_insecure_environment() 2015-05-31 23:17:52 +10:00
ShadowNinja f683d0066d Add core.mkdir 2015-05-31 23:17:48 +10:00
ShadowNinja 3a97d94aa9 Add mod security
Due to compatibility concerns, this is temporarily disabled.
2015-05-31 23:17:44 +10:00
TeTpaAka 7858734443 Generalize core.get/set_nametag_color into core.get/set_nametag_attributes 2015-05-31 23:16:23 +10:00
Brandon b070300551 Add minetest.register_on_punchplayer 2015-05-31 23:16:16 +10:00
TeTpaAka 3b1900abcb Add get and set functions for the nametag color 2015-05-31 23:16:13 +10:00
Novatux 274181bee5 Add code to support raillike group names
Conflicts:
	builtin/game/misc.lua
2015-05-31 23:15:49 +10:00
est31 50e023ff42 is_player() is no player-only function 2015-05-31 23:14:11 +10: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 793f960e04 SAPI/Noise: Add PerlinNoiseMap:getMapSlice() function
This adds the ability to grab 'slices' of noise calculated by PerlinNoiseMap.
Retrieving smaller slices of noise from the computation result as needed
optimizes memory usage while maintaining a reasonable amount of CPU overhead.
2015-05-17 04:04:17 -04:00
kwolekr f560198cd7 Add optional buffer param for bulk data array writes in Lua 2015-05-17 00:07:45 -04:00
kwolekr 5292177986 SAPI: Accept either ARGB8 table or ColorString to specify colors 2015-05-16 20:15:03 -04:00
ShadowNinja d85feedccc Add core.get_dir_list 2015-05-16 18:33:22 -04:00
ShadowNinja 2dd64f03da Add core.request_insecure_environment() 2015-05-16 18:33:19 -04:00
ShadowNinja 310295c511 Add core.mkdir 2015-05-16 18:32:37 -04:00
ShadowNinja 1008aefa8c Add mod security
Due to compatibility concerns, this is temporarily disabled.
2015-05-16 18:32:31 -04:00
TeTpaAka 676750bd57 Generalize core.get/set_nametag_color into core.get/set_nametag_attributes 2015-05-15 16:21:01 -04:00
Brandon aeaeed77e7 Add minetest.register_on_punchplayer 2015-05-15 11:09:55 +02:00
TeTpaAka 888e2f9b45 Add get and set functions for the nametag color 2015-05-15 11:03:27 +02:00
kwolekr 19f7ff2ac8 Schematics: Add per-node force placement option 2015-05-13 17:01:54 +10:00
kwolekr 4d5237fc9f Schematics: Add indent-with-space option for schematic Lua table serialization 2015-05-13 17:01:19 +10:00
kwolekr ab896a72b3 NodeResolver: Remove NodeResolveMethod
This simplifies NodeResolver logic and makes some interfaces cleaner.
2015-05-13 17:01:16 +10:00
kwolekr bd168fd717 Add core.find_nodes_with_meta() script API 2015-05-13 17:00:59 +10:00
Novatux 84334c37cc Add code to support raillike group names 2015-05-12 20:48:55 +02:00
est31 de86d6dabf is_player() is no player-only function 2015-05-12 05:52:49 +02:00
kwolekr 4a54c965a5 Schematics: Add per-node force placement option 2015-05-09 18:44:00 -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 cba840d188 Add core.find_nodes_with_meta() script API 2015-05-05 16:21:59 -04:00
ShadowNinja 126ded5c24 Add minetest.global_exists() 2015-04-21 22:58:37 +02:00
kwolekr 6495b9b57b Ore: Add biomes parameter 2015-04-20 20:25:33 -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
est31 5119498ae2 Document for api functions that rely on current_modname, that it doesn't work when not loading mods 2015-04-08 23:05:26 +02:00
kwolekr 55d3aa7960 Schematics: Prepend mod path to relative schematic filepaths 2015-04-08 00:28:56 -04: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
ShadowNinja dd1c4e3716 Document nil player as being allowed for can_dig 2015-03-27 15:11:28 -04:00
paramat c4d375a253 lua_api/l_mapgen: generate_ores/decorations: make p1, p2 optional 2015-03-24 18:07:29 +00: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
Loic Blot 7caacf745b Add a Lua call to do damages / heals 2015-03-18 14:52:35 +01:00
paramat 6817647244 lua_api/l_mapgen: Fix overlapping areas of minetest.generate_ores/decorations 2015-03-11 03:36:39 +00:00
paramat be0c4804a5 Biome API: Enable decorations placed on water
Add schematic decoration force placement flag
2015-03-06 03:32:15 +00:00
BlockMen 08d843e1c2 Improve group-based connection between raillike nodes 2015-03-05 23:24:32 +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
rubenwardy 01954fdc73 Wrap lines longer than 80 characters in lua_api.txt ...and minor formating changes 2015-02-27 13:41:17 +10: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
Perttu Ahola bb4840d977 Bump version to 0.4.12 2015-02-18 23:50:01 +01:00
rubenwardy 14ad8f26bb Fix minetest.item_eat's replace_with_item, fixes #2292 2015-02-16 10:24:19 +01:00
TriBlade9 91f12acc60 Added ratio argument to colorize, removed the weird alpha-based ratio. 2015-01-20 22:56:20 +10: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
kwolekr 94563e9837 builtin: Unify register wrapper functions and wrap clear_registered_* functions too 2015-01-13 12:36:05 -05:00
paramat b22e48d3a7 Lua-api.txt: Document that paramtype='light' results in light propagation with attenuation and is essential for a light source to spread it's light 2015-01-11 22:30:28 -05:00
ShadowNinja a16be38b0d Add registered_ores and registered_decorations 2015-01-05 18:24:15 -05:00
kwolekr 5370bf9a50 Add minetest.generate_ores() and minetest.generate_decorations() 2015-01-04 22:38:48 -05:00
Craig Robbins 451feb2b70 Remove freezemelt documentation from lua_api.txt 2015-01-04 21:53:25 +10:00
kwolekr 1c2805b733 Add warning about using deprecated fields in Mapgen API and update docs 2015-01-04 03:24:40 -05:00
Wuzzy 22f202d248 Rewrite lua_api.txt into Markdown format
Just Markdown, no variant of it. File name intentionally
not changed to “lua_api.md” because of fear to break references
to that file. The file can still be renamed later.
2015-01-03 00:48:38 -05:00
Diego Martínez cf4ce127a0 Fix documentation for string functions 2014-12-30 00:42:50 -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
kwolekr 3814cafc24 LuaItemStack: Fix and document behavior of set_name, set_count, set_wear, set_metadata 2014-12-28 23:59:24 -05:00
kwolekr 4437065263 Decoration: Add height_min and height_max parameters
Also set default height_min/height_max to -31000 and 31000,
respectively, for ore and biomes
2014-12-28 22:37:27 -05:00
kwolekr c4a39d536f Ore: Add Vein ore type 2014-12-28 21:17:12 -05:00
kwolekr c176763482 Ore: Add Blob ore type 2014-12-28 03:11:00 -05:00
kwolekr 20b9e50aa9 LuaVoxelManip: Add option to allocate blank data 2014-12-27 23:09:36 -05:00
kwolekr a7c93a7160 Bump version to 0.4.11 2014-12-24 22:28:06 -05:00
paramat 63311232cf lua_api.txt: improve noise documentation. Remove previous eased 3D noise format example 2014-12-20 14:50:57 -05:00
Craig Robbins 572eec5567 Fix typo in lua_api.txt 2014-12-15 01:09:17 +10:00
kwolekr a3e54044a9 Add support for NoiseParams in minetest.get_perlin() and add docs on NoiseParams to lua_api.txt 2014-12-12 02:02:44 -05:00
kwolekr fefcad5137 Rename and repurpose minetest.set_noiseparam_defaults to set_noiseparams 2014-12-09 23:44:04 -05:00
kwolekr 4f8d54e249 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
SmallJoker cd74934c42 Add Lua helper functions vector.apply(v) math.sign(x, tolerance) 2014-12-06 10:07:25 +01:00
Ciaran Gultnieks e45c914ce5 Improve Lua API documentation
Changes:
  * Add extra documentation for remove_item.

    This isn't as silly as it sounds: iterate a list containing items with
    unique metadata each, and remove_item the first one you find, placing
    into a different - fine, except the remove will invariably remove the
    wrong one, leading to items being duplicated and others destroyed.

    Arguably it's a bug, and Inventory::removeItem should actually remove
    the item you tell it to. (i.e. if the passed ItemStack has metadata,
    match it). But it seems reasonable to just document the behaviour
    more clearly.

 * Improve string_to_pos documentation.
 * Clarify dig_node documentation (return value).
 * Better on_step documentation.
 * get_nodemeta -> get_meta.
 * Other minor fixes.
2014-11-28 18:35:45 -05:00
SmallJoker e42349140d Add minetest.copy_table(table) To get rid off the "table references"
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-27 18:19:01 +10:00
SmallJoker d3141906d2 Add option 'eased' to NoiseParams
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-13 23:06:38 +10:00
Craig Robbins 642ea2c378 Added names colours and refactored parseColorString() 2014-10-29 03:10:59 -04:00
RealBadAngel 983201a10b Custom collision boxes node property. 2014-10-19 20:48:21 +02:00
RealBadAngel 1c09928344 Add meshnode drawtype. 2014-10-18 16:42:23 +02:00
BlockMen efa7ad44fa Add [colorize modifier 2014-10-05 16:49:52 +02:00
Diego Martínez fcd0cffe0a Add better documentation for alternate drop definition to lua_api.txt. 2014-10-02 16:49:33 -04:00
BlockMen e25777936f Add optional framed glasslike drawtype 2014-10-02 11:35:15 +02:00
TriBlade9 2d6eb3d2f3 Add firelike drawtype 2014-09-21 15:50:27 -04:00
ShadowNinja 33f6656d33 Add compression API 2014-09-20 14:02:54 -04:00
ShadowNinja 0b45befa69 Simplify and optimize schematic replacements 2014-09-11 22:25:06 -04:00
kwolekr ee1fee1578 Add LuaVoxelManip methods: get_node_at() and set_node_at() 2014-09-01 17:33:21 -04:00
kwolekr 9adbca89cd Update Mapgen VoxelManipulator on buffer invalidation 2014-09-01 15:12:22 -04:00
sapier 25da503d04 Remove invalid doc about minetest.get_time_us() 2014-08-25 21:52:52 +02:00
sapier 04d3b7f969 Add missing doc for minetest.get_us_time() 2014-08-25 21:16:32 +02:00
Craig Robbins 8152f54ac6 Fix seg fault if popping from empty stack (L-system trees)
See: https://github.com/minetest/minetest/issues/1525

Background
Wuzzy2: If you attempt to spawn a L-system tree with minetest.spawn_tree, you can make Minetest crash if it is attempted to pop an empty stack.

ShadowNinja: This shouldn't cause a segmentation fault, but it should throw a Lua error

Commit Description
This commit throws a Lua error instead of causing a segmentation fault. The server will still "crash" but will include a Lua backtrace.

L-Systems fix randomness
Unless a random seed is provided (via Lua treedef) seed the PRNG with a different seed for each tree
Resolves: https://github.com/minetest/minetest/issues/1469

Fix l-system crash when treedef random_level not set by Lua
2014-08-23 06:40:27 +02:00
sfan5 bf60cf56ec Add ^[mask texture modifier 2014-08-22 22:42:04 +02:00
rubenwardy 0859915fb4 Correct spelling mistakes in documentation 2014-08-22 20:55:01 +02:00
sapier 4b2e3ceaad Mod profiling support
Config settings:
profiling = true/false (gather statistics)
detailed_profiling = true/false (break mod times to callbacks)

Chat commands:
save_mod_profile saves current statistics in debug.txt and shows on console (on default loglevel)
2014-08-19 22:22:57 +02:00
sfan5 c1170e9791 Rework texture generating code, add texture grouping via ( ... ) 2014-07-29 20:02:56 +02:00
sapier 73907a2c7e Add srollbar formspec element 2014-07-16 15:02:56 +02:00
sapier 9fe198016a Update version numbers for 0.4.10 2014-07-06 22:39:47 +02:00
sfan5 c5b58526ff Fix typos in doc/lua-api.txt 2014-07-05 12:19:55 +02:00
Kahrl 7639c203f5 Fix typo in doc/lua_api.txt 2014-07-05 01:09:53 +02:00
RealBadAngel 1328c078f5 Tooltips rework.
Separate element for tooltips. Delayed showing,
use global color or given ones.
2014-06-24 22:11:47 +02:00
RealBadAngel bbaf49826e Add tooltips for button, imagebutton and checkbox. 2014-06-19 00:22:03 +02:00
ShadowNinja d37ee7bca8 Add success and output return values to chat commands 2014-05-28 18:36:46 -04:00
rubenwardy b7ccc0b817 Add item eat callback 2014-05-26 18:41:58 -04:00