aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0gb.us <0gb.us@0gb.us>2013-10-15 22:17:06 -0700
committerShadowNinja <shadowninja@minetest.net>2013-11-30 13:22:50 -0500
commite605d7025608f8d04cdd6143c6be85e35ef067e3 (patch)
tree8c40c5b16035300f14fa655581c10727e8cbbd59
parent4696c59a5f3ad5884d57c7848207c39950f7052e (diff)
downloadminetest-e605d7025608f8d04cdd6143c6be85e35ef067e3.tar.gz
minetest-e605d7025608f8d04cdd6143c6be85e35ef067e3.tar.bz2
minetest-e605d7025608f8d04cdd6143c6be85e35ef067e3.zip
Assume a selection box for fences
Similar to assuming a selection box for the nodebox drawtype, minetest.register_item() now assumes a selection box for the fencelike drawtype.
-rw-r--r--builtin/misc_register.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua
index bb2c62ab8..aa062d731 100644
--- a/builtin/misc_register.lua
+++ b/builtin/misc_register.lua
@@ -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