Make bushes just decorative (override collision)

Now collision works just like if it was regular leaves/needles node
This commit is contained in:
Mikita Wiśniewski 2022-05-09 10:47:12 +07:00
parent 3f89a5daa5
commit d6d47b2d4c
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,10 @@ local node_box_bushy_leaves = {
{ -4/16,-12/16, 0/16, 4/16, 12/16, 0/16 }, { -4/16,-12/16, 0/16, 4/16, 12/16, 0/16 },
}, },
} }
local node_box_one_node = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
}
local get_node_box = function(node_name, node_def) local get_node_box = function(node_name, node_def)
local node_box local node_box
@ -39,6 +43,7 @@ local get_node_box = function(node_name, node_def)
string.match(node_name, "needles") string.match(node_name, "needles")
) then ) then
node_box = node_box_bushy_leaves node_box = node_box_bushy_leaves
collision_box = node_box_one_node
end end
return node_box return node_box
end end
@ -52,6 +57,7 @@ local add_bushy_leaves = function()
{ {
drawtype = "nodebox", drawtype = "nodebox",
node_box = node_box, node_box = node_box,
collision_box = collision_box,
} }
) )
end end