Add metal instrument and fix bugs

This commit is contained in:
ConfidentOwl 2022-12-22 17:11:49 +03:00
parent 427101b5e5
commit aa768f73c1
12 changed files with 160 additions and 10 deletions

View File

@ -2,4 +2,5 @@ local S = minetest.get_translator(minetest.get_current_modname())
local name = minetest.get_current_modname()
local path = minetest.get_modpath(name)
dofile(path .. "/custom_recips/recips_table_and_some_metods.lua") --main fail about all pipes
dofile(path .. "/custom_recips/recips_table_and_some_metods.lua") --main fail about all pipes
dofile(path .. "/custom_recips/remove_vanila_recips.lua")

View File

@ -0,0 +1,16 @@
local list_to_remove_recips_intruments ={
"mcl_tools:pick_iron","mcl_tools:pick_gold", "mcl_tools:pick_diamond","mcl_tools:pick_netherite","mcl_tools:shovel_iron","mcl_tools:shovel_gold","mcl_tools:shovel_diamond","mcl_tools:shovel_netherite",
"mcl_tools:axe_iron","mcl_tools:axe_gold","mcl_tools:axe_diamond","mcl_tools:axe_netherite","mcl_tools:sword_iron","mcl_tools:sword_gold","mcl_tools:sword_diamond","mcl_tools:sword_netherite",
"mcl_farming:hoe_iron","mcl_farming:hoe_gold","mcl_farming:hoe_diamond","mcl_farming:hoe_netherite"
}
for i, value in ipairs(list_to_remove_recips_intruments) do
minetest.clear_craft({
type = "shaped",
output = value,
recipe = {
{"","",""},
{"","",""},
{"","",""}
}
})
end

View File

