1
0
mirror of https://github.com/mt-mods/biome_lib.git synced 2025-06-29 06:40:44 +02:00

3 Commits

Author SHA1 Message Date
d65c72d48b don't need the old non-air-above find nodes call anymore
only very old minetest engine lacks the air-above api call
2021-03-25 19:27:38 -04:00
10a1089767 add minimum minetest version key for contentdb 2020-06-03 13:00:01 -04:00
5a910875af fix deprecated function call 2020-04-15 16:59:40 -04:00
2 changed files with 4 additions and 20 deletions

View File

@ -85,7 +85,7 @@ biome_lib.perlin_humidity = PerlinNoise(humidity_seeddiff, humidity_octaves, hum
-- Local functions
local function get_biome_data(pos, perlin_fertile)
local fertility = perlin_fertile:get2d({x=pos.x, y=pos.z})
local fertility = perlin_fertile:get_2d({x=pos.x, y=pos.z})
if type(minetest.get_biome_data) == "function" then
local data = minetest.get_biome_data(pos)
@ -408,25 +408,8 @@ function biome_lib:generate_block_with_air_checking()
local blockhash = minetest.hash_node_position(minp)
if not biome_lib.surface_nodes_aircheck.blockhash then
if type(minetest.find_nodes_in_area_under_air) == "function" then -- use newer API call
biome_lib.surface_nodes_aircheck.blockhash =
minetest.find_nodes_in_area_under_air(minp, maxp, biome_lib.surfaceslist_aircheck)
else
local search_area = minetest.find_nodes_in_area(minp, maxp, biome_lib.surfaceslist_aircheck)
-- search the generated block for air-bounded surfaces the slow way.
biome_lib.surface_nodes_aircheck.blockhash = {}
for i = 1, #search_area do
local pos = search_area[i]
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
if minetest.get_node(p_top).name == "air" then
biome_lib.surface_nodes_aircheck.blockhash[#biome_lib.surface_nodes_aircheck.blockhash + 1] = pos
end
end
end
biome_lib.actioncount_aircheck.blockhash = 1
else

View File

@ -1 +1,2 @@
name = biome_lib
min_minetest_version = 5.2.0