// priority: 1000
// Visit the wiki for more info - https://kubejs.com/
console.info('Hello, World! (Loaded TAGS.js)')


// ******************* //
// **** ITEM TAGS **** //
// ******************* //

ServerEvents.tags('item', event => {

  // Add minecraft:planks tag to forge:planks/wood tag, idk why?
  event.add('forge:planks/wood', '#minecraft:planks')

  // Add tools to minecraft:pickaxes tag
  event.add('minecraft:pickaxes', 'ex_hammers:stone_hammer')
  event.add('minecraft:pickaxes', 'ex_hammers:iron_hammer')
  event.add('minecraft:pickaxes', 'ex_hammers:diamond_hammer')
  event.add('minecraft:pickaxes', 'ex_hammers:netherite_hammer')

  // Add missing tags to coke
  event.add('forge:storage_blocks/coal_coke', '#forge:storage_blocks/coke')
  event.add('forge:coal_coke', '#forge:gems/coke')

  // Create tag for vinery:cherry_logs
  event.add('vinery:cherry_logs', 'vinery:dark_cherry_log')
  event.add('vinery:cherry_logs', 'vinery:stripped_dark_cherry_log')
  event.add('vinery:cherry_logs', 'vinery:dark_cherry_wood')
  event.add('vinery:cherry_logs', 'vinery:stripped_dark_cherry_wood')

  // Create tag for vinery:apple_logs
  event.add('vinery:apple_logs', 'vinery:apple_log')
  event.add('vinery:apple_logs', 'vinery:apple_wood')

  // Remove ender io dyes from tags
  event.remove('forge:dyes/brown', 'enderio:organic_brown_dye')
  event.remove('forge:dyes/green', 'enderio:organic_green_dye')
  event.remove('forge:dyes/black', 'enderio:organic_black_dye')

  event.remove('forge:dyes', 'enderio:organic_brown_dye')
  event.remove('forge:dyes', 'enderio:organic_green_dye')
  event.remove('forge:dyes', 'enderio:organic_black_dye')

  // Remove unused/hidden materials from tags
  event.remove('forge:dusts/coal', 'enderio:powdered_coal')
  event.remove('forge:dusts/iron', 'enderio:powdered_iron')
  event.remove('forge:dusts/gold', 'enderio:powdered_gold')
  event.remove('forge:dusts/copper', 'enderio:powdered_copper')
  event.remove('forge:dusts/tin', 'enderio:powdered_tin')
  event.remove('forge:dusts/cobalt', 'enderio:powdered_cobalt')
  event.remove('forge:dusts/ender_pearl', 'enderio:powdered_ender_pearl')
  event.remove('forge:dusts/quartz', 'enderio:powdered_quartz')
  event.remove('forge:dusts/lapis', 'enderio:powdered_lapis_lazuli')
  event.remove('forge:dusts/obsidian', 'enderio:powdered_obsidian')
  event.remove('forge:dusts/steel', 'enderio:powdered_steel')
  event.remove('forge:dusts/ender_pearl', 'ae2:ender_dust')
  event.remove('forge:ingots/steel', 'davebuildingmod:steel_ingot')
  event.remove('forge:silicon', 'enderio:silicon')
  event.remove('forge:ores', 'exocraft:lava_crystal_ore')

  // Create tag for forge:dusts/stone_types
  event.add('forge:dusts/stone_types', [
    '#forge:dusts/stone',
    '#forge:dusts/netherrack',
    '#forge:dusts/basalt',
    '#forge:dusts/deepslate',
    '#forge:dusts/granite',
    '#forge:dusts/andesite',
    '#forge:dusts/diorite',
    '#forge:dusts/endstone',
  ])

  // Create tag for farmersdelight:bone_broth_ingredients
  event.add('farmersdelight:bone_broth_ingredients', [
    '#forge:mushrooms',
    'minecraft:hanging_roots',
    'minecraft:glow_lichen',
    'minecraft:glow_berries',
  ])

  // Create tag for farmersdelight:mushroom_rice_ingredients
  event.add('farmersdelight:mushroom_rice_ingredients', [
    'minecraft:carrot',
    'minecraft:potato',
  ])

  // Create tag for farmersdelight:dumplings_ingredients
  event.add('farmersdelight:dumplings_ingredients', [
    'minecraft:brown_mushroom',
    '#forge:raw_chicken',
    '#forge:raw_beef',
    '#forge:raw_pork',
  ])

  // Create tag for forge:storage_blocks
  event.add('forge:storage_blocks', [
    'kubejs:darker_concrete',
  ])

  // Create tag for forge:storage_blocks/concrete
  event.add('forge:storage_blocks/concrete', [
    'kubejs:darker_concrete',
  ])

  // Create tag for waystones:waystones
  event.add('waystones:waystones', [
    'waystones:deepslate_waystone',
    'waystones:blackstone_waystone',
    'waystones:end_stone_waystone',
  ])

  // Create tag for forge:ender_pearl_ingredients
  event.add('forge:ender_pearl_ingredients', [
    'gtceu:ender_pearl_dust',
    'minecraft:ender_pearl',
  ])

  // Add chests to forge:chests/wooden
  event.add('forge:chests/wooden', [
    'framedblocks:framed_chest',
  ])

  // Remove Ender Chests from forge:chests
  event.remove('forge:chests', [
    'minecraft:ender_chest',
    'enderchests:ender_chest',
    '#forge:chests/ender',
  ])

  // Remove ores from ores tag
  event.remove('forge:ores', [
    'exocraft:lava_crystal_ore',
    'rftoolsbase:dimensionalshard_overworld',
    'rftoolsbase:dimensionalshard_nether',
    'rftoolsbase:dimensionalshard_end',
  ])

  // Add minecraft:pickaxes to forge:tools/pickaxes tag
  event.add('forge:tools/pickaxes', [
    '#minecraft:pickaxes',
  ])

  // Add minecraft:axes to forge:tools/axes tag
  event.add('forge:tools/axes', [
    '#minecraft:axes',
  ])

  // Add minecraft:shovels to forge:tools/shovels tag
  event.add('forge:tools/shovels', [
    '#minecraft:shovels',
  ])

  // Add forge:tools/wrench to forge:wrenches tag
  event.add('forge:wrenches', [
    '#forge:tools/wrench',
  ])

  // Add coal types to forge:fuels/coals tag
  event.add('forge:fuels/coals', [
    'minecraft:coal',
    'minecraft:charcoal',
    '#forge:dusts/coal',
    '#forge:dusts/charcoal',
  ])

  // Add coke types to forge:fuels/cokes tag
  event.add('forge:fuels/cokes', [
    '#forge:gems/coke',
    '#forge:dusts/coke',
  ])


  // fin //

})


// ******************** //
// **** BLOCK TAGS **** //
// ******************** //

ServerEvents.tags('block', event => {

  // Blocks added to minecraft:mineable/pickaxe tag
  event.add('minecraft:mineable/pickaxe', [
    'travelanchors:travel_anchor',
    'minecraft:reinforced_deepslate',
    'kubejs:quartz_alloy_machine_casing',
    'kubejs:quartz_alloy_machine_hull',
    'kubejs:chiseled_darker_concrete',
    'kubejs:cracked_darker_concrete_bricks',
    'kubejs:darker_concrete_bricks',
    'kubejs:darker_concrete_cobblestone',
    'kubejs:darker_concrete_small_tile',
    'kubejs:darker_concrete_tile',
    'kubejs:darker_concrete_windmill_a',
    'kubejs:darker_concrete_windmill_b',
    'kubejs:darker_concrete',
    'kubejs:mossy_darker_concrete_bricks',
    'kubejs:mossy_darker_concrete_cobblestone',
    'kubejs:polished_darker_concrete',
    'kubejs:small_darker_concrete_bricks',
    'kubejs:square_darker_concrete_bricks',
    'kubejs:dark_steel_casing',
    'kubejs:medium_temperature_smelting_casing',
    'kubejs:electrolytic_casing',
    'kubejs:primitive_smelting_bricks',
  ])

  // Blocks added to forge:mineable/wrench tag
  event.add('forge:mineable/wrench', [
    'kubejs:quartz_alloy_machine_casing',
    'kubejs:quartz_alloy_machine_hull',
    'kubejs:dark_steel_casing',
    'kubejs:medium_temperature_smelting_casing',
    'kubejs:electrolytic_casing',
    'kubejs:primitive_smelting_bricks',
  ])

  // Blocks added to forge:very_fast_walkable_blocks tag
  event.add('forge:very_fast_walkable_blocks', [
    'kubejs:chiseled_darker_concrete',
    'kubejs:cracked_darker_concrete_bricks',
    'kubejs:darker_concrete_bricks',
    'kubejs:darker_concrete_cobblestone',
    'kubejs:darker_concrete_small_tile',
    'kubejs:darker_concrete_tile',
    'kubejs:darker_concrete_windmill_a',
    'kubejs:darker_concrete_windmill_b',
    'kubejs:darker_concrete',
    'kubejs:mossy_darker_concrete_bricks',
    'kubejs:mossy_darker_concrete_cobblestone',
    'kubejs:polished_darker_concrete',
    'kubejs:small_darker_concrete_bricks',
    'kubejs:square_darker_concrete_bricks',
  ])

  // Blocks added to forge:needs_wood_tool tag
  event.add('forge:needs_wood_tool', [
    'kubejs:chiseled_darker_concrete',
    'kubejs:cracked_darker_concrete_bricks',
    'kubejs:darker_concrete_bricks',
    'kubejs:darker_concrete_cobblestone',
    'kubejs:darker_concrete_small_tile',
    'kubejs:darker_concrete_tile',
    'kubejs:darker_concrete_windmill_a',
    'kubejs:darker_concrete_windmill_b',
    'kubejs:darker_concrete',
    'kubejs:mossy_darker_concrete_bricks',
    'kubejs:mossy_darker_concrete_cobblestone',
    'kubejs:polished_darker_concrete',
    'kubejs:small_darker_concrete_bricks',
    'kubejs:square_darker_concrete_bricks',
  ])

  // Blocks added to forge:storage_blocks/concrete tag
  event.add('forge:storage_blocks/concrete', [
    'kubejs:darker_concrete',
  ])

  // Blocks added to forge:storage_blocks tag
  event.add('forge:storage_blocks', [
    'kubejs:darker_concrete',
  ])

  // Water and Lava generator booster blocks
  event.add('sfg:tier_1_generator', 'gtceu:cupronickel_coil_block')
  event.add('sfg:tier_2_generator', 'gtceu:kanthal_coil_block')
  event.add('sfg:tier_3_generator', 'gtceu:nichrome_coil_block')
  event.add('sfg:tier_4_generator', 'gtceu:rtm_alloy_coil_block')
  event.add('sfg:tier_5_generator', 'gtceu:hssg_coil_block')
  event.remove('sfg:tier_1_generator', 'minecraft:iron_block')
  event.remove('sfg:tier_2_generator', 'minecraft:gold_block')
  event.remove('sfg:tier_3_generator', 'minecraft:diamond_block')
  event.remove('sfg:tier_4_generator', 'minecraft:emerald_block')
  event.remove('sfg:tier_5_generator', 'minecraft:netherite_block')

  // Remove ores from ores tag
  event.remove('forge:ores', [
    'exocraft:lava_crystal_ore',
    'rftoolsbase:dimensionalshard_overworld',
    'rftoolsbase:dimensionalshard_nether',
    'rftoolsbase:dimensionalshard_end',
  ])

  // Add ores to banned_blocks tag
  event.add('srg:banned_blocks', [
    'exocraft:lava_crystal_ore',
    'rftoolsbase:dimensionalshard_overworld',
    'rftoolsbase:dimensionalshard_nether',
    'rftoolsbase:dimensionalshard_end',
  ])

  // Blocks added to infinite_blocks:infinite_blocks tag
  event.add('infinite_blocks:infinite_blocks', [
    'xtonesreworked:xtone_tile',
    '#forge:cobblestone',
    '#forge:concretes',
    '#minecraft:terracotta',
    'laboratoryblocks:laboratory_block',
    'factory_blocks:factory',
    'factory_blocks:sturdy',
    'minecraft:grass_block',
    'minecraft:podzol',
    'minecraft:mycelium',
    'minecraft:dirt',
    'minecraft:coarse_dirt',
    'minecraft:rooted_dirt',
    'minecraft:mud',
    'minecraft:moss_block',
    'minecraft:muddy_mangrove_roots',
  ])

  // Blocks removed from infinite_blocks:infinite_blocks tag
  event.remove('infinite_blocks:infinite_blocks', [
    '#minecraft:dirt',
  ])

  // Blocks removed from unbreakable_netherite:interactionblock tag
  event.remove('unbreakable_netherite:interactionblock', [
    'minecraft:netherite_block',
  ])

  // Blocks added to unbreakable_netherite:interactionblock tag
  event.add('unbreakable_netherite:interactionblock', [
    'gtceu:iridium_block',
  ])

  // Blocks removed from forge:stone tag
  event.remove('forge:stone', [
    'gtceu:light_concrete',
    'gtceu:dark_concrete',
  ])

  // Blocks removed from forge:cobblestone tag
  event.remove('forge:cobblestone', [
    'gtceu:light_concrete_cobblestone',
    'gtceu:dark_concrete_cobblestone',
  ])

  // Blocks added from gtceu:cleanroom_doors tag
  event.add('gtceu:cleanroom_doors', [
    'laboratoryblocks:laboratory_door',
    'laboratoryblocks:glass_laboratory_door',
    'dustrial_decor:padded_door',
    'dustrial_decor:chain_door',
    'dustrial_decor:industrial_iron_door',
    'dustrial_decor:sheet_metal_door',
    'dustrial_decor:rusty_sheet_metal_door',
    'dustrial_decor:rusty_iron_door',
    'glassential:glass_door',
    'glassential:dark_ethereal_door',
    'glassential:dark_ethereal_reverse_door',
    'glassential:ethereal_door',
    'glassential:ethereal_reverse_door',
    'glassential:light_door',
    'glassential:redstone_door',
    'glassential:ghostly_door',
    'glassential:black_glass_door',
    'glassential:blue_glass_door',
    'glassential:brown_glass_door',
    'glassential:cyan_glass_door',
    'glassential:gray_glass_door',
    'glassential:green_glass_door',
    'glassential:light_blue_glass_door',
    'glassential:light_gray_glass_door',
    'glassential:lime_glass_door',
    'glassential:magenta_glass_door',
    'glassential:orange_glass_door',
    'glassential:pink_glass_door',
    'glassential:purple_glass_door',
    'glassential:red_glass_door',
    'glassential:tinted_glass_door',
    'glassential:white_glass_door',
    'glassential:yellow_glass_door',
    'framedblocks:framed_door',
    'framedblocks:framed_iron_door',
    'davebuildingmod:steel_door',
  ])


  // fin //

})


// ******************** //
// **** FLUID TAGS **** //
// ******************** //

ServerEvents.tags('fluid', event => {

  // Add xp juice to experience tag
  // event.add('forge:experience', 'enderio:xp_juice')


  // fin //

})


// *************************** //
// **** BLOCK LOOT TABLES **** //
// *************************** // (move this? is this needed?)

ServerEvents.blockLootTables(event => {

  // Fix block not dropping item
  event.addSimpleBlock('xtonesreworked:xtone_tile', 'xtonesreworked:xtone_tile')
  event.addSimpleBlock('minecraft:reinforced_deepslate', 'minecraft:reinforced_deepslate')


  // fin //

})