@ -1,6 +1,32 @@
local S = minetest.get_translator(minetest.get_current_modname())
local name = minetest.get_current_modname()
local path = minetest.get_modpath(name)
local hoe_on_place_function = function(wear_divisor) --Copy-past from mcl_farming ( in mc it local func adn can 't access to mod ')
return function(itemstack, user, pointed_thing)
-- Call on_rightclick if the pointed node defines it
local node = minetest.get_node(pointed_thing.under)
if user and not user:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or itemstack
end
end
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
minetest.record_protection_violation(pointed_thing.under, user:get_player_name())
return itemstack
end
if create_soil(pointed_thing.under, user:get_inventory()) then
if not minetest.is_creative_enabled(user:get_player_name()) then
itemstack:add_wear(65535/wear_divisor)
end
return itemstack
end
end
end
--delite vanila ores (dont foget make confige for it)
--[[local ore_for_delite ={"mcl_core:stone_with_coal","mcl_core:stone_with_iron","mcl_core:stone_with_redstone","mcl_core:stone_with_lapis","mcl_core:stone_with_diamond",}
for i, value in ipairs(ore_for_delite) do
@ -8,16 +34,16 @@ for i, value in ipairs(ore_for_delite) do
end]]
--wanila res remove !!!!
-- 1)tech_name 2)useal name 3)ineed ore ? 4)pickasxe_level 5)color
-- 1)tech_name 2)useal name 3)ineed ore ? 4)pickasxe_level 5)color 6)intrument uses
local metals_ore_array={
{"iron","Iron ",true,3,"#f7f7f7"},
{"copper","Copper ",true,2,"#ff5e00"},
{"tin","Tin ",true,2,"#c9c9c9"},
{"gold","Gold ",true,2,"#ffe600"},
{"silver","Silver ",true,3,"#d1d1d1"},
{"lead","Lead ",true,3,"#9092ab"},
{"steal","Steal ",false,3,"#575757"},
{"bronze","Bronze ",false,3,"#a35900"},
{"iron","Iron ",true,3,"#f7f7f7",125},
{"copper","Copper ",true,2,"#ff5e00",75},
{"tin","Tin ",true,2,"#c9c9c9",88},
{"gold","Gold ",true,2,"#ffe600",50},
{"silver","Silver ",true,3,"#d1d1d1",62},
{"lead","Lead ",true,3,"#9092ab",62},
{"steal","Steal ",false,3,"#575757",300},
{"bronze","Bronze ",false,3,"#a35900",200},
}
--make metals ALL
for i, value in ipairs(metals_ore_array) do
@ -78,6 +104,113 @@ for i, value in ipairs(metals_ore_array) do
stack_max = 64,
groups = { craftitem=1 },
})
--pick
minetest.register_tool("owl_tech:pick_".. metals_ore_array[i][1], {
description = S( metals_ore_array[i][2].." Pickaxe"),
_doc_items_longdesc = "Pick from owl tech",
inventory_image = "(owl_tech_pick_head.png^[colorize:"..metals_ore_array[i][5]..":128)^owl_tech_pick_stick.png", --owl_tech_pick_head.png owl_tech_pick_stick.png
wield_scale = mcl_vars.tool_wield_scale,
groups = { tool=1, pickaxe=1, dig_speed_class=4, enchantability=14 },
tool_capabilities = {
-- 1/1.2
full_punch_interval = 0.83333333,
max_drop_level=4,
damage_groups = {fleshy=4},
punch_attack_uses = (metals_ore_array[i][6]),
},
sound = { breaks = "default_tool_breaks" },
_repair_material = "owl_tech:"..metals_ore_array[i][1].."_ingot",
_mcl_toollike_wield = true,
_mcl_diggroups = {
pickaxey = { speed = 6, level = 4, uses = metals_ore_array[i][6]*2}
},
})
--axe
minetest.register_tool("owl_tech:axe_".. metals_ore_array[i][1], {
description = S(metals_ore_array[i][2].." axe"),
_doc_items_longdesc = "Axe owl tech",
inventory_image = "(owl_tech_axe_head.png^[colorize:"..metals_ore_array[i][5]..":128)^owl_tech_pick_stick.png",
wield_scale = mcl_vars.tool_wield_scale,
groups = { tool=1, axe=1, dig_speed_class=4, enchantability=14 },
tool_capabilities = {
-- 1/0.9
full_punch_interval = 1.11111111,
max_drop_level=4,
damage_groups = {fleshy=9},
punch_attack_uses = (metals_ore_array[i][6]),
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
_repair_material = "owl_tech:"..metals_ore_array[i][1].."_ingot",
_mcl_toollike_wield = true,
_mcl_diggroups = {
axey = { speed = 6, level = 4, uses = metals_ore_array[i][6]*2 }
},
})
--Sword
minetest.register_tool("owl_tech:sword_"..metals_ore_array[i][1], {
description = S(metals_ore_array[i][2].." sword"),
_doc_items_longdesc = "Owl tech sword",
inventory_image = "(owl_tech_sword_blade.png^[colorize:"..metals_ore_array[i][5]..":128)^owl_tech_sword_stick.png",
wield_scale = mcl_vars.tool_wield_scale,
groups = { weapon=1, sword=1, dig_speed_class=4, enchantability=14 },
tool_capabilities = {
full_punch_interval = 0.625,
max_drop_level=4,
damage_groups = {fleshy=6},
punch_attack_uses = metals_ore_array[i][6],
},
sound = { breaks = "default_tool_breaks" },
_repair_material = "owl_tech:"..metals_ore_array[i][1].."_ingot",
_mcl_toollike_wield = true,
_mcl_diggroups = {
swordy = { speed = 6, level = 4, uses = metals_ore_array[i][6]*2 },
swordy_cobweb = { speed = 6, level = 4, uses = metals_ore_array[i][6]*2 }
},
})
--shovel
minetest.register_tool("owl_tech:shovel_"..metals_ore_array[i][1], {
description = S(metals_ore_array[i][2].." Shovel"),
_doc_items_longdesc = "Owl tech shovel",
_doc_items_usagehelp = shovel_use,
inventory_image = "(owl_tech_shovel_head.png^[colorize:"..metals_ore_array[i][5]..":128)^owl_tech_shovel_stick.png",
wield_scale = wield_scale,
groups = { tool=1, shovel=1, dig_speed_class=4, enchantability=14 },
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=4,
damage_groups = {fleshy=4},
punch_attack_uses = metals_ore_array[i][6],
},
on_place = make_grass_path,
sound = { breaks = "default_tool_breaks" },
_repair_material = "owl_tech:"..metals_ore_array[i][1].."_ingot",
_mcl_toollike_wield = true,
_mcl_diggroups = {
shovely = { speed = 6, level = 4, uses = metals_ore_array[i][6]*2 }
},
})
--Hoe
minetest.register_tool("owl_tech:hoe_"..metals_ore_array[i][1], {
description = S(metals_ore_array[i][1].." Hoe"),
--_tt_help = hoe_tt.."\n"..S("Uses: @1", uses.iron),
_doc_items_longdesc = "Owl tech hoe",
inventory_image = "(owl_tech_hoe_head.png^[colorize:"..metals_ore_array[i][5]..":128)^owl_tech_hoe_stick.png",
wield_scale = mcl_vars.tool_wield_scale,
on_place = hoe_on_place_function(metals_ore_array[i][6]),
groups = { tool=1, hoe=1, enchantability=14 },
tool_capabilities = {
-- 1/3
full_punch_interval = 0.33333333,
damage_groups = { fleshy = 1, },
punch_attack_uses = metals_ore_array[i][6],
},
_repair_material = "mcl_core:iron_ingot",
_mcl_toollike_wield = true,
_mcl_diggroups = {
hoey = { speed = 6, level = 4, uses = 251 }
},
})
--stick
minetest.register_craftitem("owl_tech:"..metals_ore_array[i][1].."_stick", {
description = S(metals_ore_array[i][2].. " stick"),

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB