console.info("[SOCIETY] handleSeasonTags.js loaded");

// Remove tags
const stripTags = [
  "minecraft:apple",
  "pamhc2trees:lycheeitem",
  "pamhc2trees:bananaitem",
  "pamhc2trees:peachitem",
  "pamhc2trees:mangoitem",
  "atmospheric:orange",
  "pamhc2trees:plumitem",
  "pamhc2trees:pamdragonfruit",
  "pamhc2trees:starfruititem",
  "pamhc2trees:pampeach",
  "pamhc2trees:dragonfruititem",
  "pamhc2trees:plum_sapling",
  "pamhc2trees:pamapple",
  "pamhc2trees:pamlychee",
  "pamhc2trees:pamplum",
  "pamhc2trees:apple_sapling",
  "pamhc2trees:lychee_sapling",
  "pamhc2trees:cherry_sapling",
  "pamhc2trees:pamcherry",
  "pamhc2trees:pamorange",
  "pamhc2trees:pammango",
  "pamhc2trees:pambanana",
  "pamhc2trees:banana_sapling",
  "pamhc2trees:peach_sapling",
  "pamhc2trees:mango_sapling",
  "pamhc2trees:orange_sapling",
  "pamhc2trees:dragonfruit_sapling",
  "pamhc2trees:pamstarfruit",
  "pamhc2trees:starfruit_sapling",
  "pamhc2trees:cherryitem",
  "pamhc2trees:cinnamon_sapling",
  "pamhc2trees:cinnamonitem",
  "pamhc2trees:pamcinnamon",
  "vintagedelight:peanut",
  "vintagedelight:peanut_crop",
  "vintagedelight:gearo_berry",
  "vintagedelight:gearo_berry_bush",
  "brewery:hops_seeds",
  "farm_and_charm:strawberry_seed",
  "pamhc2trees:orangeitem",
  "pamhc2trees:pampassionfruit",
  "pamhc2trees:passionfruit_sapling",
];
const stripSeasons = (e, item) => {
  e.remove("sereneseasons:spring_crops", "vintagedelight:cucumber_crop");
  e.remove("sereneseasons:spring_crops", "vintagedelight:cucumber_seeds");
  e.remove("sereneseasons:spring_crops", "vintagedelight:ghost_pepper_crop");
  e.remove("sereneseasons:spring_crops", "vintagedelight:ghost_pepper_seeds");
  e.remove("sereneseasons:spring_crops", item);
  e.remove("sereneseasons:summer_crops", item);
  e.remove("sereneseasons:autumn_crops", item);
  e.remove("sereneseasons:winter_crops", item);
};
ServerEvents.tags("item", (e) => {
  stripTags.forEach((item) => {
    stripSeasons(e, item);
  });
});

ServerEvents.tags("block", (e) => {
  stripTags.forEach((item) => {
    stripSeasons(e, item);
  });
});

