add toolranks support for iron tools
This commit is contained in:
parent
b0bf88d66d
commit
6c6f2e7df9
@ -23,3 +23,4 @@ Changelog:
|
||||
- 0.2 - Added Iron Pickaxe
|
||||
- 0.3 - Add Iron Axe, Shovel, Sword, Hoe and more lucky blocks
|
||||
- 0.4 - Switch Bronze and Steel tool capabilities (Steel is stronger irl)
|
||||
- 0.5 - Add Toolranks support for iron tools
|
||||
|
@ -2,3 +2,4 @@ default
|
||||
stairs?
|
||||
farming?
|
||||
lucky_block?
|
||||
toolranks?
|
||||
|
19
tools.lua
19
tools.lua
@ -238,3 +238,22 @@ minetest.override_item("default:sword_bronze", {
|
||||
damage_groups = {fleshy = 6},
|
||||
},
|
||||
})
|
||||
|
||||
-- Add [toolranks] mod support if found
|
||||
if minetest.get_modpath("toolranks") then
|
||||
|
||||
-- Helper function
|
||||
local function add_tool(name, desc, afteruse)
|
||||
|
||||
minetest.override_item(name, {
|
||||
original_description = desc,
|
||||
description = toolranks.create_description(desc, 0, 1),
|
||||
after_use = afteruse and toolranks.new_afteruse
|
||||
})
|
||||
end
|
||||
|
||||
add_tool("pigiron:pick_iron", "Iron Pickaxe", true)
|
||||
add_tool("pigiron:axe_iron", "Iron Axe", true)
|
||||
add_tool("pigiron:shovel_iron", "Iron Shovel", true)
|
||||
add_tool("pigiron:sword_iron", "Iron Sword", true)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user