From 77dcda83e3c235d125769dac627340ad8906e880 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 14 Aug 2024 11:02:06 +0100 Subject: [PATCH] tweak and tidy code --- lucky_block.lua | 5 +++++ mod.conf | 3 ++- tools.lua | 42 +++++++++++++++--------------------------- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/lucky_block.lua b/lucky_block.lua index c9bd2f9..9baaecc 100644 --- a/lucky_block.lua +++ b/lucky_block.lua @@ -1,3 +1,6 @@ + +-- add lucky blocks + lucky_block:add_blocks({ {"dro", {"pigiron:iron_ingots"}, 10}, {"nod", "pigiron:iron_block", 0}, @@ -12,6 +15,8 @@ lucky_block:add_blocks({ } }) +-- add iron hoe + if minetest.get_modpath("farming") then lucky_block:add_blocks({ diff --git a/mod.conf b/mod.conf index 54e594e..26d8e22 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,5 @@ name = pigiron +description = Adds pig iron ingots which need to be crafted to make steel, also blocks and stairs. depends = default optional_depends = stairs, farming, lucky_block, toolranks -description = Adds pig iron ingots which need to be crafted to make steel, also blocks and stairs. +min_minetest_version = 5.0 diff --git a/tools.lua b/tools.lua index 94548a7..0d21bb1 100644 --- a/tools.lua +++ b/tools.lua @@ -9,8 +9,7 @@ minetest.register_tool("pigiron:pick_iron", { max_drop_level = 1, groupcaps = { cracky = { - times = {[1] = 2.5, [2] = 1.40, [3] = 0.95}, - uses = 20, maxlevel = 2 + times = {[1] = 2.5, [2] = 1.40, [3] = 0.95}, uses = 20, maxlevel = 2 } }, damage_groups = {fleshy = 3} @@ -39,8 +38,7 @@ minetest.register_tool("pigiron:shovel_iron", { max_drop_level = 1, groupcaps = { crumbly = { - times = {[1] = 1.70, [2] = 1.0, [3] = 0.45}, - uses = 25, maxlevel = 1 + times = {[1] = 1.70, [2] = 1.0, [3] = 0.45}, uses = 25, maxlevel = 1 } }, damage_groups = {fleshy = 2} @@ -68,8 +66,7 @@ minetest.register_tool("pigiron:axe_iron", { max_drop_level = 1, groupcaps = { choppy = { - times = {[1] = 2.70, [2] = 1.70, [3] = 1.15}, - uses = 20, maxlevel = 1 + times = {[1] = 2.70, [2] = 1.70, [3] = 1.15}, uses = 20, maxlevel = 1 } }, damage_groups = {fleshy = 3} @@ -97,8 +94,7 @@ minetest.register_tool("pigiron:sword_iron", { max_drop_level = 1, groupcaps = { snappy = { - times = {[1] = 2.0, [2] = 1.30, [3] = 0.38}, - uses = 25, maxlevel = 1 + times = {[1] = 2.0, [2] = 1.30, [3] = 0.38}, uses = 25, maxlevel = 1 } }, damage_groups = {fleshy = 5} @@ -124,12 +120,12 @@ if minetest.get_modpath("farming") then description = "Iron Hoe", inventory_image = "pigiron_iron_hoe.png", max_uses = 150, - material = "pigiron:iron_ingot" + material = "pigiron:iron_ingot", + groups = {hoe = 1, flammable = 2}, }) -- Toolranks support if farming redo active - if farming and farming.mod - and minetest.get_modpath("toolranks") then + if farming and farming.mod and minetest.get_modpath("toolranks") then minetest.override_item("farming:hoe_iron", { original_description = "Iron Hoe", @@ -146,8 +142,7 @@ minetest.override_item("default:pick_steel", { max_drop_level = 1, groupcaps = { cracky = { - times = {[1] = 4.50, [2] = 1.80, [3] = 0.90}, - uses = 20, maxlevel = 2 + times = {[1] = 4.50, [2] = 1.80, [3] = 0.90}, uses = 20, maxlevel = 2 } }, damage_groups = {fleshy = 4} @@ -160,8 +155,7 @@ minetest.override_item("default:pick_bronze", { max_drop_level = 1, groupcaps = { cracky = { - times = {[1] = 4.00, [2] = 1.60, [3] = 0.80}, - uses = 20, maxlevel = 2 + times = {[1] = 4.00, [2] = 1.60, [3] = 0.80}, uses = 20, maxlevel = 2 } }, damage_groups = {fleshy = 4} @@ -174,8 +168,7 @@ minetest.override_item("default:shovel_steel", { max_drop_level = 1, groupcaps = { crumbly = { - times = {[1] = 1.65, [2] = 1.05, [3] = 0.45}, - uses = 25, maxlevel = 2 + times = {[1] = 1.65, [2] = 1.05, [3] = 0.45}, uses = 25, maxlevel = 2 } }, damage_groups = {fleshy = 3} @@ -188,8 +181,7 @@ minetest.override_item("default:shovel_bronze", { max_drop_level = 1, groupcaps = { crumbly = { - times = {[1] = 1.50, [2] = 0.90, [3] = 0.40}, - uses = 30, maxlevel = 2 + times = {[1] = 1.50, [2] = 0.90, [3] = 0.40}, uses = 30, maxlevel = 2 } }, damage_groups = {fleshy = 3} @@ -202,8 +194,7 @@ minetest.override_item("default:axe_steel", { max_drop_level = 1, groupcaps = { choppy = { - times = {[1] = 2.75, [2] = 1.70, [3] = 1.15}, - uses = 20, maxlevel = 2 + times = {[1] = 2.75, [2] = 1.70, [3] = 1.15}, uses = 20, maxlevel = 2 } }, damage_groups = {fleshy = 4} @@ -216,8 +207,7 @@ minetest.override_item("default:axe_bronze", { max_drop_level = 1, groupcaps = { choppy = { - times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, - uses = 20, maxlevel = 2 + times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, uses = 20, maxlevel = 2 } }, damage_groups = {fleshy = 4} @@ -230,8 +220,7 @@ minetest.override_item("default:sword_steel", { max_drop_level = 1, groupcaps = { snappy = { - times = {[1] = 2.75, [2] = 1.30, [3] = 0.375}, - uses = 25, maxlevel = 2 + times = {[1] = 2.75, [2] = 1.30, [3] = 0.375}, uses = 25, maxlevel = 2 } }, damage_groups = {fleshy = 6} @@ -244,8 +233,7 @@ minetest.override_item("default:sword_bronze", { max_drop_level = 1, groupcaps = { snappy = { - times = {[1] = 2.5, [2] = 1.20, [3] = 0.35}, - uses = 30, maxlevel = 2 + times = {[1] = 2.5, [2] = 1.20, [3] = 0.35}, uses = 30, maxlevel = 2 } }, damage_groups = {fleshy = 6}