// priority: 100

//Basic Barrel


function waterTag(time, item, outputAmount){

    onEvent('recipes', e => {
       e.recipes.custommachinery.custom_machine("caveopolis:basic_barrel", time)
            .requireItemTag(item, 1)
            .produceFluid(Fluid.of("minecraft:water", outputAmount))
            .resetOnError()
     })
    }

    waterTag(40, 'minecraft:saplings', 100)
    waterTag(40, 'minecraft:leaves', 25)

function waterItem(time, item, outputAmount){

    onEvent('recipes', e => {
        e.recipes.custommachinery.custom_machine("caveopolis:basic_barrel", time)
            .requireItem(item)
            .produceFluid(Fluid.of("minecraft:water", outputAmount))
            .resetOnError()
        })
    }
    
    waterItem(40, 'minecraft:moss_block', 80)
    waterItem(40, 'caveopolis:moss_ball', 20)
    waterItem(40, 'minecraft:moss_carpet', 10)

    //Block Recipe

    onEvent('recipes', e => {
    e.shaped(Item.of('custommachinery:custom_machine_item', '{machine:"caveopolis:basic_barrel"}'), ['PHP','BPB', 'PPP'], {H: 'woodenhopper:wooden_hopper', P: '#minecraft:planks', B: 'woodenbucket:wooden_bucket'}).id('caveopolis:basic_barrel')
    })