Made sword abilty drain duribity.

Need to experiment with the other tools
master
asgasg 2014-02-07 22:43:46 +00:00
parent 4976ab73c7
commit a3a05360b2
1 changed files with 6 additions and 3 deletions

View File

@ -121,13 +121,16 @@ minetest.register_tool("icetools:sword_ice", {
},
damage_groups = {fleshy=9},
},
minetest.register_on_punchnode(function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == 'icetools:sword_ice' then
minetest.register_on_punchnode(function(pos, node, puncher)
tool = puncher:get_wielded_item()
if tool:get_name() == "icetools:sword_ice" then
if node.name == "default:water_source" then
minetest.add_node(pos, { name="default:ice"})
tool:add_wear(65535/75)
puncher:set_wielded_item(tool)
end
end
end)
end)
})
minetest.register_tool("icetools:pick_ice", {