// priority: 100

//Ore Extractor


//Basic

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 100)
        .requireFluid(Fluid.of("caveopolis:ore_forming_water", 100))
        .requireItem('caveopolis:ore_extractor_upgrade_base', "input").chance(0)
        .lootTableOutput("caveopolis:ore_extractor_base") 
        .resetOnError() 
    })

//Tier 1

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 100)
        .requireFluid(Fluid.of("caveopolis:ore_forming_water", 200))
        .requireItem('caveopolis:ore_extractor_upgrade_tier_1', "input").chance(0)
        .lootTableOutput("caveopolis:ore_extractor_tier_1")  
        .resetOnError()
    })

//Tier 2

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 100)
        .requireFluid(Fluid.of("caveopolis:ore_forming_water", 300))
        .requireItem('caveopolis:ore_extractor_upgrade_tier_2', "input").chance(0)
        .requireEnergyPerTick(20)
        .lootTableOutput("caveopolis:ore_extractor_tier_2")  
        .resetOnError()
    })

//Tier 3

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 100)
        .requireFluid(Fluid.of("caveopolis:ore_forming_water", 400))
        .requireItem('caveopolis:ore_extractor_upgrade_tier_3', "input").chance(0)
        .requireEnergyPerTick(50)
        .lootTableOutput("caveopolis:ore_extractor_tier_3")  
        .resetOnError()
    })

//Tier 4

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 100)
        .requireFluid(Fluid.of("caveopolis:ore_forming_water", 500))
        .requireItem('caveopolis:ore_extractor_upgrade_tier_4', "input").chance(0)
        .requireEnergyPerTick(50)
        .lootTableOutput("caveopolis:ore_extractor_tier_4")  
        .resetOnError()
    })




//Latex    

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 200)
        .requireFluid(Fluid.of("thermal:latex", 100))
        .requireEnergyPerTick(5)
        .produceItem("thermal:rubber")  
    })

//Blaze    

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:ore_extractor", 300)
        .requireFluid(Fluid.of("minecraft:lava", 250))
        .requireEnergyPerTick(10)
        .requireItem('caveopolis:ore_extractor_upgrade_blazing', "input").chance(0)
        .produceItem("minecraft:blaze_powder")  
    })



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

    