Make bow shot able to level up the bow

This commit is contained in:
Louis
2020-02-12 16:35:33 +01:00
committed by upsilon
parent bfc01d2285
commit 5cf46e0809

View File

@ -353,6 +353,9 @@ function throwing.register_bow(name, def)
if shoot_arrow(itemstack, user, bow_index, def.throw_itself, new_stack) then if shoot_arrow(itemstack, user, bow_index, def.throw_itself, new_stack) then
if not minetest.settings:get_bool("creative_mode") then if not minetest.settings:get_bool("creative_mode") then
itemstack:add_wear(65535 / (def.uses or 50)) itemstack:add_wear(65535 / (def.uses or 50))
if use_toolranks then
toolranks.new_afteruse(itemstack, user, nil, {wear= 65535 / (def.uses or 50)})
end
end end
end end
@ -375,7 +378,6 @@ function throwing.register_bow(name, def)
minetest.override_item(name:sub(2), { minetest.override_item(name:sub(2), {
original_description = def.description, original_description = def.description,
description = toolranks.create_description(def.description, 0, 1), description = toolranks.create_description(def.description, 0, 1),
after_user = toolranks.new_afteruse
}) })
end end
end end