Add hoe code

This commit is contained in:
Louis 2020-02-12 12:40:48 +01:00
parent 2f25b61449
commit d167f8d2cf
3 changed files with 24 additions and 1 deletions

20
hoe.lua Normal file

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

3
init.lua Normal file

@ -0,0 +1,3 @@
local MP = minetest.get_modpath("toolranks_extras")
dofile(MP.."/hoe.lua")

@ -1,4 +1,4 @@
name = toolranks-extras
name = toolranks_extras
description = Adds toolranks support for minetest-gamess mods (except default).
depends = toolranks
optional_depends = farming