add proper selection and collision boxes to slopes

This commit is contained in:
Vanessa Ezekowitz 2014-12-13 18:31:47 -05:00
parent d59a52f8a9
commit 200bfeff4e

View File

@ -2,7 +2,38 @@
local S = homedecor.gettext local S = homedecor.gettext
-- Corner shingle nodes, courtesy Bas080 local slope_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
{-0.5, -0.25, -0.25, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.25, 0.5},
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
}
}
local ocorner_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
{-0.5, -0.25, -0.25, 0.25, 0, 0.5},
{-0.5, 0, 0, 0, 0.25, 0.5},
{-0.5, 0.25, 0.25, -0.25, 0.5, 0.5}
}
}
local icorner_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, -- NodeBox5
{-0.5, -0.5, -0.25, 0.5, 0, 0.5}, -- NodeBox6
{-0.5, -0.5, -0.5, 0.25, 0, 0.5}, -- NodeBox7
{-0.5, 0, -0.5, 0, 0.25, 0.5}, -- NodeBox8
{-0.5, 0, 0, 0.5, 0.25, 0.5}, -- NodeBox9
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}, -- NodeBox10
{-0.5, 0.25, -0.5, -0.25, 0.5, 0.5}, -- NodeBox11
}
}
homedecor.register_outer_corner = function(modname, subname, groups, slope_image, description) homedecor.register_outer_corner = function(modname, subname, groups, slope_image, description)
minetest.register_node(modname..":shingle_outer_corner_" .. subname, { minetest.register_node(modname..":shingle_outer_corner_" .. subname, {
@ -13,15 +44,8 @@ homedecor.register_outer_corner = function(modname, subname, groups, slope_image
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
walkable = true, walkable = true,
selection_box = { selection_box = ocorner_cbox,
type = "fixed", collision_box = ocorner_cbox,
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
{-0.5, -0.25, -0.25, 0.25, 0, 0.5},
{-0.5, 0, 0, 0, 0.25, 0.5},
{-0.5, 0.25, 0.25, -0.25, 0.5, 0.5}
}
},
groups = groups, groups = groups,
}) })
end end
@ -39,6 +63,7 @@ homedecor.register_inner_corner = function(modname, subname, groups, slope_image
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5} fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
}, },
collision_box = icorner_cbox,
groups = groups, groups = groups,
}) })
end end
@ -52,15 +77,8 @@ homedecor.register_slope = function(modname, subname, recipeitem, groups, slope_
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
walkable = true, walkable = true,
selection_box = { selection_box = slope_cbox,
type = "fixed", collision_box = slope_cbox,
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
{-0.5, -0.25, -0.25, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.25, 0.5},
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
}
},
groups = groups, groups = groups,
}) })