ServerEvents.recipes(event => {
    const patterns = [
        "square", "slash", "backslash", "inverted_split_triangle", "star",
        "diamond", "knot", "circle", "knot3", "inverted_triangle", "infinity",
        "knot4", "knot2", "triangle", "split_triangle", "hourglass", "bolt"
    ];

    patterns.forEach(patternId => {
        event.shaped(
            Item.of('mna:manaweaving_pattern_recipe_paper', `{manaweave_pattern_id:"mna:manaweave_patterns/${patternId}"}`),
            ['A'],
            { A: Item.of('mna:manaweaving_pattern_recipe_paper') }
        );
    });

    event.shapeless(
        Item.of('dmnr:mutandis', 2),
        [
            '2x kubejs:grains_of_infinity',
            '2x botania:green_petal',
            'botania:lime_petal',
            'minecraft:bone_meal'
        ]
    )
    event.shapeless(
        Item.of('mna:tarma_root'),
        [
            'botania:brown_mystical_flower',
            'dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:tarma_root', 2),
        [
            'botania:brown_double_flower',
            '2x dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:cerublossom'),
        [
            'botania:blue_mystical_flower',
            'dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:cerublossom', 2),
        [
            'botania:blue_double_flower',
            '2x dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:aum'),
        [
            'botania:magenta_mystical_flower',
            'dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:aum', 2),
        [
            'botania:magenta_double_flower',
            '2x dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:wakebloom'),
        [
            'botania:pink_mystical_flower',
            'dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:wakebloom', 2),
        [
            'botania:pink_double_flower',
            '2x dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:desert_nova'),
        [
            'botania:red_mystical_flower',
            'dmnr:mutandis'
        ]
    )
    event.shapeless(
        Item.of('mna:desert_nova', 2),
        [
            'botania:red_double_flower',
            '2x dmnr:mutandis'
        ]
    )
    event.remove({ id: 'magichem:shaped/materia_jar' })
    event.shaped(
        Item.of('magichem:materia_jar'),
        [
            ' A ',
            'BCB',
            'BBB'
        ],
        {
            A: '#forge:treated_wood',
            B: 'minecraft:glass_pane',
            C: 'ars_nouveau:source_jar'
        }
    )
    event.shaped(
        Item.of('magichem:materia_jar', 2),
        [
            ' A ',
            'BCB',
            ' B '
        ],
        {
            A: '#forge:treated_wood',
            B: 'magichem:alchemically_treated_glass_pane',
            C: 'ars_nouveau:source_jar'
        }
    )
    event.shaped(
        Item.of('magichem:materia_jar', 2),
        [
            ' A ',
            'BCB',
            'BBB'
        ],
        {
            A: '#forge:treated_wood_slab',
            B: 'minecraft:glass_pane',
            C: 'starbunclemania:fluid_jar'
        }
    )
    event.shaped(
        Item.of('magichem:materia_jar', 4),
        [
            ' A ',
            'BCB',
            ' B '
        ],
        {
            A: '#forge:treated_wood_slab',
            B: 'magichem:alchemically_treated_glass_pane',
            C: 'starbunclemania:fluid_jar'
        }
    )
    event.shapeless(
        Item.of('mna:guide_book'),
        [
            'minecraft:book',
            'mna:vinteum_dust'
        ]
    )
    event.remove({ output: 'mna:improvised_manaweaver_wand' })
    event.shaped(
        Item.of('mna:improvised_manaweaver_wand', '{Damage:0}'),
        [
            'A',
            'B',
            'C'
        ],
        {
            A: '#mna:improvised_manaweave_wand_caps',
            B: 'botania:manasteel_ingot',
            C: 'botania:livingwood_twig'
        }
    )
    event.remove({ output: 'magichem:alembic' })
    event.shaped(
        Item.of('magichem:alembic'),
        [
            'AA ',
            'BAC',
            'DED'
        ],
        {
            A: 'minecraft:copper_block',
            B: 'minecraft:cauldron',
            C: 'minecraft:glass_bottle',
            D: 'minecraft:copper_ingot',
            E: 'thermal:fluid_cell_frame'
        }
    )
    event.remove({ id: 'mna:runeforge_alt' })
    event.remove({ id: 'mna:runeforge' })
    event.shaped(
        Item.of('mna:runeforge'),
        [
            'A A',
            'BEB',
            'DCD'
        ],
        {
            A: 'occultism:iesnium_ingot',
            B: 'mna:transmuted_silver',
            C: 'mna:decoration/arcane_sandstone',
            D: 'mna:decoration/arcane_stone',
            E: 'minecraft:furnace'
        }
    )
    event.remove({ id: 'mna:stone_runes/rune_blank' })
    event.shaped(
        Item.of('mna:stone_rune_blank',2),
        [
            ' A ',
            'ABA',
            ' A '
        ],
        {
            A: 'bloodmagic:blankslate',
            B: [
                'botania:rune_spring',
                'botania:rune_summer',
                'botania:rune_autumn',
                'botania:rune_winter'
            ]
        }
    )
});