Use the nodebox as selection box if it's not set manually
parent
1a5dcfd0c8
commit
2fb0e547a0
|
@ -103,6 +103,10 @@ function minetest.register_item(name, itemdef)
|
||||||
|
|
||||||
-- Apply defaults and add to registered_* table
|
-- Apply defaults and add to registered_* table
|
||||||
if itemdef.type == "node" then
|
if itemdef.type == "node" then
|
||||||
|
-- Use the nodebox as selection box if it's not set manually
|
||||||
|
if itemdef.drawtype == "nodebox" and not itemdef.selection_box then
|
||||||
|
itemdef.selection_box = itemdef.node_box
|
||||||
|
end
|
||||||
setmetatable(itemdef, {__index = minetest.nodedef_default})
|
setmetatable(itemdef, {__index = minetest.nodedef_default})
|
||||||
minetest.registered_nodes[itemdef.name] = itemdef
|
minetest.registered_nodes[itemdef.name] = itemdef
|
||||||
elseif itemdef.type == "craft" then
|
elseif itemdef.type == "craft" then
|
||||||
|
|
|
@ -1589,6 +1589,7 @@ Node definition (register_node)
|
||||||
damage_per_second = 0, -- If player is inside node, this damage is caused
|
damage_per_second = 0, -- If player is inside node, this damage is caused
|
||||||
node_box = {type="regular"}, -- See "Node boxes"
|
node_box = {type="regular"}, -- See "Node boxes"
|
||||||
selection_box = {type="regular"}, -- See "Node boxes"
|
selection_box = {type="regular"}, -- See "Node boxes"
|
||||||
|
^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used
|
||||||
legacy_facedir_simple = false, -- Support maps made in and before January 2012
|
legacy_facedir_simple = false, -- Support maps made in and before January 2012
|
||||||
legacy_wallmounted = false, -- Support maps made in and before January 2012
|
legacy_wallmounted = false, -- Support maps made in and before January 2012
|
||||||
sounds = {
|
sounds = {
|
||||||
|
|
Loading…
Reference in New Issue