Use repairkit to reactivate broken techage nodes
This commit is contained in:
parent
436fec17d2
commit
d8d655e516
@ -222,13 +222,29 @@ local function on_place(itemstack, placer, pointed_thing)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function repair(itemstack, placer, pointed_thing)
|
||||||
|
if pointed_thing.type == "node" then
|
||||||
|
local pos = pointed_thing.under
|
||||||
|
if not placer or minetest.is_protected(pos, placer:get_player_name()) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local number = techage.get_node_number(pos)
|
||||||
|
if number and not techage.get_node_info(number) then
|
||||||
|
techage.repair_number(pos)
|
||||||
|
minetest.chat_send_player(placer:get_player_name(), "Node repaired!")
|
||||||
|
itemstack:add_wear(65636/200)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_tool("techage:repairkit", {
|
minetest.register_tool("techage:repairkit", {
|
||||||
description = S("TechAge Repair Kit"),
|
description = S("TechAge Repair Kit"),
|
||||||
inventory_image = "techage_repairkit.png",
|
inventory_image = "techage_repairkit.png",
|
||||||
wield_image = "techage_repairkit.png^[transformR270",
|
wield_image = "techage_repairkit.png^[transformR270",
|
||||||
groups = {cracky=1, book=1},
|
groups = {cracky=1, book=1},
|
||||||
--on_use = repair,
|
on_use = repair,
|
||||||
--on_place = repair,
|
on_place = repair,
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
})
|
})
|
||||||
@ -254,3 +270,12 @@ minetest.register_craft({
|
|||||||
{"default:steel_ingot", "", ""},
|
{"default:steel_ingot", "", ""},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--minetest.register_craft({
|
||||||
|
-- output = "techage:repairkit",
|
||||||
|
-- recipe = {
|
||||||
|
-- {"", "", ""},
|
||||||
|
-- {"", "techage:end_wrench", ""},
|
||||||
|
-- {"", "", ""},
|
||||||
|
-- },
|
||||||
|
--})
|
||||||
|
Loading…
Reference in New Issue
Block a user