// Priority: 100
/**
  
  █▀▄▀█ █▀█ █▄░█ █░█ █▀▄▀█ █▀▀ █▄░█ ▀█▀ ▄▀█ █░░   █▀▀ ▀▄▀ █▀█ █▀▀ █▀█ █ █▀▀ █▄░█ █▀▀ █▀▀
  █░▀░█ █▄█ █░▀█ █▄█ █░▀░█ ██▄ █░▀█ ░█░ █▀█ █▄▄   ██▄ █░█ █▀▀ ██▄ █▀▄ █ ██▄ █░▀█ █▄▄ ██▄

  ☻/  * @file Botany Pots Tiers recipes
  /▌  * @copyright KnightDexx's Modded Minecraft World | ModernGamingWorld | GeekTechMedia

*/

ServerEvents.recipes(event => {

  if (!Platform.isLoaded('botanypotstiers')) return

  botanypotmaterial.forEach((material) => {

    // ======= ELITE Botany Pot =======
    event.shaped(
      Item.of(`botanypotstiers:elite_${material}_botany_pot`),
      ['ABA', 'ACA', ' A '],
      {
        A: '#c:storage_blocks/compressed_iron',
        B: '#c:ender_pearls',
        C: `botanypots:${material}_botany_pot`
      }
    ).id(`kubejs:elite/${material}_botany_pot`)

    // ======= ELITE Hopper Botany Pot =======
    event.shaped(
      Item.of(`botanypotstiers:elite_${material}_hopper_botany_pot`),
      ['ABA', 'ACA', 'DED'],
      {
        A: `minecraft:${material}`,
        B: '#c:ender_pearls',
        C: `botanypotstiers:elite_${material}_botany_pot`,
        D: '#c:storage_blocks/compressed_iron',
        E: '#monumental_experience:hoppers'
      }
    ).id(`kubejs:elite/${material}_hopper_botany_pot`)

    // ======= ULTRA Botany Pot =======
    event.shaped(
      Item.of(`botanypotstiers:ultra_${material}_botany_pot`),
      ['ABA', 'ACA', ' A '],
      {
        A: '#c:storage_blocks/diamond',
        B: '#c:nether_stars',
        C: `botanypotstiers:elite_${material}_botany_pot`
      }
    ).id(`kubejs:ultra/${material}_botany_pot`)

    // ======= ULTRA Hopper Botany Pot =======
    event.shaped(
      Item.of(`botanypotstiers:ultra_${material}_hopper_botany_pot`),
      ['ABA', 'ACA', 'DED'],
      {
        A: `minecraft:${material}`,
        B: '#c:nether_stars',
        C: `botanypotstiers:ultra_${material}_botany_pot`,
        D: '#c:storage_blocks/diamond',
        E: '#monumental_experience:hoppers'
      }
    ).id(`kubejs:ultra/${material}_hopper_botany_pot`)

    // Creative tier removed — botanypotstiers 1.21.1 does not include creative pots

    // ======= Remove ALL default botanypotstiers recipes for this material =======
    // The mod changed its recipe folder from crafting/ to pots/ and renamed
    // suffixes (e.g. _2 → _same_material) in 1.21.1, so we use a regex
    // to catch everything regardless of the exact naming scheme.
    event.remove({ id: new RegExp(`^botanypotstiers:.*${material}.*`) })

  })

})
