From d167f8d2cf2d72406adcdc00c5fb4b7ef229866d Mon Sep 17 00:00:00 2001 From: Louis <55180044+louisroyer@users.noreply.github.com> Date: Wed, 12 Feb 2020 12:40:48 +0100 Subject: [PATCH] Add hoe code --- hoe.lua | 20 ++++++++++++++++++++ init.lua | 3 +++ mod.conf | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 hoe.lua create mode 100644 init.lua diff --git a/hoe.lua b/hoe.lua new file mode 100644 index 0000000..990c2c2 --- /dev/null +++ b/hoe.lua @@ -0,0 +1,20 @@ +local function add_hoe(material) + local name = "farming:hoe_"..material + local desc = ItemStack(name):get_definition().description + minetest.override_item(name, { + original_description = desc, + description = toolranks.create_description(desc, 0, 1), + after_use = toolranks.new_afteruse + }) +end + + +add_hoe("wood") +add_hoe("stone") +add_hoe("steel") + +-- Following hoes are not available in creative inventory, but +-- it is possible to /give them +add_hoe("bronze") +add_hoe("mese") +add_hoe("diamond") diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..d26da48 --- /dev/null +++ b/init.lua @@ -0,0 +1,3 @@ +local MP = minetest.get_modpath("toolranks_extras") + +dofile(MP.."/hoe.lua") diff --git a/mod.conf b/mod.conf index d783083..c996a3f 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ -name = toolranks-extras +name = toolranks_extras description = Adds toolranks support for minetest-games’s mods (except default). depends = toolranks optional_depends = farming