//priority: 0

ServerEvents.tags('item', event => {
  event.add('kubejs:compressed_cobblestone', [
    'excompressum:compressed_cobblestone',
    'cyclic:compressed_cobblestone',
    'rcc:cobblestone_one'
  ])
})

ServerEvents.recipes(event => {
    event.remove({ output: 'cagedmobs:mob_cage'})
    event.remove({ output: 'cagedmobs:dna_sampler'})

    event.shapeless('9x voidblock:dust', [
        'exnihilosequentia:dust'
    ])
    
    event.campfireCooking('minecraft:brick', 'minecraft:clay_ball')

    event.shaped('cagedmobs:mob_cage', [
        ' C ',
        'C C',
        'III'
    ], {
        C: 'minecraft:chain',
        I: 'minecraft:iron_ingot'
    })

    event.shaped('cagedmobs:dna_sampler', [
        'I  ',
        ' WI',
        ' IN'
    ], {
        I: 'minecraft:iron_ingot',
        W: 'minecraft:white_stained_glass',
        N: 'minecraft:iron_nugget'
    })

    event.remove({ output: 'immersiveengineering:ingot_steel', type: 'immersiveengineering:blast_furnace'})
    event.remove({ output: 'immersiveengineering:storage_steel', type: 'immersiveengineering:blast_furnace'})

    event.custom({
        "type": "immersiveengineering:blast_furnace",
        "input": {
            "tag": "forge:ingots/iron"
        },
        "result": {
            "tag": "forge:ingots/steel"
        },
        "slag": {
            "tag": "forge:slag"
        },
        "time": 300
    })

    event.custom({
        "type": "immersiveengineering:blast_furnace",
        "input": {
            "tag": "forge:storage_blocks/iron"
        },
        "result": {
            "tag": "forge:storage_blocks/steel"
        },
        "slag": {
            "base_ingredient": {
                "tag": "forge:slag"
            },
            "count": 9
        },
        "time": 2400
    })

    event.remove({ output: 'minecraft:charcoal', type: 'immersiveengineering:coke_oven'})
    event.remove({ output: 'immersiveengineering:coal_coke', type: 'immersiveengineering:coke_oven'})
    event.remove({ output: 'immersiveengineering:storage_coal_coke', type: 'immersiveengineering:coke_oven'})

    event.custom({
        "type": "immersiveengineering:coke_oven",
        "creosote": 250,
        "input": {
            "tag": "minecraft:logs"
        },
        "result": {
            "item": "minecraft:charcoal"
        },
        "time": 225
    })

    event.custom({
        "type": "immersiveengineering:coke_oven",
        "creosote": 500,
        "input": {
            "item": "minecraft:coal"
        },
        "result": {
            "tag": "forge:coal_coke"
        },
        "time": 450
    })

    event.custom({
        "type": "immersiveengineering:coke_oven",
        "creosote": 5000,
        "input": {
            "item": "minecraft:coal_block"
        },
        "result": {
            "tag": "forge:storage_blocks/coal_coke"
        },
        "time": 4050
    })
    const compressed = [
    'excompressum:compressed_cobblestone',
    'cyclic:compressed_cobblestone',
    'rcc:cobblestone_one'
    ]

    compressed.forEach(id => {
        event.replaceInput(
        { input: id },
        id,
        '#kubejs:compressed_cobblestone'
        )
    })

    event.remove({ id: 'excompressum:compressed_cobblestone', type: 'excompressum:compressed_hammer'})

    event.custom({
        "type": "excompressum:compressed_hammer",
        "input": {
            "tag":"kubejs:compressed_cobblestone"
        },
        "lootTable": {
            "type": "minecraft:block",
            "pools": [
            {
                "rolls": 1,
                "entries": [
                {
                    "type": "minecraft:item",
                    "name": "minecraft:gravel",
                    "functions": [
                    {
                        "function": "minecraft:set_count",
                        "count": 9
                    }]
                }],
                "conditions": []
            }]
        }
    })

    event.shaped('minecraft:netherite_upgrade_smithing_template', [
        'NNN',
        'NIN',
        'NDN'
    ], {
        N: 'minecraft:netherrack',
        I: 'cagedmobs:star_infused_netherite_ingot',
        D: 'minecraft:diamond_block'
    })

    event.replaceInput({ output: 'cyclic:crusher'}, 'cyclic:flint_block', 'pncepcb:high_power_finished_pcb')
})