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'
            ]
        }
    )
    event.remove({ id: 'mna:vinteum_manaweaver_wand' })
    event.shaped(
        Item.of('mna:manaweaver_wand'),
        [
            ' AB',
            ' CA',
            'C  '
        ],
        {
            A: 'mna:transmuted_silver',
            B: 'mna:vinteum_dust',
            C: 'minecraft:stick'
        }
    )
    event.remove({ output: 'magichem:collated_theories' })
    event.shapeless(
        Item.of('magichem:collated_theories'),
        [
            '3x magichem:scorched_theorem',
            [
                'farmersdelight:canvas',
                '#forge:leather',
                'create:cardboard'
            ]
        ]
    )
    event.shaped(
        Item.of('magichem:wisdom_stone_nigredo'),
        [
            'ABA',
            'CDE',
            'AFA'
        ],
        {
            A: 'magichem:collated_theories',
            B: 'naturesaura:infused_iron',
            C: 'magichem:salt_of_soot',
            D: 'naturesaura:birth_spirit',
            E: 'magichem:salt_of_bone',
            F: 'magichem:inert_wisdom_stone'
        }
    )
    event.shaped(
        Item.of('magichem:wisdom_stone_albedo'),
        [
            'ABA',
            'CDE',
            'AFA'
        ],
        {
            A: 'magichem:collated_theories',
            B: 'magichem:slumbering_idol',
            C: 'magichem:radiant_rose',
            D: 'kubejs:ether_ingot',
            E: 'magichem:chiaroscuro',
            F: 'magichem:wisdom_stone_nigredo'
        }
    )
    event.shaped(
        Item.of('magichem:wisdom_stone_citrinitas'),
        [
            'ABA',
            'CDE',
            'AFA'
        ],
        {
            A: 'magichem:profound_manuscript',
            B: 'magichem:obscure_prognostications',
            C: 'magichem:immaculate_vinteum_crystal',
            D: 'botania:terrasteel_ingot',
            E: 'magichem:gnostic_orb',
            F: 'magichem:wisdom_stone_albedo'
        }
    )
    event.shaped(
        Item.of('magichem:wisdom_stone_rubedo'),
        [
            'ABA',
            'CDE',
            'AFA'
        ],
        {
            A: 'magichem:profound_manuscript',
            B: 'magichem:auroral_silk',
            C: 'magichem:fork_of_the_gulaporrigo',
            D: 'botanicalextramachinery:malachite_ingot',
            E: 'magichem:chalice_of_tears',
            F: 'magichem:wisdom_stone_citrinitas'
        }
    )
    event.shaped(
        Item.of('magichem:philosophers_stone'),
        [
            'ABA',
            'CDE',
            'AFA'
        ],
        {
            A: 'magichem:daunting_esoterica',
            B: 'magichem:celestial_mechanism',
            C: 'magichem:immortal_heart',
            D: 'magichem:crown_of_glory',
            E: 'magichem:ambrosia',
            F: 'magichem:wisdom_stone_rubedo'
        }
    )
    event.shaped(
        Item.of('magichem:fork_of_the_gulaporrigo'),
        [
            ' BA',
            'CDE',
            'FG '
        ],
        {
            A: 'magichem:lunar_orb',
            B: 'minecraft:cake',
            C: 'minecraft:golden_carrot',
            D: Item.of('minecraft:trident', '{Damage:0}'),
            E: 'minecraft:enchanted_golden_apple',
            F: 'magichem:solar_orb',
            G: 'minecraft:pumpkin_pie'
        }
    )
    event.shaped(
        Item.of('magichem:chalice_of_tears'),
        [
            'ABA',
            'CDE',
            'FGF'
        ],
        {
            A: 'magichem:vinteum_crystal_shard',
            B: 'minecraft:powder_snow_bucket',
            C: 'magichem:stardust',
            D: 'botania:apothecary_default',
            E: 'magichem:sunburn',
            F: 'forbidden_arcanus:deorum_ingot',
            G: 'magichem:profound_manuscript'
        }
    )
})