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/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 diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index d3b29367..672c5640 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, + output = output, + items = data.input, + width = 0, + }) + end if have_i3 then i3.register_craft({ type = typename, @@ -97,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) @@ -133,7 +152,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