mirror of
https://github.com/minetest/minetest.git
synced 2024-12-02 04:23:45 +01:00
Find nodes in area (under air): Raise volume limit and document it
This commit is contained in:
parent
c2e39b9363
commit
c683e050d4
@ -2578,9 +2578,11 @@ and `minetest.auth_reload` call the authetification handler.
|
|||||||
* `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
|
* `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
|
||||||
* First return value: Table with all node positions
|
* First return value: Table with all node positions
|
||||||
* Second return value: Table with the count of each node with the node name as index
|
* Second return value: Table with the count of each node with the node name as index
|
||||||
|
* Area volume is limited to 4,096,000 nodes
|
||||||
* `minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames)`: returns a list of positions
|
* `minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames)`: returns a list of positions
|
||||||
* `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
|
* `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
|
||||||
* Return value: Table with all node positions with a node air above
|
* Return value: Table with all node positions with a node air above
|
||||||
|
* Area volume is limited to 4,096,000 nodes
|
||||||
* `minetest.get_perlin(noiseparams)`
|
* `minetest.get_perlin(noiseparams)`
|
||||||
* `minetest.get_perlin(seeddiff, octaves, persistence, scale)`
|
* `minetest.get_perlin(seeddiff, octaves, persistence, scale)`
|
||||||
* Return world-specific perlin noise (`int(worldseed)+seeddiff`)
|
* Return world-specific perlin noise (`int(worldseed)+seeddiff`)
|
||||||
|
@ -655,14 +655,10 @@ int ModApiEnvMod::l_find_nodes_in_area(lua_State *L)
|
|||||||
sortBoxVerticies(minp, maxp);
|
sortBoxVerticies(minp, maxp);
|
||||||
|
|
||||||
v3s16 cube = maxp - minp + 1;
|
v3s16 cube = maxp - minp + 1;
|
||||||
|
// Volume limit equal to 8 default mapchunks, (80 * 2) ^ 3 = 4,096,000
|
||||||
/* Limit for too large areas, assume default values
|
if ((u64)cube.X * (u64)cube.Y * (u64)cube.Z > 4096000) {
|
||||||
* and give tolerances of 1 node on each side
|
|
||||||
* (chunksize * MAP_BLOCKSIZE + 2)^3 = 551368
|
|
||||||
*/
|
|
||||||
if ((u64)cube.X * (u64)cube.Y * (u64)cube.Z > 551368) {
|
|
||||||
luaL_error(L, "find_nodes_in_area(): area volume"
|
luaL_error(L, "find_nodes_in_area(): area volume"
|
||||||
" exceeds allowed value of 551368");
|
" exceeds allowed value of 4096000");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -723,14 +719,10 @@ int ModApiEnvMod::l_find_nodes_in_area_under_air(lua_State *L)
|
|||||||
sortBoxVerticies(minp, maxp);
|
sortBoxVerticies(minp, maxp);
|
||||||
|
|
||||||
v3s16 cube = maxp - minp + 1;
|
v3s16 cube = maxp - minp + 1;
|
||||||
|
// Volume limit equal to 8 default mapchunks, (80 * 2) ^ 3 = 4,096,000
|
||||||
/* Limit for too large areas, assume default values
|
if ((u64)cube.X * (u64)cube.Y * (u64)cube.Z > 4096000) {
|
||||||
* and give tolerances of 1 node on each side
|
|
||||||
* (chunksize * MAP_BLOCKSIZE + 2)^3 = 551368
|
|
||||||
*/
|
|
||||||
if ((u64)cube.X * (u64)cube.Y * (u64)cube.Z > 551368) {
|
|
||||||
luaL_error(L, "find_nodes_in_area_under_air(): area volume"
|
luaL_error(L, "find_nodes_in_area_under_air(): area volume"
|
||||||
" exceeds allowed value of 551368");
|
" exceeds allowed value of 4096000");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user