const springCrops = [
  "farm_and_charm:onion",
  "farm_and_charm:strawberry",
  "farm_and_charm:strawberry_crop",
  "farm_and_charm:strawberry_seed",
  "farm_and_charm:lettuce",
  "farm_and_charm:lettuce_seeds",
  "herbalbrews:coffee_beans",
  "farm_and_charm:onion_crop",
  "farm_and_charm:lettuce_crop",
  "herbalbrews:coffee_plant",
  "farmersdelight:tomato",
  "farmersdelight:budding_tomatoes",
  "farmersdelight:tomatoes",
  "farmersdelight:tomato_seeds",
  "vintagedelight:gearo_berry",
  "vintagedelight:gearo_berry_bush",
  "vinery:cherry",
  "pamhc2trees:pamcherry",
  "pamhc2trees:lycheeitem",
  "pamhc2trees:cherry_sapling",
  "pamhc2trees:lychee_sapling",
  "pamhc2trees:pamlychee",
  "pamhc2trees:pampassionfruit",
  "atmospheric:passion_fruit",
  "pamhc2trees:passionfruit_sapling",
  "society:ancient_fruit",
  "society:ancient_fruit_seed",
  "society:tubabacco_leaf",
  "society:tubabacco_leaf_seed",
];
const summerCrops = [
  "farm_and_charm:oat_crop",
  "farm_and_charm:corn_crop",
  "farm_and_charm:oat",
  "farm_and_charm:kernels",
  "farm_and_charm:corn",
  "society:blueberry",
  "society:blueberry_seed",
  "farm_and_charm:oat_seeds",
  "herbalbrews:rooibos_leaf",
  "herbalbrews:rooibos_plant",
  "beachparty:palm_sapling",
  "pamhc2trees:bananaitem",
  "pamhc2trees:peachitem",
  "atmospheric:orange",
  "pamhc2trees:mangoitem",
  "pamhc2trees:banana_sapling",
  "pamhc2trees:peach_sapling",
  "pamhc2trees:mango_sapling",
  "pamhc2trees:orange_sapling",
  "pamhc2trees:pambanana",
  "pamhc2trees:pampeach",
  "pamhc2trees:pammango",
  "pamhc2trees:pamorange",
  "vintagedelight:cucumber",
  "vintagedelight:cucumber_crop",
  "vintagedelight:cucumber_seeds",
  "farmersdelight:rice_panicle",
  "farmersdelight:tomato",
  "farmersdelight:budding_tomatoes",
  "farmersdelight:tomatoes",
  "farmersdelight:tomato_seeds",
  "vintagedelight:ghost_pepper_seeds",
  "vintagedelight:ghost_pepper",
  "vintagedelight:ghost_pepper_crop",
  "society:ancient_fruit",
  "society:ancient_fruit_seed",
  "etcetera:cotton",
  "etcetera:cotton_flower",
  "etcetera:cotton_seeds",
  "brewery:hops",
  "brewery:hop_trellis_seed",
  "brewery:hop_trellis",
  "atmospheric:aloe_vera",
  "atmospheric:aloe_kernels",
  "atmospheric:aloe_leaves",
  "atmospheric:yucca_branch",
  "atmospheric:yucca_bundle",
  "atmospheric:yucca_fruit",
  "atmospheric:yucca_sapling",
];
const autumnCrops = [
  "farm_and_charm:barley_crop",
  "farm_and_charm:oat_crop",
  "farm_and_charm:corn_crop",
  "minecraft:beetroot",
  "farm_and_charm:oat",
  "farm_and_charm:kernels",
  "farm_and_charm:corn",
  "farm_and_charm:oat_seeds",
  "farm_and_charm:barley_seeds",
  "farm_and_charm:barley",
  "vintagedelight:peanut",
  "vintagedelight:peanut_crop",
  "farmersdelight:rice_panicle",
  "farmersdelight:cabbage",
  "farmersdelight:tomato",
  "farmersdelight:budding_tomatoes",
  "farmersdelight:tomatoes",
  "farmersdelight:tomato_seeds",
  "autumnity:foul_berries",
  "autumnity:tall_foul_berry_bush",
  "minecraft:apple",
  "pamhc2trees:pamapple",
  "pamhc2trees:plumitem",
  "pamhc2trees:pamplum",
  "pamhc2trees:apple_sapling",
  "pamhc2trees:plum_sapling",
  "society:ancient_fruit",
  "society:ancient_fruit_seed",
  "pamhc2trees:cinnamon_sapling",
  "pamhc2trees:cinnamonitem",
  "pamhc2trees:pamcinnamon",
];
const winterCrops = [
  "farm_and_charm:barley_crop",
  "farm_and_charm:barley_seeds",
  "farm_and_charm:barley",
  "snowyspirit:ginger",
  "snowyspirit:ginger_flower",
  "quark:ancient_sapling",
  "farmersdelight:cabbage",
  "pamhc2trees:dragonfruit_sapling",
  "pamhc2trees:pamdragonfruit",
  "pamhc2trees:dragonfruititem",
  "pamhc2trees:cinnamon_sapling",
  "pamhc2trees:cinnamonitem",
  "pamhc2trees:pamcinnamon",
  "society:tubabacco_leaf",
  "society:tubabacco_leaf_seed",
  "atmospheric:kousa_sapling",
];
const allSeasonCrops = [
  "atmospheric:grimwood_sapling",
  "atmospheric:laurel_sapling",
  "atmospheric:dry_laurel_sapling",
  "atmospheric:aspen_sapling",
  "atmospheric:green_aspen_sapling",
  "atmospheric:rosewood_sapling",
  "atmospheric:yucca_sapling",
  "atmospheric:morado_sapling",
  "autumnity:red_maple_sapling",
  "autumnity:yellow_maple_sapling",
  "autumnity:orange_maple_sapling",
  "autumnity:maple_sapling",
  "nethervinery:crimson_grape_seeds",
  "vinery:savanna_grape_seeds_white",
  "vinery:jungle_grape_seeds_red",
  "vinery:savanna_grape_seeds_red",
  "vinery:jungle_grapes_red",
  "nethervinery:warped_grape",
  "vinery:savanna_grapes_red",
  "vinery:savanna_grapes_white",
  "nethervinery:crimson_grape",
  "vinery:white_grape",
  "vinery:white_grape_seeds",
  "vinery:red_grape_seeds",
  "vinery:red_grape",
  "vinery:taiga_grape_seeds_red",
  "vinery:taiga_grapes_red",
  "vinery:taiga_grape_seeds_white",
  "vinery:taiga_grapes_white",
  "nethervinery:warped_grape_seeds",
  "vinery:jungle_grapes_white",
  "vinery:jungle_grape_seeds_white",
  "vinery:apple_tree_sapling",
  "vinery:dark_cherry_sapling",
  "quark:yellow_blossom_sapling",
  "quark:lavender_blossom_sapling",
  "herbalbrews:yerba_mate_leaf",
  "herbalbrews:green_tea_leaf",
  "herbalbrews:tea_plant",
  "herbalbrews:yerba_mate_plant",
  "herbalbrews:tea_blossom",
  "quark:blue_blossom_sapling",
  "quark:orange_blossom_sapling",
  "meadow:pine_sapling",
  "quark:red_blossom_sapling",
  "moreminecarts:glass_cactus",
  "pamhc2trees:starfruititem",
  "pamhc2trees:starfruit_sapling",
  "pamhc2trees:pamstarfruit",
  "vintagedelight:magic_peanut",
  "atmospheric:currant",
  "atmospheric:currant_stalk",
  "atmospheric:hanging_currant",
  "atmospheric:currant_seedling",
];

