Simplify some selectionboxes significantly.

This commit is contained in:
Aaron Suen 2019-03-30 21:23:02 -04:00
parent c83e3288d7
commit 85f87d1c17
5 changed files with 15 additions and 10 deletions

View File

@ -84,7 +84,12 @@ function nodecore.extend_item(name, func)
minetest.register_item(":" .. name, copy)
end
function nodecore.fixedbox(...) return {type = "fixed", fixed = {...}} end
function nodecore.fixedbox(x, ...)
return {type = "fixed", fixed = {
x or {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
...
}}
end
function nodecore.interact(player)
if type(player) ~= "string" then

View File

@ -43,6 +43,9 @@ local basedef = {
{0.25, -0.5, -3/8, 0.5, 0.25, 1/8},
{-0.25, -0.25, -1/8, 0.25, 0.25, 0.25}
),
selection_box = nodecore.fixedbox(
{-0.5, -0.5, -3/8, 0.5, 0.5, 1/8}
),
tiles = {
txr,
txr,

View File

@ -31,6 +31,9 @@ local basedef = {
{-0.25, -0.25, 3/8, 0.25, 0.25, 0.5},
{-0.5, -0.25, -0.25, -3/8, 0.25, 0.25}
),
selection_box = nodecore.fixedbox(
{-3/8, -0.5, -0.5, 0.5, 0.5, 3/8}
),
tiles = {
txr,
txr,

View File

@ -99,9 +99,7 @@ minetest.register_node(modname .. ":handle", {
{3/8, 1/4, -0.5, 0.5, 3/8, 0.5},
{-0.5, 3/8, -1/8, 0.5, 0.5, 1/8}
),
selection_box = nodecore.fixedbox(
{-0.5, -0.5, -0.5, 0.5, 3/8, 0.5}
),
selection_box = nodecore.fixedbox(),
paramtype = "light",
tiles = {
"nc_lode_annealed.png",

View File

@ -20,12 +20,8 @@ minetest.register_node(modname .. ":shelf", {
{7/16, -7/16, -0.5, 0.5, 7/16, -7/16},
{7/16, -7/16, 7/16, 0.5, 7/16, 0.5}
),
selection_box = nodecore.fixedbox(
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
),
collision_box = nodecore.fixedbox(
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
),
selection_box = nodecore.fixedbox(),
collision_box = nodecore.fixedbox(),
tiles = { top, top, side },
groups = {
choppy = 1,