//
// 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`);


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

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

  // 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",
  ]);

  // 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",
    "taxov:pirate_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",
    "taxov:pirate_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",
  ]);
});

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$/,
  ]);
});
