import static gregtech.api.GTValues.*
import gregtech.api.metatileentity.multiblock.CleanroomType


//JEI HIDES 
mods.jei.yeet(item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:gold", "spec": "UPGRADE", "upgrade": []]]))
mods.jei.yeet(item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:diamond", "spec": "UPGRADE", "upgrade": []]]))
mods.jei.yeet(item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:iron", "spec": "UPGRADE", "upgrade": []]]))
mods.jei.yeet(item('ironbackpacks:upgrade'))
mods.jei.yeet(item('ironbackpacks:upgrade').withNbt(["upgrade": "ironbackpacks:damage_bar"]))
mods.jei.yeet(item('ironbackpacks:upgrade').withNbt(["upgrade": "ironbackpacks:lock"]))
mods.jei.yeet(item('ironbackpacks:upgrade').withNbt(["upgrade": "ironbackpacks:extra_upgrade"]))
mods.jei.yeet(item('ironbackpacks:upgrade').withNbt(["upgrade": "ironbackpacks:everlasting"]))
mods.jei.yeet(item('ironchest:iron_chest', 3))
mods.jei.yeet(item('ironchest:iron_chest', 4))
mods.jei.yeet(item('ironchest:iron_chest', 5))
mods.jei.yeet(item('ironchest:copper_silver_chest_upgrade'))
mods.jei.yeet(item('ironchest:copper_iron_chest_upgrade'))
mods.jei.yeet(item('ironchest:silver_gold_chest_upgrade'))
mods.jei.yeet(item('ironchest:wood_copper_chest_upgrade'))
mods.jei.yeet(item('ironchest:diamond_crystal_chest_upgrade'))

//RECIPE REMOVES
crafting.removeByOutput(item('ironchest:iron_chest'))
crafting.removeByOutput(item('ironchest:iron_chest', 1))
crafting.removeByOutput(item('ironchest:iron_chest', 2))
crafting.removeByOutput(item('ironchest:iron_chest', 6))
crafting.removeByOutput(item('ironchest:wood_iron_chest_upgrade'))
crafting.removeByOutput(item('ironchest:iron_gold_chest_upgrade'))
crafting.removeByOutput(item('ironchest:gold_diamond_chest_upgrade'))
crafting.removeByOutput(item('ironchest:diamond_obsidian_chest_upgrade'))



//RECIPE ADDITIONS

//BACKPACK THREADS
Spooling.recipeBuilder()
   .EUt(VA[LV]).duration(80)
   .inputs(metaitem('wireFineCopper') * 2)
   .fluidInputs(fluid("iron") * 144)
   .outputs(item('tjcore:backpack_iron_thread') * 4)
   .buildAndRegister()
Spooling.recipeBuilder()
   .EUt(VA[MV]).duration(80)
   .fluidInputs(fluid("gold") * 288)
   .inputs(item('tjcore:backpack_iron_thread') * 4)
   .outputs(item('tjcore:backpack_gold_thread') * 4)
   .buildAndRegister()
Spooling.recipeBuilder()
   .EUt(VA[HV]).duration(80)
   .fluidInputs(fluid("mercury") * 288)
   .inputs(item('tjcore:backpack_gold_thread') * 4)
   .outputs(item('tjcore:backpack_diamond_thread') * 4)
   .buildAndRegister()
//BACKPACKS
crafting.addShaped('tj_leather_backpack', item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:basic", "spec": "NONE", "upgrade": []]]), [
        [ore('itemLeather'), ore('plateIron') ,ore('itemLeather')],
        [ore('itemLeather'), ore('chestWood'), ore('itemLeather')], 
        [ore('itemLeather'), ore('itemLeather'), ore('itemLeather')]
])
crafting.addShaped('tj_iron_backpack', item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:iron", "spec": "STORAGE", "upgrade": []]]), [
        [item('tjcore:backpack_iron_thread'), ore('plateIron') ,item('tjcore:backpack_iron_thread')],
        [ore('plateIron'), item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:basic", "spec": "NONE", "upgrade": []]]), ore('plateIron')], 
        [item('tjcore:backpack_iron_thread'), ore('plateIron'), item('tjcore:backpack_iron_thread')]
])
crafting.addShaped('tj_gold_backpack', item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:gold", "spec": "STORAGE", "upgrade": []]]), [
        [item('tjcore:backpack_gold_thread'), ore('plateGold') ,item('tjcore:backpack_gold_thread')],
        [ore('plateGold'), item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:iron", "spec": "STORAGE", "upgrade": []]]), ore('plateGold')], 
        [item('tjcore:backpack_gold_thread'), ore('plateGold'), item('tjcore:backpack_gold_thread')]
])
crafting.addShaped('tj_diamond_backpack', item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:diamond", "spec": "STORAGE", "upgrade": []]]), [
        [item('tjcore:backpack_diamond_thread'), ore('plateDiamond') ,item('tjcore:backpack_diamond_thread')],
        [ore('plateDiamond'), item('ironbackpacks:backpack').withNbt(["packInfo": ["type": "ironbackpacks:gold", "spec": "STORAGE", "upgrade": []]]), ore('plateDiamond')], 
        [item('tjcore:backpack_diamond_thread'), ore('plateDiamond'), item('tjcore:backpack_diamond_thread')]
])
//CHESTS
//IRON
crafting.addShaped('tj_iron_chest', item('ironchest:iron_chest'), [
        [metaitem('plateIron'), metaitem('plateDoubleIron') ,metaitem('plateIron')],
        [metaitem('plateDoubleIron'), ore('chestWood'), metaitem('plateDoubleIron')], 
        [metaitem('plateIron'), metaitem('plateDoubleIron')  , metaitem('plateIron')]
])
//GOLD
crafting.addShaped('tj_gold_chest', item('ironchest:iron_chest', 1), [
        [metaitem('plateGold'), metaitem('plateDoubleGold') ,metaitem('plateGold')],
        [metaitem('plateDoubleGold'), item('ironchest:iron_chest'), metaitem('plateDoubleGold')], 
        [metaitem('plateGold'), metaitem('plateDoubleGold')  , metaitem('plateGold')]
])
//DIAMOND
crafting.addShaped('tj_diamond_chest', item('ironchest:iron_chest', 2), [
        [metaitem('plateDiamond'), metaitem('plateDiamond') ,metaitem('plateDiamond')],
        [metaitem('plateGlass'), item('ironchest:iron_chest', 1), metaitem('plateGlass')], 
        [metaitem('plateDiamond'), metaitem('plateDiamond')  , metaitem('plateDiamond')]
])
//OBSIDIAN
crafting.addShaped('tj_obsidian_chest', item('ironchest:iron_chest', 6), [
        [metaitem('plateObsidian'), metaitem('plateObsidian') ,metaitem('plateObsidian')],
        [metaitem('plateFluixLaminatedGlass'), item('ironchest:iron_chest', 2), metaitem('plateFluixLaminatedGlass')], 
        [metaitem('plateObsidian'), metaitem('plateObsidian')  , metaitem('plateObsidian')]
])
//Conversion Upgrades (Mirrored recipes from chests)
//CHESTS
//WOOD TO IRON
crafting.addShaped('tj_iron_chest_upgrade', item('ironchest:wood_iron_chest_upgrade'), [
        [metaitem('plateIron'), metaitem('plateDoubleIron') ,metaitem('plateIron')],
        [metaitem('plateDoubleIron'), metaitem('wooden_form.empty'), metaitem('plateDoubleIron')], 
        [metaitem('plateIron'), metaitem('plateDoubleIron')  , metaitem('plateIron')]
])
//IRON TO GOLD
crafting.addShaped('tj_gold_chest_upgrade', item('ironchest:iron_gold_chest_upgrade'), [
        [metaitem('plateGold'), metaitem('plateDoubleGold') ,metaitem('plateGold')],
        [metaitem('plateDoubleGold'), metaitem('plateIron'), metaitem('plateDoubleGold')], 
        [metaitem('plateGold'), metaitem('plateDoubleGold')  , metaitem('plateGold')]
])
//GOLD TO DIAMOND
crafting.addShaped('tj_diamond_chest_upgrade', item('ironchest:gold_diamond_chest_upgrade'), [
        [metaitem('plateDiamond'), metaitem('plateDiamond') ,metaitem('plateDiamond')],
        [metaitem('plateGlass'), metaitem('plateGold'), metaitem('plateGlass')], 
        [metaitem('plateDiamond'), metaitem('plateDiamond')  , metaitem('plateDiamond')]
])
//DIAMOND TO OBSIDIAN
crafting.addShaped('tj_obsidian_chest_upgrade', item('ironchest:diamond_obsidian_chest_upgrade'), [
        [metaitem('plateObsidian'), metaitem('plateObsidian') ,metaitem('plateObsidian')],
        [metaitem('plateFluixLaminatedGlass'), metaitem('plateDiamond'), metaitem('plateFluixLaminatedGlass')], 
        [metaitem('plateObsidian'), metaitem('plateObsidian')  , metaitem('plateObsidian')]
])