diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-01-23 18:04:58 +0000 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-01-23 19:04:58 +0100 |
commit | 01bc817fe0a59e2e2b20c26d395c5b989c5156c9 (patch) | |
tree | 9434f2ddfeb8da51ee07eac41fe8bc4dba341141 /doc | |
parent | 0425c6b8c888d0ccdf09a371a7415c8b3cb055a3 (diff) | |
download | minetest-01bc817fe0a59e2e2b20c26d395c5b989c5156c9.tar.gz minetest-01bc817fe0a59e2e2b20c26d395c5b989c5156c9.tar.bz2 minetest-01bc817fe0a59e2e2b20c26d395c5b989c5156c9.zip |
Intersects_protection(): Move from Minetest Game to builtin (#6952)
A useful function that applies 'core.is_protected()' to a 3D lattice of
points evenly spaced throughout a defined volume, with a parameter for
the maximum spacing of points.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index d7ea7f79f..27620aa8f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -3413,6 +3413,16 @@ These functions return the leftover itemstack. * `minetest.record_protection_violation(pos, name)` * This function calls functions registered with `minetest.register_on_protection_violation`. +* `minetest.intersects_protection(minp, maxp, player_name, interval) + * Returns a boolean, returns true if the volume defined by `minp` and `maxp` + intersects a protected area not owned by `player_name`. + * Applies `is_protected()` to a 3D lattice of points in the defined volume. + The points are spaced evenly throughout the volume and have a spacing + similar to, but no larger than, `interval`. + * All corners and edges of the defined volume are checked. + * `interval` defaults to 4. + * `interval` should be carefully chosen and maximised to avoid an excessive + number of points being checked. * `minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orient_flags)` * Attempt to predict the desired orientation of the facedir-capable node defined by `itemstack`, and place it accordingly (on-wall, on the floor, or |