mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-07-04 17:30:26 +02:00
Add toolrank support
This commit is contained in:
9
init.lua
9
init.lua
@ -7,7 +7,7 @@ throwing.target_node = 2
|
|||||||
throwing.target_both = 3
|
throwing.target_both = 3
|
||||||
|
|
||||||
throwing.modname = minetest.get_current_modname()
|
throwing.modname = minetest.get_current_modname()
|
||||||
|
local use_toolranks = minetest.get_modpath("toolranks")
|
||||||
--------- Arrows functions ---------
|
--------- Arrows functions ---------
|
||||||
function throwing.is_arrow(itemstack)
|
function throwing.is_arrow(itemstack)
|
||||||
return throwing.arrows[ItemStack(itemstack):get_name()]
|
return throwing.arrows[ItemStack(itemstack):get_name()]
|
||||||
@ -371,4 +371,11 @@ function throwing.register_bow(name, def)
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
minetest.register_tool(name, def)
|
minetest.register_tool(name, def)
|
||||||
|
if use_toolranks then
|
||||||
|
minetest.override_item(name:sub(2), {
|
||||||
|
original_description = def.description,
|
||||||
|
description = toolranks.create_description(def.description, 0, 1),
|
||||||
|
after_user = toolranks.new_afteruse
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,3 +1,3 @@
|
|||||||
name = throwing
|
name = throwing
|
||||||
optional_depends = wielded_light
|
optional_depends = wielded_light, toolranks
|
||||||
description = Throwing library: provides an API for registering throwing and throwable things
|
description = Throwing library: provides an API for registering throwing and throwable things
|
||||||
|
Reference in New Issue
Block a user