Skip to content

Commit

Permalink
Assume a selection box for fences
Browse files Browse the repository at this point in the history
Similar to assuming a selection box for the nodebox drawtype, minetest.register_item() now assumes a selection box for the fencelike drawtype.
  • Loading branch information
0gb-us authored and ShadowNinja committed Nov 30, 2013
1 parent 4696c59 commit e605d70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/misc_register.lua
Expand Up @@ -106,6 +106,11 @@ function minetest.register_item(name, itemdef)
-- 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
elseif itemdef.drawtype == "fencelike" and not itemdef.selection_box then
itemdef.selection_box = {
type = "fixed",
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
}
end
setmetatable(itemdef, {__index = minetest.nodedef_default})
minetest.registered_nodes[itemdef.name] = itemdef
Expand Down

0 comments on commit e605d70

Please sign in to comment.