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:
parent
6ac310f674
commit
9a3afd6d5a
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue