//
// This should be used only for item, block, recipe, fluid and loot tags
// Biome tags should prefer datapacks, or tags_add_remove_worldgen_biome script

ServerEvents.tags("item", (event) => {
  // Ember Metals
  global.emberMetal.forEach((metalInput) => {
    event.add(`forge:plates`, `embers:${metalInput}_plate`);
    event.add(`forge:plates/${metalInput}`, `embers:${metalInput}_plate`);
    event.add(`forge:plates`, `create:${metalInput}_sheet`);
    event.add(`forge:plates/${metalInput}`, `create:${metalInput}_sheet`);
    event.add(`forge:plates`, `thermal:${metalInput}_plate`);
    event.add(`forge:plates/${metalInput}`, `thermal:${metalInput}_plate`);
  });

  // Undergarden
  event.add(`forge:nuggets/forgotten`, `undergarden:forgotten_nugget`);
  event.add(`forge:ingots/forgotten`, `undergarden:forgotten_ingot`);

  // Scorched Guns Hazmat
  event.add(`scguns:gas_mask`, `thermal:hazmat_helmet`);

  // Cloggrum and Industrial Iron Nugget for bullet tips
  event.add(`scguns:advanced_bullet_tips`, `undergarden:cloggrum_nugget`);
  event.add(`scguns:advanced_bullet_material`, `undergarden:cloggrum_ingot`);
  event.add(`scguns:advanced_bullet_tips`, `create_dd:industrial_iron_nugget`);
  event.add(`scguns:advanced_bullet_material`, `create_dd:industrial_iron_ingot`);



  // =========================================
  // Tagging Mainly for Loot Tables, Bountiful Boards, etc
  // =========================================

  // Plushies
  event.add(
    "moa_decor_toys:plushies",
    /^moa_decor_toys:(?!.*gemadejuguetes).*/
  );

  // Thermal Press Dies
  event.add("thermal:crafting/dies", /^scguns:.*mold$/);

  // Minecards
  event.add("minecards:card_boxes", /^minecards:.*box$/);

  // Skinned Lanterns
  event.add("skinnedlanterns:lanterns", /^skinnedlanterns:.*/);

  // Sword in the Stone
  event.add("swordinthestone:swords", /^swordinthestone:.*/);

  // Dice
  event.add("dice:dice", /^dice:.*/);

  // Immersive Armors
  event.add("immersive_armors:armor", /^immersive_armors:.*/);

  // Colored Water Buckets
  event.add(
    "colored_water:waterbuckets",
    /^colored_water:(?!.*condense)(?!.*luminous).*water_bucket$/
  );

  // Twigs are Sticks
  event.add("forge:rods/wooden", "twigs:twig");

  // Custom Drills
  event.add("createoreexcavation:drills", [
    "createoreexcavation:steel_drill",
    "createoreexcavation:forgotten_drill",
  ]);

  event.add("createoreexcavation:drills", [
    "createoreexcavation:desh_drill",
    "createoreexcavation:ostrum_drill",
    "createoreexcavation:calorite_drill",
  ]);

  // Naturalist Froglass
  event.add("naturalist:froglass", [
    "naturalist:azure_froglass",
    "naturalist:verdant_froglass",
    "naturalist:crimson_froglass"
  ]);

    // Kukulkan Idol Divinity Sacrifices
  event.add("call_of_yucutan:kukulkan_ressources", [
    "scguns:ancient_brass_block",
    "pigsteel:pigsteel_chunk_block",
    "minecards:deckite_block",
    "etcetera:raw_bismuth_block"
  ]);
  
    // Ah Puch Idol Divinity Sacrifices
  event.add("call_of_yucutan:ah_puch_ressources", [
    "architects_palette:salmon_scales",
    "architects_palette:cod_scales",
    "alexscaves:block_of_pearl",
    "ecologics:seashell_block",
    "crabbersdelight:pearl_block",
    "architects_palette:entrails"
  ]);

  // Quality Crops Dough FD compatibility
  event.add("forge:dough", "qualitycrops:dough");
  event.add("forge:dough/wheat", "qualitycrops:dough");

  // Tentacles are Tentacles
  event.add("forge:tentacles", "oceansdelight:tentacles");

  // Right Click Harvest Hoes
  event.add("minecraft:hoes", [
    "cavesanddepths:rosegoldhoe",
    "create_sa:brass_hoe",
    "create_sa:copper_hoe",
    "create_sa:zinc_hoe",
    "experienceobelisk:cognitive_hoe",
    "nethers_exoticism:kiwano_hoe",
    "seadwellers:depth_hoe",
  ]);

  event.add("rightclickharvest:high_tier_hoes", [
    "deeperdarker:warden_hoe",
    "rats:ratlantis_hoe",
    "seadwellers:depth_hoe",
    "undergarden:forgotten_hoe",
  ]);

  event.add("rightclickharvest:low_tier_hoes", [
    "create_sa:copper_hoe",
    "create_sa:zinc_hoe",
    "embers:lead_hoe",
    "embers:silver_hoe",
    "nethers_exoticism:kiwano_hoe",
    "undergarden:cloggrum_hoe",
    "undergarden:froststeel_hoe",
  ]);

  event.add("rightclickharvest:mid_tier_hoes", [
    "cavesanddepths:rosegoldhoe",
    "experienceobelisk:cognitive_hoe",
    "create_sa:brass_hoe",
    "embers:dawnstone_hoe",
    "undergarden:utherium_hoe",
  ]);

  // Add Proper Tags To Modded Axes
  event.add("minecraft:axes", [
    "cavesanddepths:rosegoldaxe",
    "create_sa:blazing_axe",
    "create_sa:brass_axe",
    "create_sa:copper_axe",
    "create_sa:rose_quartz_axe",
    "create_sa:zinc_axe",
    "create_sa:experience_axe",
    "deeperdarker:warden_axe",
    "experienceobelisk:cognitive_axe",
    "kubejs:stone_hatchet",
    "nethers_exoticism:kiwano_axe",
    "seadwellers:depth_axe",
    "thermal:flux_saw",
  ]);

  // Add Proper Tags To Modded Pickaxes
  event.add("minecraft:pickaxes", [
    "cavesanddepths:rosegoldpickaxe",
    "create_sa:blazing_pickaxe",
    "create_sa:brass_pickaxe",
    "create_sa:copper_pickaxe",
    "create_sa:experience_pickaxe",
    "create_sa:rose_quartz_pickaxe",
    "create_sa:zinc_pickaxe",
    "deeperdarker:warden_pickaxe",
    "experienceobelisk:cognitive_pickaxe",
    "nethers_exoticism:kiwano_pickaxe",
    "seadwellers:depth_pickaxe",
    "thermal:flux_drill",
  ]);

  event.add("create_new_age:magnet", [
    "create_new_age:neodymized_magnet",
    "create_new_age:overcharged_magnet",
    "create_new_age:sculked_magnet",
    "create_new_age:lunar_magnet",
    "create_new_age:martian_magnet",
  ]);
  
  event.add("create:item_vault_crafting_component", [
	"create_vibrant_vaults:vertical_item_vault",
	"create_connected:item_silo",
	"create_sa:vault_component",
  ]);
});

