mirror of
https://bitbucket.org/Infinatum/scaffolding.git
synced 2025-01-09 08:30:17 +01:00
Fixed the iron scaffolding
This commit is contained in:
parent
03a2039319
commit
05c1577d4c
@ -79,11 +79,40 @@ end)
|
||||
|
||||
-- falling nodes go into pocket --
|
||||
|
||||
function default.dig_hor(pos, node, digger)
|
||||
function default.dig_horx(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)
|
||||
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_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
|
||||
|
||||
|
||||
|
5
init.lua
5
init.lua
@ -55,7 +55,10 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
||||
},
|
||||
},
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_hor(pos, node, digger)
|
||||
default.dig_horx(pos, node, digger)
|
||||
default.dig_horx2(pos, node, digger)
|
||||
default.dig_horz(pos, node, digger)
|
||||
default.dig_horz2(pos, node, digger)
|
||||
end,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user