tweak and tidy code

This commit is contained in:
tenplus1 2024-08-14 11:02:06 +01:00
parent 8569eabd0c
commit 77dcda83e3
3 changed files with 22 additions and 28 deletions

View File

@ -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({

View File

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

View File

@ -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}