From 819c90775d69f1f6866e2f82c00333e29cf4b127 Mon Sep 17 00:00:00 2001 From: Freeman Date: Fri, 3 Nov 2023 21:42:51 +0100 Subject: [PATCH 1/4] mcl_craftguide recipes in recipes.lua file this doesn't work, dunno why also removed the check: if not stack:get_count() or not recipe.input[stack:get_name()] then return end This was introduced in the commit https://github.com/mt-mods/technic/pull/328/commits/6d06f7d02af04bae23d156fcddf7cf8d93c90f55 --- .luacheckrc | 1 + technic/machines/register/recipes.lua | 16 +++++++++++++++- technic/mod.conf | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index d8196b25..49fd267d 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -30,6 +30,7 @@ read_globals = { "craftguide", "i3", "mtt", "vizlib", "mcl_sounds", "mcl_vars", "mcl_worlds", "mcl_buckets", "mcl_formspec", + "mcl_craftguide", -- Only used in technic/machines/MV/lighting.lua (disabled) "isprotect", "homedecor_expect_infinite_stacks", diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index d3b29367..f594b54b 100644 --- a/technic/machines/register/recipes.lua +++ b/technic/machines/register/recipes.lua @@ -1,6 +1,7 @@ local have_ui = minetest.get_modpath("unified_inventory") local have_cg = minetest.get_modpath("craftguide") +local have_mcl_cg = minetest.get_modpath("mcl_craftguide") local have_i3 = minetest.get_modpath("i3") technic.recipes = { cooking = { input_size = 1, output_size = 1 } } @@ -23,6 +24,12 @@ function technic.register_recipe_type(typename, origdata) icon = data.icon, }) end + if have_mcl_cg then + mcl_craftguide.register_craft_type(typename, { + description = data.description, + icon = data.icon, + }) + end if have_i3 then i3.register_craft_type(typename, { description = data.description, @@ -86,6 +93,14 @@ local function register_recipe(typename, data) items = {table.concat(data.input, ", ")}, }) end + if have_mcl_cg then + mcl_craftguide.register_craft({ + type = typename, + width = 2, + output = output, + items = {table.concat(data.input, ", ")}, + }) + end if have_i3 then i3.register_craft({ type = typename, @@ -133,7 +148,6 @@ function technic.get_recipe(typename, items) if recipe then local new_input = {} for i, stack in ipairs(items) do - if not stack:get_count() or not recipe.input[stack:get_name()] then return end if stack:get_count() < recipe.input[stack:get_name()] then return else diff --git a/technic/mod.conf b/technic/mod.conf index 5437c020..6e8b33d3 100644 --- a/technic/mod.conf +++ b/technic/mod.conf @@ -1,3 +1,3 @@ name = technic depends = pipeworks, technic_worldgen, basic_materials -optional_depends = mcl_core, mcl_sounds, default, bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, dye, craftguide, i3, mtt, vizlib, moreores, mcl_buckets, mcl_explosions +optional_depends = mcl_core, mcl_sounds, default, bucket, mesecons, mesecons_mvps, digilines, digiline_remote, unified_inventory, dye, craftguide, i3, mtt, vizlib, moreores, mcl_buckets, mcl_explosions, mcl_craftguide From 35296334e683a6c3ececb42c8b666823831610da Mon Sep 17 00:00:00 2001 From: Freeman Date: Sat, 4 Nov 2023 10:02:26 +0100 Subject: [PATCH 2/4] other call to mcl_craftguide.register_craft, dont works --- technic/machines/register/recipes.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index f594b54b..54623f54 100644 --- a/technic/machines/register/recipes.lua +++ b/technic/machines/register/recipes.lua @@ -95,10 +95,10 @@ local function register_recipe(typename, data) end if have_mcl_cg then mcl_craftguide.register_craft({ - type = typename, - width = 2, + type = typename, output = output, - items = {table.concat(data.input, ", ")}, + items = data.input, + width = 0, }) end if have_i3 then From a253c956cd8f2679dedc80f13a26cc6549376104 Mon Sep 17 00:00:00 2001 From: Freeman Date: Sat, 4 Nov 2023 14:54:57 +0100 Subject: [PATCH 3/4] skip minetest.after in mcl --- technic/machines/register/recipes.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index 54623f54..672c5640 100644 --- a/technic/machines/register/recipes.lua +++ b/technic/machines/register/recipes.lua @@ -112,7 +112,11 @@ local function register_recipe(typename, data) end function technic.register_recipe(typename, data) - minetest.after(0.01, register_recipe, typename, data) -- Handle aliases + if have_mcl_cg then + register_recipe(typename, data) + else + minetest.after(0.01, register_recipe, typename, data) -- Handle aliases + end end function technic.get_recipe(typename, items) From eeeb403794ec7da0b8860ad7a184d4b8cf85160c Mon Sep 17 00:00:00 2001 From: Freeman Date: Sat, 4 Nov 2023 14:55:53 +0100 Subject: [PATCH 4/4] missed mats --- technic/machines/register/alloy_recipes.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 4c0af1cb..5605207c 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -29,8 +29,8 @@ local recipes = { -- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black -- improves its tensile strength and wear resistance …" {"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2}, - {mat.ice, "bucket:bucket_empty", "bucket:bucket_water", 1 }, - {"default:obsidian", "bucket:bucket_empty", "bucket:bucket_lava", 1 }, + {mat.ice, mat.bucket_empty, mat.bucket_water, 1 }, + {mat.obsidian, mat.bucket_empty, mat.bucket_lava, 1 }, } if minetest.get_modpath("ethereal") then