techage_modpack/techage/tools/pipe_wrench.lua

42 lines
1.0 KiB
Lua
Raw Normal View History

2020-05-31 23:31:18 +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-04 21:43:30 +03:00
2020-05-31 23:31:18 +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-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
end -- if(node.name
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
end -- if(pos ~= nil)
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
end -- remove_pipe
minetest.register_tool("techage:ta3_drill_pipe_wrench", {
description = S("TA3 Drill Pipe Wrench"),
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({
output = "techage:ta3_drill_pipe_wrench",
recipe = {
{"default:diamond", "default:diamond", ""},
{"dye:red", "default:steel_ingot", "dye:red"},
{"default:steel_ingot", "", "default:steel_ingot"},
},
})