add support for group `air_flowable`.

replace the placeholder api functionality for checking whether air flows
through a node, with something that relies on a dedicated group (instead
of a hard-coded list in the api code).
This commit is contained in:
trans_soup 2023-10-16 21:40:57 +02:00
parent 6ac310f674
commit 9a3afd6d5a
1 changed files with 4 additions and 11 deletions

View File

@ -11,20 +11,13 @@ end
-- probably temporary; will probably use groups for this later.
local air_flowable = {
"air",
"bg_tree:leaves",
"bg_tree:leaves_alive",
}
function blockgame.air_flows_through (pos, node)
node = node or minetest.get_node(pos)
local node_name = node.name
for _, name in pairs(air_flowable) do
if name == node_name then return true end
end
return false
if node_name == "air" then return true end
return minetest.get_item_group(node_name, "air_flowable") > 0
end