Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added minetest.wallmounted_to_dir
  • Loading branch information
Ferk authored and est31 committed Oct 4, 2015
1 parent 20405ed commit b12bdcc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions builtin/game/item.lua
Expand Up @@ -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
Expand Down

0 comments on commit b12bdcc

Please sign in to comment.