/* ░░░▒▒▓▓██▣ RES INTERFACE ▣██▓▓▒▒░░░ ══ [ 2026-04-10 ] ══ [carePackageTooltips.js] ═════════
    ┳┳┓┏┓┓┏┓┏┳┏┓┓ ┏ ╭╭────────●▬▬▬▬๑۩۩๑▬▬▬▬▬●────────●▬▬▬▬๑۩۩๑▬▬▬▬▬●────────●▬▬▬▬๑۩۩๑▬▬▬▬▬●────────╮╮
    ┃┃┃┣┫┗┫┃┃┃┣ ┃┃┃ || server_scripts | recipes | Describe purpose 
    ┛ ┗┛┗┗┛┗┛┻┗┛┗┻┛ ╰╰────────●▬▬▬▬๑۩۩๑▬▬▬▬▬●────────●▬▬▬▬๑۩۩๑▬▬▬▬▬●────────●▬▬▬▬๑۩۩๑▬▬▬▬▬●────────╯╯
*/ console.info("[RES:CORE] Initializing carePackageTooltips.js");

ItemEvents.modifyTooltips((e) => {
  const COMMON_USAGE_LINES = [Text.gray("Place, then Sneak + Right Click")];
  const CARE_PACKAGE_TOOLTIPS = {
    "kubejs:seed_care_package": [Text.aqua("Contains a random selection of seeds!")],
    "kubejs:wood_care_package": [Text.aqua("Contains a random selection of logs!")],
    "kubejs:stone_care_package": [Text.aqua("Contains a random selection of stone!")],
    "kubejs:food_care_package": [Text.aqua("Contains a random selection of food!")],
    "kubejs:farming_care_package": [Text.aqua("Contains a collection of farming essentials!")],
    "kubejs:sapling_care_package": [Text.aqua("Contains a random selection of saplings!")],
    "kubejs:starter_care_package": [Text.aqua("Contains a collection of items to get you started!")],
    "kubejs:tier_one_create_care_package": [Text.aqua("Contains a collection of Create essentials!")],
    "kubejs:tier_two_create_care_package": [Text.aqua("Contains a collection of Create essentials!")],
    "kubejs:plushie_care_package": [Text.aqua("Contains a collection of plushies!")],
    "kubejs:assorted_dyed_blocks_care_package": [Text.aqua("Contains an assortment of dyed items!")],

    "kubejs:pokemon_gamba_package": [Text.aqua("Contains a random Pokémon!")],
    "kubejs:pokemon_wellness_package": [Text.aqua("Contains potions and medicines!")],
    "kubejs:shiny_pokemon_gamba_package": [Text.aqua("Contains a random shiny Pokémon!")],
    "kubejs:myths_and_legends_package": [Text.aqua("Contains a random Mythical or Legendary Item!")],
  };

  const TITLE_OVERRIDES = {
    "kubejs:pokemon_gamba_package": Text.lightPurple("Pokémon Gamba Package"),
    "kubejs:shiny_pokemon_gamba_package": Text.gold("✨ Shiny Pokémon Gamba Package"),
    "kubejs:myths_and_legends_package": Text.gold("🌙 Myths and Legends Package"),
  };

  Object.keys(CARE_PACKAGE_TOOLTIPS).forEach(itemId => {
    e.modify(itemId, tooltip => {
      const title = TITLE_OVERRIDES[itemId];

      if (title) {
        tooltip.clear();
        tooltip.add(Array.isArray(title) ? title : [title]);
      }

      tooltip.add(CARE_PACKAGE_TOOLTIPS[itemId]);
      tooltip.add(COMMON_USAGE_LINES);
    });
  });
});
