Set full node collision box for bushy leaves

When a node has no collision box it uses the node box as the collision
box. This effect made walking on nodes modified by this mod difficult.

This patch explicitly sets a collision box with the size of a full node
for modified nodes. This makes the “bushy leaves” effect purely visual;
it does not affect collision differently than if the mod is not loaded.
This commit is contained in:
Mikita Wiśniewski 2022-05-09 10:47:12 +07:00 committed by Nils Dagsson Moskopp
parent 3f89a5daa5
commit e16e015cd8
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,11 @@ local node_box_bushy_leaves = {
},
}
local node_box_full_node = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, 8/16, 8/16 },
}
local get_node_box = function(node_name, node_def)
local node_box
if (
@ -52,6 +57,7 @@ local add_bushy_leaves = function()
{
drawtype = "nodebox",
node_box = node_box,
collision_box = node_box_full_node,
}
)
end