diff --git a/.luacheckrc b/.luacheckrc index fb340e592ff27b8aec9e166605b55ec26c30f67c..32ef698bd708e4a818b656495b49ffea6ab3b7a5 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -30,4 +30,5 @@ read_globals = { "frame", "intllib", "mg", + "toolranks", } diff --git a/CHANGELOG.md b/CHANGELOG.md index aaffdc5a87f34179d772069d5d4a53567af096a5..58e8935e64b3fbbd8d5aaf302d244abbc4413bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- More Ores tools now have [`toolranks`](https://github.com/lisacvuk/minetest-toolranks) support. + ## [2.0.0] - 2019-11-25 ### Added diff --git a/init.lua b/init.lua index 33b2a82d8eddf10029ce8e38a8ef8d86df644728..704e4aa8baf99defaa96708761b996db09f0aab1 100644 --- a/init.lua +++ b/init.lua @@ -232,6 +232,14 @@ local function add_ore(modname, description, mineral_name, oredef) end end + -- Toolranks support + if minetest.get_modpath("toolranks") then + minetest.override_item(fulltool_name, { + original_description = tdef.description, + description = toolranks.create_description(tdef.description, 0, 1), + after_use = toolranks.new_afteruse}) + end + minetest.register_alias(tool_name .. tool_post, fulltool_name) if use_frame then frame.register(fulltool_name) diff --git a/mod.conf b/mod.conf index 9b71bfb406b70008b3bd6688b0e0e2c9cbbb8948..928eefee508cf8bc07a10cca4ae90df6ab377774 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = moreores description = Adds new ore types. depends = default -optional_depends = carts,farming,frame,intllib,mg +optional_depends = carts,farming,frame,intllib,mg,toolranks