Valentin Anger 2b10b2eb40 Rename instawrench to debugwrench
The name instawrench is redundant as the sparkcore:wrench removes nodes
at the same speed
2017-01-03 14:41:58 +01:00

20 lines
619 B
Lua

minetest.register_tool("sparkdebug:debugwrench", {
description = "Debug Wrench",
inventory_image = "debugwrench.png",
stack_max = 1,
range = 50.0,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing["type"] == "node" then
local node = minetest.get_node(pointed_thing["under"])
if minetest.get_item_group(node["name"], "sparktech_techy") > 0 then
local check = minetest.dig_node(pointed_thing["under"])
if check then
local inv = placer:get_inventory()
inv:add_item("main", node)
end
end
end
return itemstack
end
})