Skip to content

Commit b12bdcc

Browse files
Ferkest31
authored andcommittedOct 4, 2015
Added minetest.wallmounted_to_dir
1 parent 20405ed commit b12bdcc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

Diff for: ‎builtin/game/item.lua

+13
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ function core.dir_to_wallmounted(dir)
139139
end
140140
end
141141

142+
function core.wallmounted_to_dir(wallmounted)
143+
-- table of dirs in wallmounted order
144+
return ({[0] = {x = 0, y = 1, z = 0},
145+
{x = 0, y = -1, z = 0},
146+
{x = 1, y = 0, z = 0},
147+
{x = -1, y = 0, z = 0},
148+
{x = 0, y = 0, z = 1},
149+
{x = 0, y = 0, z = -1}})
150+
151+
--indexed into by the wallmounted in question
152+
[wallmounted]
153+
end
154+
142155
function core.get_node_drops(nodename, toolname)
143156
local drop = ItemStack({name=nodename}):get_definition().drop
144157
if drop == nil then

0 commit comments

Comments
 (0)
Please sign in to comment.