add toolranks support for iron tools

This commit is contained in:
TenPlus1 2019-06-02 11:29:20 +01:00
parent b0bf88d66d
commit 6c6f2e7df9
3 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -2,3 +2,4 @@ default
stairs?
farming?
lucky_block?
toolranks?

View File

@ -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