ServerEvents.tags("item", (e) => {
  springCrops.forEach((crop) => {
    e.add("sereneseasons:spring_crops", crop);
  });
  summerCrops.forEach((crop) => {
    e.add("sereneseasons:summer_crops", crop);
  });
  autumnCrops.forEach((crop) => {
    e.add("sereneseasons:autumn_crops", crop);
  });
  winterCrops.forEach((crop) => {
    e.add("sereneseasons:winter_crops", crop);
  });
  allSeasonCrops.forEach((crop) => {
    e.add("sereneseasons:spring_crops", crop);
    e.add("sereneseasons:autumn_crops", crop);
    e.add("sereneseasons:summer_crops", crop);
    e.add("sereneseasons:winter_crops", crop);
  });
});

ServerEvents.tags("block", (e) => {
  springCrops.forEach((crop) => {
    e.add("sereneseasons:spring_crops", crop);
  });
  summerCrops.forEach((crop) => {
    e.add("sereneseasons:summer_crops", crop);
  });
  autumnCrops.forEach((crop) => {
    e.add("sereneseasons:autumn_crops", crop);
  });
  winterCrops.forEach((crop) => {
    e.add("sereneseasons:winter_crops", crop);
  });
  allSeasonCrops.forEach((crop) => {
    e.add("sereneseasons:spring_crops", crop);
    e.add("sereneseasons:autumn_crops", crop);
    e.add("sereneseasons:summer_crops", crop);
    e.add("sereneseasons:winter_crops", crop);
  });
});
