ServerEvents.recipes(event => {
    event.remove({id: 'naturesaura:tree_ritual/nature_altar'})
    event.remove({id: 'naturesaura:altar/infused_iron'})
    event.remove({id: 'naturesaura:altar/infused_iron_block'})
    event.remove({id: 'naturesaura:altar/tainted_gold'})
    event.remove({id: 'naturesaura:altar/tainted_gold_block'})
    event.remove({id: 'naturesaura:gold_fiber'})
    event.remove({ not: { type: 'naturesaura:tree_ritual' }, output: 'naturesaura:ancient_sapling' })
})

ServerEvents.recipes(event => {
    //Spirit of Calling
    event.replaceInput(
        { id: 'naturesaura:calling_spirit' }, // Arg 1: the filter
        'minecraft:diamond',            // Arg 2: the item to replace
        'occultism:spirit_attuned_gem'         // Arg 3: the item to replace it with
    )
    
    //Natural Altar
    event.custom({
    type: 'naturesaura:tree_ritual',
        ingredients: [
            {
                item: 'bloodmagic:etherealslate',
            },
            {
                item: 'naturesaura:token_joy',
            },
            {
                item: 'occultism:otherstone',
            },
            {
                item: 'occultism:otherstone',
            },
            {
                item: 'naturesaura:gold_leaf',
            },
            {
                item: 'naturesaura:gold_leaf',
            },
            {
                item: 'eidolon:arcane_gold_ingot',
            },
            {
                item: 'eidolon:arcane_gold_ingot',
            },
        ],
        sapling: {
            item: 'blue_skies:comet_sapling',
        },
        output: {
            item: 'naturesaura:nature_altar',
        },
        time: 500,
    }).id('naturesaura:nature_altar')
    
    //Infused Iron Ingot
    event.custom({
    type: 'naturesaura:altar',
        input:{
            tag: 'forge:ingots/compressed_iron',
        },
        output: {
            item: 'naturesaura:infused_iron',
        },
        aura: 15000,
        time: 80,
    }).id('naturesaura:altar/infused_iron')
    
    //Infused Iron Block
    event.custom({
    type: 'naturesaura:altar',
        input:{
            tag: 'forge:storage_blocks/compressed_iron',
        },
        output: {
            item: 'naturesaura:infused_iron_block',
        },
        aura: 15000,
        time: 80,
    }).id('naturesaura:altar/infused_iron_block')
    
    //Tainted Gold Ingot
    event.custom({
    type: 'naturesaura:altar',
        input:{
            tag: 'forge:ingots/energetic_alloy',
        },
        output: {
            item: 'naturesaura:tainted_gold',
        },
        aura: 15000,
        time: 80,
    }).id('naturesaura:altar/tainted_gold')
    
    //Tainted Gold Block
    event.custom({
    type: 'naturesaura:altar',
        input:{
            tag: 'forge:storage_blocks/energetic_alloy',
        },
        output: {
            item: 'naturesaura:tainted_gold_block',
        },
        aura: 15000,
        time: 80,
    }).id('naturesaura:altar/tainted_gold_block')

    //Brilliant Fiber
    event.custom({
        type: 'hexerei:mixingcauldron',
        liquid: {
            fluid: 'immersiveengineering:biodiesel',
        },
        ingredients: [
            {
                tag: 'forge:ingots/end_steel',
            },
            {
                tag: 'forge:ingots/end_steel',
            },
            {
                tag: 'forge:ingots/end_steel',
            },
            {
                tag: 'forge:ingots/end_steel',
            },
            {
                tag: 'minecraft:leaves',
            },
            {
                tag: 'minecraft:leaves',
            },
            {
                tag: 'minecraft:leaves',
            },
            {
                tag: 'minecraft:leaves',
            },
        ],
        output: {
            item: 'naturesaura:gold_fiber',
            count: 2
        },
        liquidOutput: {
            fluid: 'immersiveengineering:biodiesel',
        },
        fluidLevelsConsumed: 1000,
    }).id('naturesaura:gold_fiber')
    
    //Infused Iron -> Sky Ingot
    event.custom({
        "type": "lychee:lightning_channeling",
        "hide_in_viewer": false,
        "post": [
          {
            "type": "drop_item",
            "item": "naturesaura:sky_ingot",
            "count": 1
          }
        ],
        "item_in": [
          {
            "item": "naturesaura:infused_iron"
          },
          {
            "item": "elementalcraft:earthcrystal"
          }
        ]
      }
    ).id('lychee:lightning_channeling_infused_iron_sky_ingot')          

    //Tainted Gold -> Sky Ingot
    event.custom({
        "type": "lychee:lightning_channeling",
        "hide_in_viewer": false,
        "post": [
          {
            "type": "drop_item",
            "item": "naturesaura:sky_ingot",
            "count": 2
          }
        ],
        "item_in": [
          {
            "item": "naturesaura:tainted_gold"
          },
          {
            "item": "elementalcraft:firecrystal"
          }
        ]
    }).id('lychee:lightning_channeling_tainted_gold_sky_ingot')        

    //Ingot of the Depths
      event.shaped('naturesaura:depth_ingot',
        ['ABA', 'BCB', 'ABA'], {
          A: 'bloodmagic:demonslate',
          B: 'naturesaura:tainted_gold',
          C: 'naturesaura:sky_ingot'
      }).id('naturesaura:depth_ingot_creation')
})