// Priority: 1

const DYE_COLORS = [
  'white', 'orange', 'magenta', 'light_blue', 'yellow', 'lime', 'pink',
  'gray', 'light_gray', 'cyan', 'purple', 'blue', 'brown', 'green', 'red', 'black'
]

RecipeViewerEvents.removeEntries('item', event => {

  // ==============================
  // Debug Hidden
  // ==============================
  event.remove('ars_elemental:debug')
  event.remove('ars_nouveau:debug')
  event.remove('minecraft:debug_stick')
  event.remove('sophisticatedstorage:debug_tool')
  event.remove('zerocore:debugtool')

  // ==============================
  // Cake Items
  // ==============================
  event.remove('exdeorum:end_cake')
  event.remove('telepastries:end_cake')
  event.remove('telepastries:lost_city_cake')
  event.remove('telepastries:nether_cake')
  event.remove('telepastries:overworld_cake')

  // ==============================
  // Creative Items
  // ==============================
  event.remove('ae2:creative_energy_cell')
  event.remove('ars_nouveau:creative_source_jar')
  event.remove('botania:infrangible_platform')
  event.remove('botania:corporea_spark_creative')
  event.remove('buildinggadgets:construction_paste_container_creative')
  event.remove('create:creative_fluid_tank')
  event.remove('create:creative_crate')
  event.remove('create:handheld_worldshaper')
  event.remove('cyclic:battery_infinite')
  event.remove('mekanism:creative_chemical_tank')
  event.remove('mekanism:creative_fluid_tank')
  event.remove('mekanism:creative_bin')

  // ==============================
  // Leaves hidden
  // ==============================
  const leafMods = [
    'aether', 'ad_astra', 'allthemodium', 'ars_elemental', 'ars_nouveau',
    'bloomingnature', 'biomesoplenty', 'biomeswevegone', 'blue_skies', 'cobblemon',
    'caupona', 'culturaldelights', 'deeperdarker', 'deep_aether', 'forestry',
    'fishofthieves', 'forbidden_arcanus', 'forcecraft', 'hexerei', 'meadow',
    'naturesaura', 'occultism', 'sushigocrafting', 'tconstruct', 'thermal',
    'twilightforest', 'undergarden', 'upgrade_aquatic', 'vinery', 'quark'
  ]
  leafMods.forEach(mod => event.remove(new RegExp(`^${mod}:.+_leaves$`)))
  event.remove('occultism:otherworld_leaves_natural')

  // ==============================
  // Misc Hidden
  // ==============================
  event.remove(/ae2:facade/)
  event.remove(/^doggytalents:dog_bed$/)
  event.remove(/^ftbquests:.+/)
  event.remove(/^forcecraft:.+_flask$/)
  event.remove(/^gendustry:.+gene_/)
  event.remove(/^iron_bushes:.+_fragment$/)
  event.remove(/^iron_bushes:.+_bush_seed$/)
  event.remove(/^iron_bushes:.+_covered_leaves$/)
  event.remove(/^immersiveposts:(stick)_(copper|gold|lead|silver|nickel|constantan|electrum|uranium)$/)
  event.remove(/^majruszsdifficulty:.+_treasure_bag$/)
  event.remove(/^quark:ancient_tome$/)
  event.remove(/^quark:backpack$/)
  event.remove(/^quark:.+_pouch$/)
  event.remove(/^quark:.+_shard$/)
  event.remove(/^quark:.+_crystal_cluster$/)
  event.remove(/^reliquary:bullets\/neutral_bullet$/)
  event.remove(/^reliquary:magazines\/neutral_magazine$/)
  event.remove(/^tombstone:.*_of_/)
  event.remove(/^twilightforest:.*_force_field$/)
  event.remove(/^twilightforest:.*_castle_door$/)
  event.remove(/^twilightforest:.*_cloud$/)
  event.remove(/^tconstruct:.*potion$/)

  // ==============================
  // Ore Items
  // ==============================
  event.remove('deep_aether:skyjade_ore')
  event.remove('undergarden:depthrock_cloggrum_ore')
  event.remove('undergarden:shiverstone_cloggrum_ore')
  event.remove('undergarden:depthrock_froststeel_ore')

  // ==============================
  // JEI Clog (Tinkers)
  // ==============================
  const tcPatterns = [
    /tconstruct:repair_kit/, /tconstruct:.*_axe/, /tconstruct:.*_head/,
    /tconstruct:.*_blade/, /tconstruct:tool_.*/, /tconstruct:tough_.*/,
    /tconstruct:.*bow.*/, /tconstruct:arrow_.*/, /tconstruct:fletching/,
    /tconstruct:.*_plating/, /tconstruct:maille/, /tconstruct:shield_core/,
    /tconstruct:.*_staff/, /tconstruct:pickaxe/, /tconstruct:pickadze/,
    /tconstruct:mattock/, /tconstruct:kama/, /tconstruct:dagger/,
    /tconstruct:sword/, /tconstruct:.*_hammer/, /tconstruct:excavator/,
    /tconstruct:scythe/, /tconstruct:cleaver/, /tconstruct:fishing_rod/,
    /tconstruct:javelin/, /tconstruct:arrow/, /tconstruct:shuriken/,
    /tconstruct:melting_pan/, /tconstruct:war_pick/, /tconstruct:battlesign/,
    /tconstruct:swasher/
  ]
  tcPatterns.forEach(p => event.remove(p))

  // ==============================
  // Twilightforest Items
  // ==============================
  const tfItems = [
    'twilightforest:antibuilder', 'twilightforest:aurora_block', 'twilightforest:auroralized_glass',
    'twilightforest:blue_castle_rune_brick', 'twilightforest:brown_thorns', 'twilightforest:burnt_thorns',
    'twilightforest:candelabra', 'twilightforest:castle_brick', 'twilightforest:cicada',
    'twilightforest:castle_roof_tile', 'twilightforest:deadrock', 'twilightforest:death_tome_spawner',
    'twilightforest:etched_nagastone', 'twilightforest:fire_jet', 'twilightforest:firefly',
    'twilightforest:ghast_trap', 'twilightforest:green_throns', 'twilightforest:giant_cobblestone',
    'twilightforest:giant_log', 'twilightforest:giant_obsidian', 'twilightforest:hedge',
    'twilightforest:huge_stalk', 'twilightforest:huge_mushgloom', 'twilightforest:huge_mushgloom_stem',
    'twilightforest:keepsake_casket', 'twilightforest:lich_tower_miniature_structure',
    'twilightforest:locked_vanishing_block', 'twilightforest:mazestone', 'twilightforest:moonworm',
    'twilightforest:mining_log_core', 'twilightforest:naga_courtyard_miniature_structure',
    'twilightforest:nagastone_head', 'twilightforest:nagastone', 'twilightforest:pink_castle_rune_brick',
    'twilightforest:violet_castle_rune_brick', 'twilightforest:yellow_castle_rune_brick',
    'twilightforest:smoker', 'twilightforest:sorting_log_core', 'twilightforest:stronghold_shield',
    'twilightforest:trollvidr', 'twilightforest:twilight_portal_miniature_structure',
    'twilightforest:trophy_pedestal', 'twilightforest:time_log_core',
    'twilightforest:transformation_log_core', 'twilightforest:trollsteinn', 'twilightforest:trollber',
    'twilightforest:uncrafting_table', 'twilightforest:underbrick', 'twilightforest:uberous_soil',
    'twilightforest:unripe_trollber', 'twilightforest:wrought_iron_fence'
  ]
  tfItems.forEach(i => event.remove(i))

  // ==============================
  // Buckets + Spawners
  // ==============================
  event.remove(/.*:.*tipped_arrow.*/)
  event.remove(/.*:.*bucket.*/)
  event.remove(/.*:.*spawn_egg.*/)
  event.remove(/occultism:.*debug.*/)
  event.remove(/^cnb:.+_egg$/)
  event.remove('hunterillager:spawnegg_hunterillager')
  event.remove('inventorypets:easter_egg')
  event.remove(/twilightforest:.*boss_spawner/)

  // ==============================
  // Hide entire mods
  // ==============================
  const hiddenMods = [
    'additionalbanners', 'conjurer_illager', 'chipped', 'rechiseled',
    'pickletweaks', 'obtrophies', 'wandering_trapper'
  ]
  hiddenMods.forEach(mod => event.remove(new RegExp(`^${mod}:.*`)))

  // ==============================
  // Refined Storage Colored Machines
  // ==============================
  const rsMachines = [
    'controller', 'creative_controller', 'grid', 'crafting_grid', 'pattern_grid',
    'fluid_grid', 'network_receiver', 'network_transmitter', 'relay', 'detector',
    'security_manager', 'wireless_transmitter', 'disk_manipulator', 'crafter',
    'crafter_manager', 'crafting_monitor'
  ]
  DYE_COLORS.forEach(color => {
    rsMachines.forEach(machine => {
      event.remove(`refinedstorage:${color}_${machine}`)
    })
  })

})
