scaffolding/functions.lua

40 lines
1008 B
Lua
Raw Normal View History

2015-02-20 15:55:03 +01:00
-- falling nodes go into pocket --
2015-02-20 18:20:10 +01:00
function default.dig_horx(pos, node, digger)
2015-02-20 15:55:03 +01:00
if digger == nil then return end
2015-02-20 18:20:10 +01:00
local np = {x = pos.x + 1, y = pos.y, z = pos.z,}
local nn = minetest.get_node(np)
2015-02-20 15:55:03 +01:00
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
end
end
2015-02-20 18:20:10 +01:00
function default.dig_horx2(pos, node, digger)
if digger == nil then return end
local np = {x = pos.x - 1, y = pos.y, z = pos.z,}
local nn = minetest.get_node(np)
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
end
end
function default.dig_horz(pos, node, digger)
if digger == nil then return end
local np = {x = pos.x, y = pos.y, z = pos.z + 1,}
local nn = minetest.get_node(np)
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
end
end
function default.dig_horz2(pos, node, digger)
if digger == nil then return end
local np = {x = pos.x , y = pos.y, z = pos.z - 1,}
local nn = minetest.get_node(np)
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
end
end