minor fix
This commit is contained in:
parent
751cb12ea0
commit
420799bc80
@ -62,17 +62,7 @@ local function dig_node(pos, quarrypos)
|
|||||||
local quarry = minetest.get_meta(quarrypos)
|
local quarry = minetest.get_meta(quarrypos)
|
||||||
local quarry_inv = quarry:get_inventory()
|
local quarry_inv = quarry:get_inventory()
|
||||||
|
|
||||||
local drops = minetest.get_node_drops(node.name);
|
sparktech.dig_node(pos, quarry_inv, "quarry", nil)
|
||||||
local drops_added = 0
|
|
||||||
for _, item in pairs(drops) do
|
|
||||||
if quarry_inv:add_item("quarry", item) then
|
|
||||||
drops_added = drops_added + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if drops_added ~= 0 or #drops == 0 then
|
|
||||||
minetest.set_node(pos, {name = "air"})
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return node.name ~= "air"
|
return node.name ~= "air"
|
||||||
@ -122,7 +112,7 @@ end
|
|||||||
local function place_strut(position, quarrypos)
|
local function place_strut(position, quarrypos)
|
||||||
if minetest.get_node(position).name == "air" then
|
if minetest.get_node(position).name == "air" then
|
||||||
local placed = false
|
local placed = false
|
||||||
if sparktech.can_drain_energy(quarrypos, ENERGYCOST.static_strut) then
|
if try_drain_energy(quarrypos, ENERGYCOST.static_strut) then
|
||||||
if try_remove_item(quarrypos, "quarry", NAME .. ":static_strut") then
|
if try_remove_item(quarrypos, "quarry", NAME .. ":static_strut") then
|
||||||
minetest.set_node(position, { name = NAME .. ":static_strut"})
|
minetest.set_node(position, { name = NAME .. ":static_strut"})
|
||||||
placed = true
|
placed = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user