ServerEvents.recipes(event => {
    //Sherd Duplication
    Ingredient.of('#minecraft:decorated_pot_sherds').getItemIds().forEach(type => {
        let name = type.split(':')[1];
        event.shaped(`4x ${type}`, [
            'ABA',
            'ACA',
            'AAA'
        ], {
            A: 'brick',
            B: type,
            C: 'terracotta'
        }).id(`kubejs:crafting/${name}`);
    });

    //Pillars
    let pillars = (output, input, event) => {
        let name = output.split(':')[1];
        event.shaped(`2x ${output}`, ['A', 'A'], { A: input }).id(`kubejs:crafting/${name}`);
    };
    ['granite', 'diorite', 'andesite'].forEach(type => { pillars(`quark:${type}_pillar`, `polished_${type}`, event); });
    ['calcite', 'tuff', 'dripstone'].forEach(type => { pillars(`quark:${type}_pillar`, `quark:polished_${type}`, event); });
    pillars('quark:mud_pillar', 'mud_bricks', event);
    ['limestone', 'jasper', 'shale', 'myalite'].forEach(type => { pillars(`quark:${type}_pillar`, `quark:polished_${type}`, event); });
    pillars('quark:midori_pillar', 'quark:midori_block', event);
    pillars('quark:iron_pillar', 'quark:iron_plate', event);

    //New Recipes
    event.remove({ id: 'minecraft:lodestone' });
    event.remove({ id: 'minecraft:bundle' });
    event.remove({ id: 'minecraft:lead' });
    event.shaped('minecraft:lodestone', [
        'AAA',
        'ABA',
        'AAA'
    ], {
        A: 'minecraft:chiseled_stone_bricks',
        B: '#forge:ingots/iron'
    }).id('kubejs:crafting/lodestone');
    event.shaped('minecraft:bundle', [
        'A',
        'B'
    ], {
        A: '#forge:string',
        B: '#forge:leather'
    }).id('kubejs:crafting/bundle');
    event.shaped('2x lead', [
        'AA ',
        'AA ',
        '  A'
    ], {
        A: '#forge:string'
    }).id('kubejs:crafting/lead');
    event.shaped('saddle', [
        ' A ',
        'ABA'
    ], {
        A: '#forge:leather',
        B: '#forge:ingots/iron'
    }).id('kubejs:crafting/saddle');

    //More Rails
    event.remove({ id: 'minecraft:rail' });
    event.remove({ id: 'minecraft:powered_rail' });
    event.remove({ id: 'minecraft:detector_rail' });
    event.remove({ id: 'minecraft:activator_rail' });

    event.shaped('8x rail', [
        'A A',
        'ABA',
        'A A'
    ], {
        A: '#forge:nuggets/iron',
        B: '#forge:rods/wooden'
    }).id('kubejs:crafting/rail');
    event.shaped('4x powered_rail', [
        'A A',
        'ABA',
        'ACA'
    ], {
        A: '#forge:nuggets/gold',
        B: '#forge:rods/wooden',
        C: '#forge:dusts/redstone'
    }).id('kubejs:crafting/powered_rail');
    event.shaped('4x detector_rail', [
        'A A',
        'ABA',
        'ACA'
    ], {
        A: '#forge:nuggets/iron',
        B: 'stone_pressure_plate',
        C: '#forge:dusts/redstone'
    }).id('kubejs:crafting/detector_rail');
    event.shaped('4x activator_rail', [
        'ABA',
        'ACA',
        'ABA'
    ], {
        A: '#forge:nuggets/iron',
        B: '#forge:rods/wooden',
        C: 'redstone_torch'
    }).id('kubejs:crafting/activator_rail');

    //Recovery Compass but Cheaper
    event.remove({ id: 'minecraft:recovery_compass' });
    event.shapeless('recovery_compass', ['compass', 'soul_bead']).id('kubejs:crafting/recovery_compass');

    //Map but Easier
    event.remove({ id: 'minecraft:map' });
    event.shapeless('map', ['paper', 'paper', 'paper', '#forge:dyes/black']).id('kubejs:crafting/map');
});