From 01bc817fe0a59e2e2b20c26d395c5b989c5156c9 Mon Sep 17 00:00:00 2001 From: Paramat Date: Tue, 23 Jan 2018 18:04:58 +0000 Subject: 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. --- doc/lua_api.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc') 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 -- cgit v1.2.3