ServerEvents.tags("fluid", (event) => {
  global.emberMetal.forEach((metalInput) => {
    event.add(`forge:molten_${metalInput}`, `embers:molten_${metalInput}`);
  });
  
  event.add("bumblezone:sugarwater", "the_bumblezone:sugar_water_still");

  event.add('embers:ingot_tooltip', ['embers:molten_froststeel', 'embers:molten_cloggrum'])


});



ServerEvents.tags("block", (event) => {

  // Anthill Rotten Plank Tags
  event.add("minecraft:overworld_natural_logs", [
    "ecologics:coconut_log",
    "ecologics:azalea_log",
    "ecologics:walnut_log",
    "thermal:rubberwood_log",
  ]);


  event.add(
    "create_new_age:magnets/strength_14",
    "architects_palette:chiseled_emerald_ore_bricks"
  );
  event.add(
    "create_new_age:magnets/strength_31",
    "architects_palette:chiseled_diamond_ore_bricks"
  );
  //event.add("create_new_age:magnets/strength_79", "twigs:polished_amethyst"); 
});

ServerEvents.tags("entity_type", (event) => {
  // DMMTTBA Boat Steerable
  event.add("forge:boats", [
    /^alexscaves:.*boat$/,
    /^deeperdarker:.*boat$/,
    /^rats:.*boat$/,
    /^regions_unexplored:.*boat$/,
    /^snifferplus:.*boat$/,
    /^undergarden:.*boat$/,
  ]);

  // Supplementaries Jar Catching
  event.add("supplementaries:jar_catchable", [
    "naturalist:dragonfly",
    "spawn:ant",
    "spawn:snail",
    "alexscaves:gloomoth"
  ]);

  // Supplementaries Cage Catching
  event.add("supplementaries:cage_catchable", [
    "naturalist:dragonfly",
    "spawn:ant",
    "spawn:snail",
    "spawn:hamster",
    "alexscaves:raycat",
    "ecologics:squirrel",
    "alexscaves:gingerbread_man",
    "crabbersdelight:crab",
    "call_of_yucutan:mitnal_monkey",
    "etcetera:chapple",
    "ribbits:ribbit",
    "beggars:villager_beggar",
    "beggars:zombie_beggar",
    "beggars:witch_beggar"
  ]);


});
