2020-04-12 15:45:58 +03:00
|
|
|
local S = techage.S
|
|
|
|
|
|
|
|
local function remove_pipe(itemstack, user, pointed_thing)
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
if pos and user then
|
|
|
|
if minetest.is_protected(pos, user:get_player_name()) then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-12 15:45:58 +03:00
|
|
|
if(pos ~= nil) then
|
|
|
|
local node = minetest.get_node(pos)
|
|
|
|
if(node.name == "techage:oil_drillbit2") then
|
|
|
|
minetest.set_node(pos, {name = "air"})
|
|
|
|
itemstack:add_wear(65636/200)
|
|
|
|
return itemstack
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-12 15:45:58 +03:00
|
|
|
end -- if(node.name
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-12 15:45:58 +03:00
|
|
|
end -- if(pos ~= nil)
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-12 15:45:58 +03:00
|
|
|
end -- remove_pipe
|
|
|
|
|
|
|
|
|
2020-04-13 14:20:38 +03:00
|
|
|
minetest.register_tool("techage:ta3_drill_pipe_wrench", {
|
|
|
|
description = S("TA3 Drill Pipe Wrench"),
|
2020-04-12 15:45:58 +03:00
|
|
|
inventory_image = "techage_pipe_wrench.png",
|
|
|
|
wield_image = "techage_pipe_wrench.png",
|
|
|
|
groups = {cracky=1},
|
|
|
|
on_use = remove_pipe,
|
|
|
|
stack_max = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2020-04-13 14:20:38 +03:00
|
|
|
output = "techage:ta3_drill_pipe_wrench",
|
2020-04-12 15:45:58 +03:00
|
|
|
recipe = {
|
2020-04-13 14:20:38 +03:00
|
|
|
{"default:diamond", "default:diamond", ""},
|
2020-04-12 15:45:58 +03:00
|
|
|
{"dye:red", "default:steel_ingot", "dye:red"},
|
|
|
|
{"default:steel_ingot", "", "default:steel_ingot"},
|
|
|
|
},
|
2022-01-04 21:40:27 +03:00
|
|
|
})
|