diff options
Diffstat (limited to 'farming')
-rw-r--r-- | farming/README.txt | 1 | ||||
-rw-r--r-- | farming/corn.lua | 2 | ||||
-rw-r--r-- | farming/depends.txt | 3 | ||||
-rw-r--r-- | farming/hoes.lua | 45 |
4 files changed, 47 insertions, 4 deletions
diff --git a/farming/README.txt b/farming/README.txt index 95c8154..00c2dda 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.26 - Added support for [toolranks] mod when using hoe's 1.25 - Added check for farming.conf setting file to disable specific crops globally (inside mod folder) or world specific (inside world folder) 1.24 - Added Hemp which can be crafted into fibre, paper, string, rope and oil. 1.23 - Huge code tweak and tidy done and added barley seeds to be found in dry grass, barley can make flour for bread also. diff --git a/farming/corn.lua b/farming/corn.lua index 402ec82..1149a00 100644 --- a/farming/corn.lua +++ b/farming/corn.lua @@ -59,7 +59,7 @@ minetest.register_craft( { minetest.register_craft({ type = "fuel", recipe = "farming:bottle_ethanol", - burntime = 240, + burntime = 80, --240, replacements = {{ "farming:bottle_ethanol", "vessels:glass_bottle"}} }) diff --git a/farming/depends.txt b/farming/depends.txt index 8a8d2a2..9a747d1 100644 --- a/farming/depends.txt +++ b/farming/depends.txt @@ -1,3 +1,4 @@ default intllib? -lucky_block?
\ No newline at end of file +lucky_block? +toolranks? 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 |