From 3382310015146c709d34f63f14ca0a371dc1d890 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Tue, 21 Mar 2023 13:30:31 +0100 Subject: [PATCH] Add resource dusts --- compatibility.lua | 46 +++++++++ craftitems.lua | 250 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 296 insertions(+) diff --git a/compatibility.lua b/compatibility.lua index 49aa587..7cf39e1 100644 --- a/compatibility.lua +++ b/compatibility.lua @@ -484,7 +484,15 @@ if industrialtest.mclAvailable then industrialtest.elementKeys.string="mcl_mobitems:string" industrialtest.elementKeys.junglePlanks="mcl_core:junglewood" industrialtest.elementKeys.ironIngot="mcl_core:iron_ingot" + industrialtest.elementKeys.ironLump="mcl_raw_ores:raw_iron" + industrialtest.elementKeys.goldIngot="mcl_core:gold_ingot" + industrialtest.elementKeys.goldLump="mcl_raw_ores:raw_gold" industrialtest.elementKeys.copperIngot="mcl_copper:copper_ingot" + industrialtest.elementKeys.copperLump="mcl_copper:raw_copper" + industrialtest.elementKeys.uraniumLump="industrialtest:raw_uranium" + industrialtest.elementKeys.coal="mcl_core:coal_lump" + industrialtest.elementKeys.clay="mcl_core:clay_lump" + industrialtest.elementKeys.diamond="mcl_core:diamond" industrialtest.elementKeys.powerCarrier="mesecons:mesecon" industrialtest.elementKeys.furnace="mcl_furnaces:furnace" industrialtest.elementKeys.stone="mcl_core:stone" @@ -493,11 +501,26 @@ if industrialtest.mclAvailable then industrialtest.elementKeys.gravel="mcl_core:gravel" industrialtest.elementKeys.ice="mcl_core:ice" industrialtest.elementKeys.sandstone="mcl_core:sandstone" + industrialtest.elementKeys.obsidian="mcl_core:obsidian" industrialtest.elementKeys.whiteWool="mcl_wool:white" + industrialtest.elementKeys.coalBlock="mcl_core:coalblock" + industrialtest.elementKeys.stoneWithCoal="mcl_core:stone_with_coal" + industrialtest.elementKeys.clayBlock="mcl_core:clay" + industrialtest.elementKeys.diamondBlock="mcl_core:diamondblock" + industrialtest.elementKeys.stoneWithDiamond="mcl_core:stone_with_diamond" + industrialtest.elementKeys.ironBlock="mcl_core:ironblock" + industrialtest.elementKeys.stoneWithIron="mcl_core:stone_with_iron" + industrialtest.elementKeys.goldBlock="mcl_core:goldblock" + industrialtest.elementKeys.stoneWithGold="mcl_core:stone_with_gold" + industrialtest.elementKeys.copperBlock="mcl_copper:block" + industrialtest.elementKeys.stoneWithCopper="mcl_copper:stone_with_copper" -- register required minerals that are not available in MCL industrialtest.registerMetal("tin","Tin",3,3) industrialtest.elementKeys.tinIngot="industrialtest:tin_ingot" + industrialtest.elementKeys.tinBlock="industrialtest:tin_block" + industrialtest.elementKeys.stoneWithTin="industrialtest:stone_with_tin" + industrialtest.elementKeys.tinLump="industrialtest:raw_tin" --register other items that are not available in MCL minetest.register_craftitem("industrialtest:bronze_ingot",{ @@ -652,9 +675,18 @@ elseif industrialtest.mtgAvailable then end industrialtest.gameTexturePrefix="mtg" industrialtest.elementKeys.tinIngot="default:tin_ingot" + industrialtest.elementKeys.tinLump="default:tin_lump" industrialtest.elementKeys.bronzeIngot="default:bronze_ingot" industrialtest.elementKeys.ironIngot="default:steel_ingot" + industrialtest.elementKeys.ironLump="default:iron_lump" + industrialtest.elementKeys.goldIngot="default:gold_ingot" + industrialtest.elementKeys.goldLump="default:gold_lump" industrialtest.elementKeys.copperIngot="default:copper_ingot" + industrialtest.elementKeys.copperLump="default:copper_lump" + industrialtest.elementKeys.uraniumLump="industrialtest:uranium_lump" + industrialtest.elementKeys.coal="default:coal_lump" + industrialtest.elementKeys.clay="default:clay_lump" + industrialtest.elementKeys.diamond="default:diamond" industrialtest.elementKeys.stick="default:stick" industrialtest.elementKeys.flint="default:flint" industrialtest.elementKeys.snowball="default:snow" @@ -668,7 +700,21 @@ elseif industrialtest.mtgAvailable then industrialtest.elementKeys.gravel="default:gravel" industrialtest.elementKeys.ice="default:ice" industrialtest.elementKeys.sandstone="default:sandstone" + industrialtest.elementKeys.obsidian="default:obsidian" industrialtest.elementKeys.whiteWool="wool:white" + industrialtest.elementKeys.coalBlock="default:coalblock" + industrialtest.elementKeys.stoneWithCoal="default:stone_with_coal" + industrialtest.elementKeys.clayBlock="default:clay" + industrialtest.elementKeys.diamondBlock="default:diamondblock" + industrialtest.elementKeys.stoneWithDiamond="default:stone_with_diamond" + industrialtest.elementKeys.ironBlock="default:steelblock" + industrialtest.elementKeys.stoneWithIron="default:stone_with_iron" + industrialtest.elementKeys.goldBlock="default:goldblock" + industrialtest.elementKeys.stoneWithGold="default:stone_with_gold" + industrialtest.elementKeys.copperBlock="default:copperblock" + industrialtest.elementKeys.stoneWithCopper="default:stone_with_copper" + industrialtest.elementKeys.tinBlock="default:tinblock" + industrialtest.elementKeys.stoneWithTin="default:stone_with_tin" else error("No compatible games found!") end diff --git a/craftitems.lua b/craftitems.lua index 01e0858..d847ade 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -68,6 +68,256 @@ minetest.register_craft({ }) -- TODO: add rubber crafts using extractor +-- Dust +local function registerResourceDust(name,displayName,resources,color,registerMaceratorRecipe) + minetest.register_craftitem("industrialtest:"..name.."_dust",{ + description=S(displayName.." Dust"), + inventory_image="industrialtest_dust.png", + color=color + }) + if registerMaceratorRecipe then + for _,value in ipairs(resources) do + industrialtest.api.registerMaceratorRecipe({ + output="industrialtest:"..name.."_dust "..(value.count or 1), + recipe=value.resource + }) + end + end +end +local resources={ + { + resource=industrialtest.elementKeys.coalBlock, + count=9 + }, + { + resource=industrialtest.elementKeys.stoneWithCoal, + count=2 + }, + {resource=industrialtest.elementKeys.coal} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="mcl_deepslate:deepslate_with_coal", + count=2 + }) +end +registerResourceDust("coal","Coal",resources,"#101010ff",true) +registerResourceDust("clay","Clay",{ + { + resource=industrialtest.elementKeys.clayBlock, + count=2 + } +},"#9090a0ff",true) +resources={ + { + resource=industrialtest.elementKeys.diamondBlock, + count=9 + }, + { + resource=industrialtest.elementKeys.stoneWithDiamond, + count=2 + }, + {resource=industrialtest.elementKeys.diamond} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="mcl_deepslate:deepslate_with_diamond", + count=2 + }) +end +registerResourceDust("diamond","Diamond",resources,"#90e2c9ff",true) +minetest.register_craft({ + type="cooking", + output=industrialtest.elementKeys.diamond, + recipe="industrialtest:diamond_dust" +}) +resources={ + { + resource=industrialtest.elementKeys.ironBlock, + count=9 + }, + { + resource=industrialtest.elementKeys.stoneWithIron, + count=2 + }, + { + resource=industrialtest.elementKeys.ironLump, + count=2 + }, + {resource=industrialtest.elementKeys.ironIngot} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="mcl_deepslate:deepslate_with_iron", + count=2 + }) +end +registerResourceDust("iron","Iron",resources,"#b5b5b5ff",true) +minetest.register_craft({ + type="cooking", + output=industrialtest.elementKeys.ironIngot, + recipe="industrialtest:iron_dust" +}) +if industrialtest.mclAvailable then + registerResourceDust("lapis_lazuli","Lapis Lazuli",{ + { + resource="mcl_core:lapislazuliblock", + count=9 + }, + { + resource="mcl_core:stone_with_lapis_lazuli", + count=2 + }, + { + resource="mcl_deepslate:deepslate_with_lapis_lazuli", + count=9 + }, + {resource="mcl_core:lapis_lazuli"} + },"#292d76ff",true) +end +registerResourceDust("obsidian","Obsidian",{{resource=industrialtest.elementKeys.obsidian}},"#292843ff",true) +resources={ + { + resource=industrialtest.elementKeys.goldBlock, + count=9 + }, + { + resource=industrialtest.elementKeys.stoneWithGold, + count=2 + }, + { + resource=industrialtest.elementKeys.goldLump, + count=2 + }, + {resource=industrialtest.elementKeys.goldIngot} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="mcl_deepslate:deepslate_with_gold", + count=2 + }) +end +registerResourceDust("gold","Gold",resources,"#e4e526ff",true) +minetest.register_craft({ + type="cooking", + output=industrialtest.elementKeys.goldIngot, + recipe="industrialtest:gold_dust" +}) +resources={ + { + resource=industrialtest.elementKeys.copperBlock, + count=9 + }, + { + resource=industrialtest.elementKeys.stoneWithCopper, + count=2 + }, + { + resource=industrialtest.elementKeys.copperLump, + count=2 + }, + {resource=industrialtest.elementKeys.copperIngot} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="mcl_deepslate:deepslate_with_copper", + count=2 + }) +end +registerResourceDust("copper","Copper",resources,"#a45e25ff",true) +minetest.register_craft({ + type="cooking", + output=industrialtest.elementKeys.copperIngot, + recipe="industrialtest:copper_dust" +}) +resources={ + { + resource=industrialtest.elementKeys.tinBlock, + count=9 + }, + { + resource=industrialtest.elementKeys.stoneWithTin, + count=2 + }, + { + resource=industrialtest.elementKeys.tinLump, + count=2 + }, + {resource=industrialtest.elementKeys.tinIngot} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="industrialtest:deepslate_with_tin", + count=2 + }) +end +registerResourceDust("tin","Tin",resources,"#f1f1f1ff",true) +minetest.register_craft({ + type="cooking", + output=industrialtest.elementKeys.tinIngot, + recipe="industrialtest:tin_dust" +}) +resources={ + { + resource="industrialtest:uranium_block", + count=9 + }, + { + resource="industrialtest:stone_with_uranium", + count=2 + }, + { + resource=industrialtest.elementKeys.uraniumLump, + count=2 + }, + {resource="industrialtest:uranium_ingot"} +} +if industrialtest.mclAvailable then + table.insert(resources,{ + resource="industrialtest:deepslate_with_uranium", + count=2 + }) +end +registerResourceDust("uranium","Uranium",resources,"#3b8c09ff",true) +minetest.register_craft({ + type="cooking", + output="industrialtest:uranium_ingot", + recipe="industrialtest:uranium_dust" +}) +if industrialtest.mtgAvailable then + registerResourceDust("mese","Mese",{ + { + resource="default:mese", + count=9 + }, + { + resource="default:stone_with_mese", + count=2 + }, + {resource="default:mese_crystal"} + },"#909000ff",true) + minetest.register_craft({ + type="cooking", + output="default:mese_crystal", + recipe="industrialtest:mese_dust" + }) +end +registerResourceDust("bronze","Bronze",{},"#e48e88ff",false) +minetest.register_craft({ + type="shaped", + output="industrialtest:bronze_dust 9", + recipe={ + {"industrialtest:copper_dust","industrialtest:copper_dust","industrialtest:copper_dust"}, + {"industrialtest:copper_dust","industrialtest:tin_dust","industrialtest:copper_dust"}, + {"industrialtest:copper_dust","industrialtest:copper_dust","industrialtest:copper_dust"} + } +}) +minetest.register_craft({ + type="cooking", + output=industrialtest.elementKeys.bronzeIngot, + recipe="industrialtest:bronze_dust" +}) + -- Other items minetest.register_craftitem("industrialtest:electronic_circuit",{ description=S("Electronic Circuit"),