aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Carmona Varo <ferkiwi@gmail.com>2015-10-02 21:18:40 +0200
committerest31 <MTest31@outlook.com>2015-10-04 03:19:18 +0200
commitb12bdcce348323247811b9a0299e2e9294991d13 (patch)
treed3395ca1a0b759f02e7662b4c2f19b0390e98573
parent20405edb06f44308aae760dc2f4dad5c61e0d30f (diff)
downloadminetest-b12bdcce348323247811b9a0299e2e9294991d13.tar.gz
minetest-b12bdcce348323247811b9a0299e2e9294991d13.tar.bz2
minetest-b12bdcce348323247811b9a0299e2e9294991d13.zip
Added minetest.wallmounted_to_dir
-rw-r--r--builtin/game/item.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index 0f10af8ee..df5bb070d 100644
--- a/builtin/game/item.lua
+++ b/builtin/game/item.lua
@@ -139,6 +139,19 @@ function core.dir_to_wallmounted(dir)
end
end
+function core.wallmounted_to_dir(wallmounted)
+ -- table of dirs in wallmounted order
+ return ({[0] = {x = 0, y = 1, z = 0},
+ {x = 0, y = -1, z = 0},
+ {x = 1, y = 0, z = 0},
+ {x = -1, y = 0, z = 0},
+ {x = 0, y = 0, z = 1},
+ {x = 0, y = 0, z = -1}})
+
+ --indexed into by the wallmounted in question
+ [wallmounted]
+end
+
function core.get_node_drops(nodename, toolname)
local drop = ItemStack({name=nodename}):get_definition().drop
if drop == nil then