// priority: 100

//Fragment Combiner

function fragmentCombiner(input, out) {

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:fragment_combiner", 100)
    .requireItem(Item.of(input, 4))
    .produceItem(Item.of(out, 1))
    .resetOnError()
    })

}
    
fragmentCombiner('caveopolis:iron_fragment', 'minecraft:raw_iron')   
fragmentCombiner('caveopolis:copper_fragment', 'minecraft:raw_copper')   
fragmentCombiner('caveopolis:gold_fragment', 'minecraft:raw_gold')   
fragmentCombiner('caveopolis:lead_fragment', 'thermal:raw_lead')   
fragmentCombiner('caveopolis:tin_fragment', 'thermal:raw_tin')   
fragmentCombiner('caveopolis:silver_fragment', 'thermal:raw_silver')   
fragmentCombiner('caveopolis:nickel_fragment', 'thermal:raw_nickel')   
fragmentCombiner('caveopolis:redstone_fragment', 'minecraft:redstone')   
fragmentCombiner('caveopolis:lapis_lazuli_fragment', 'minecraft:lapis_lazuli')   
fragmentCombiner('caveopolis:quartz_fragment', 'minecraft:quartz')   
fragmentCombiner('caveopolis:glowstone_fragment', 'minecraft:glowstone_dust')   
fragmentCombiner('caveopolis:mixed_stone_fragment', 'caveopolis:raw_mixed_stone')   
fragmentCombiner('caveopolis:uranium_fragment', 'mekanism:raw_uranium')   
fragmentCombiner('caveopolis:osmium_fragment', 'mekanism:raw_osmium')   
fragmentCombiner('caveopolis:fluorite_fragment', 'mekanism:fluorite_gem')   

fragmentCombiner('caveopolis:moss_ball', 'minecraft:moss_block')   
fragmentCombiner('caveopolis:diorite_pebble', 'minecraft:diorite')   
fragmentCombiner('caveopolis:granite_pebble', 'minecraft:granite')   
fragmentCombiner('caveopolis:andesite_pebble', 'minecraft:andesite')   
fragmentCombiner('caveopolis:stone_pebble', 'minecraft:stone')   
fragmentCombiner('caveopolis:cobblestone_pebble', 'minecraft:cobblestone')   
    



function fragmentCombiner8(input, out) {

onEvent('recipes', e => {
    e.recipes.custommachinery.custom_machine("caveopolis:fragment_combiner", 100)
    .requireItem(Item.of(input, 8))
    .produceItem(Item.of(out, 1))
    })

}
    
fragmentCombiner8('caveopolis:diamond_fragment', 'minecraft:diamond')   
fragmentCombiner8('caveopolis:emerald_fragment', 'minecraft:emerald')   
fragmentCombiner8('caveopolis:coal_fragment', 'minecraft:coal')   
fragmentCombiner8('caveopolis:charcoal_fragment', 'minecraft:charcoal')   
fragmentCombiner8('caveopolis:debris_fragment', 'minecraft:ancient_debris')   
fragmentCombiner8('minecraft:blaze_powder', 'minecraft:blaze_rod')   
  
    




//Block Recipe
    
onEvent('recipes', e => {
    e.shaped(Item.of('custommachinery:custom_machine_item', '{machine:"caveopolis:fragment_combiner"}'), ['SSS','SCS', 'SSS'], {S: 'caveopolis:mixed_stone_ingot', C: 'caveopolis:stone_crafting_table'}).id('caveopolis:fragment_combiner')
})