From 4aab7d0dbd782cf6741bdbba94440faf0c5c2e61 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sat, 12 Aug 2017 20:37:50 -0400 Subject: updated several mods biome_lib, boost cart, homedecor modpack, plantlife modpack, cottages, currency, farming redo, gloopblocks, ilights, moreores, moretrees, pipeworks, plasticbox, replacer, signs_lib, streets, travelnet, unified dyes, and vines, and maybe one or two others that I didn't see in the list. :-) I fixed the misc_overrides component (it broke when I switched over to farming redo a while back), and also I've added the classic peaceful_npc mod back into the modpack, since it seems to work now. Be sure when you run a world for the first time after this update, that you "Configure" the world, *disable* all of Dreambuilder Modpack, then re-enable the whole thing. If you don't, a few mods will fail to load due to recent changes in their dependencies. --- farming/hoes.lua | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'farming/hoes.lua') diff --git a/farming/hoes.lua b/farming/hoes.lua index dab2ac9..dd7a11c 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -1,5 +1,6 @@ local S = farming.intllib +local tr = minetest.get_modpath("toolranks") -- Hoe registration function @@ -101,8 +102,20 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5}) - if not minetest.setting_getbool("creative_mode") then - itemstack:add_wear(65535/(uses-1)) + local wear = 65535 / (uses -1) + + if minetest.setting_getbool("creative_mode") then + if tr then + wear = 1 + else + wear = 0 + end + end + + if tr then + itemstack = toolranks.new_afteruse(itemstack, user, under, {wear = wear}) + else + itemstack:add_wear(wear) end return itemstack @@ -151,3 +164,31 @@ farming.register_hoe(":farming:hoe_diamond", { max_uses = 500, material = "default:diamond" }) + +-- Toolranks support +if tr then + +minetest.override_item("farming:hoe_wood", { + original_description = "Wood Hoe", + description = toolranks.create_description("Wood Hoe")}) + +minetest.override_item("farming:hoe_stone", { + original_description = "Stone Hoe", + description = toolranks.create_description("Stone Hoe")}) + +minetest.override_item("farming:hoe_steel", { + original_description = "Steel Hoe", + description = toolranks.create_description("Steel Hoe")}) + +minetest.override_item("farming:hoe_bronze", { + original_description = "Bronze Hoe", + description = toolranks.create_description("Bronze Hoe")}) + +minetest.override_item("farming:hoe_mese", { + original_description = "Mese Hoe", + description = toolranks.create_description("Mese Hoe")}) + +minetest.override_item("farming:hoe_diamond", { + original_description = "Diamond Hoe", + description = toolranks.create_description("Diamond Hoe")}) +end -- cgit v1.2.3