// priority: 100

//Advanced Barrel


function lava(time, item, heatSource, outputAmount){

    onEvent('recipes', e => {
        e.recipes.custommachinery.custom_machine("caveopolis:advanced_barrel", time)
            .requireStructure([["l"], ["m"]], {"l": heatSource})
            .requireItemTag(item, 1)
            .produceFluid(Fluid.of("minecraft:lava", outputAmount))
            .resetOnError()
        })
    }
    
    lava(160, 'forge:stone', 'minecraft:fire', 100)
    lava(40, 'caveopolis:pebble', 'minecraft:fire', 25)

    lava(160, 'forge:stone', 'minecraft:campfires', 100)
    lava(40, 'caveopolis:pebble', 'minecraft:campfires', 25)

    lava(80, 'forge:stone', 'minecraft:lava', 100)
    lava(20, 'caveopolis:pebble', 'minecraft:lava', 25)

    lava(20, 'forge:stone', 'mekanism:block_uranium', 100)
    lava(5, 'caveopolis:pebble', 'mekanism:block_uranium', 25)

    lava(12, 'forge:stone', 'mekanism:superheating_element', 100)
    lava(3, 'caveopolis:pebble', 'mekanism:superheating_element', 25)

  
    
    //Block Recipe
    
    onEvent('recipes', e => {
    e.shaped(Item.of('custommachinery:custom_machine_item', '{machine:"caveopolis:advanced_barrel"}'), ['SHS','SBS', 'SBS'], {H: 'woodenhopper:wooden_hopper', S: 'caveopolis:mixed_stone_ingot', B: Item.of('custommachinery:custom_machine_item', '{machine:"caveopolis:basic_barrel"}')}).id('caveopolis:advanced_barrel')
    })

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:advanced_barrel", 200)
        .requireStructure([["l"], ["m"]], {"l": 'mekanism:block_uranium'})
        .requireItemTag('powah:uraninite', 1)
        .produceFluid(Fluid.of("caveopolis:nuclear_waste_fluid", 100))
        .resetOnError()
})




    