From bd35e70d085de2106b2f0a7e7e7d2eaff7c2a1b4 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Tue, 13 Jun 2017 18:17:18 -0700 Subject: [PATCH] [rainbow_ore] Update to Git patch d1fef62: https://github.com/AntumDeluge/mtmod-rainbow_ore/tree/d1fef62 --- README.md | 2 +- mods/materials/rainbow_ore/init.lua | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d204ab9..d06dcecf 100644 --- a/README.md +++ b/README.md @@ -555,7 +555,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m [patch.peaceful_npc]: https://github.com/AntumDeluge/mtmod-peaceful_npc/tree/cbae09e [patch.playeranim]: https://github.com/AntumDeluge/mtmod-playeranim/tree/8a289b9 [patch.quartz]: https://github.com/AntumDeluge/mtmod-quartz/tree/d23dabd -[patch.rainbow_ore]: https://github.com/AntumDeluge/mtmod-rainbow_ore/tree/0f2a9e8 +[patch.rainbow_ore]: https://github.com/AntumDeluge/mtmod-rainbow_ore/tree/d1fef62 [patch.snowdrift]: https://github.com/AntumDeluge/mtmod-snowdrift/tree/1b9da4f [patch.spawneggs]: https://github.com/AntumDeluge/mtmod-spawneggs/tree/f2cc4cc [patch.spidermob]: https://github.com/AntumDeluge/mtmod-spidermob/tree/25a88ff diff --git a/mods/materials/rainbow_ore/init.lua b/mods/materials/rainbow_ore/init.lua index 0103120b..1b896d3a 100644 --- a/mods/materials/rainbow_ore/init.lua +++ b/mods/materials/rainbow_ore/init.lua @@ -34,6 +34,21 @@ minetest.register_craft({ }) +local t_uses = {} +local tool_wear_enabled = minetest.settings:get_bool("enable_tool_wear") +if tool_wear_enabled == nil then + -- Default is enabled + tool_wear_enabled = true +end + +if tool_wear_enabled then + t_uses.fifteen = 15 + t_uses.twenty = 20 +else + t_uses.fifteen = 0 + t_uses.twenty = 0 +end + --Register Rainbow Pickaxe minetest.register_tool("rainbow_ore:rainbow_ore_pickaxe", { description = "Rainbow Pickaxe", @@ -42,7 +57,7 @@ minetest.register_tool("rainbow_ore:rainbow_ore_pickaxe", { full_punch_interval = 0.9, max_drop_level=3, groupcaps={ - cracky = {times={[1]=1.0, [2]=0.5, [3]=0.25}, uses=0, maxlevel=3}, + cracky = {times={[1]=1.0, [2]=0.5, [3]=0.25}, uses=t_uses.fifteen, maxlevel=3}, }, damage_groups = {fleshy=5}, }, @@ -68,7 +83,7 @@ minetest.register_tool("rainbow_ore:rainbow_ore_axe", { full_punch_interval = 0.9, max_drop_level=3, groupcaps={ - choppy={times={[1]=1.05, [2]=0.45, [3]=0.25}, uses=0, maxlevel=3}, + choppy={times={[1]=1.05, [2]=0.45, [3]=0.25}, uses=t_uses.fifteen, maxlevel=3}, }, damage_groups = {fleshy=7}, } @@ -104,7 +119,7 @@ minetest.register_tool("rainbow_ore:rainbow_ore_shovel", { full_punch_interval = 1.0, max_drop_level=3, groupcaps={ - crumbly = {times={[1]=0.55, [2]=0.25, [3]=0.15}, uses=0, maxlevel=3}, + crumbly = {times={[1]=0.55, [2]=0.25, [3]=0.15}, uses=t_uses.fifteen, maxlevel=3}, }, damage_groups = {fleshy=4}, }, @@ -130,7 +145,7 @@ minetest.register_tool("rainbow_ore:rainbow_ore_sword", { full_punch_interval = 0.7, max_drop_level=3, groupcaps={ - snappy={times={[1]=0.95, [2]=0.45, [3]=0.15}, uses=0, maxlevel=3}, + snappy={times={[1]=0.95, [2]=0.45, [3]=0.15}, uses=t_uses.twenty, maxlevel=3}, }, damage_groups = {fleshy=8}, }