// priority: 0
//Stoneopolis Armor and Tools Tags

const $ItemStack = Java.loadClass("net.minecraft.world.item.ItemStack")

ServerEvents.tags('item', event => {
        
    //Mass Tag Adding For Gamestages
    
    event.add("stoneopolis:no_stage").add(/.*:.*/)
    let array = Ingredient.of("#stoneopolis:no_stage").itemIds;
    array.forEach(element => { 

        
        if (element.toString().includes("concrete")) {
            event.get("stoneopolis:concrete").add(element)
        }
        

        else if (element.toString().includes(":red_") || element.toString().includes("_red_")) {
            event.get("stoneopolis:red").add(element).remove("caveopolis:red_colored_sapling")
        }
        
        else if (element.toString().includes(":green_") || element.toString().includes("_green_")) {
            event.get("stoneopolis:green").add(element).remove("caveopolis:green_colored_sapling")
        }
        
        else if (element.toString().includes(":yellow_") || element.toString().includes("_yellow_")) {
            event.get("stoneopolis:yellow").add(element).remove("caveopolis:yellow_colored_sapling")
        }
        
        else if (element.toString().includes(":purple_") || element.toString().includes("_purple_")) {
            event.get("stoneopolis:purple").add(element).remove("caveopolis:purple_colored_sapling")
        }
        
        else if (element.toString().includes(":orange_") || element.toString().includes("_orange_")) {
            event.get("stoneopolis:orange").add(element).remove("caveopolis:orange_colored_sapling")
        }
        
        else if (element.toString().includes(":white_") || element.toString().includes("_white_")) {
            event.get("stoneopolis:white").add(element).remove("caveopolis:white_colored_sapling")
        }
        
        else if (element.toString().includes(":black_") || element.toString().includes("_black_")) {
            event.get("stoneopolis:black").add(element).remove("caveopolis:black_colored_sapling")
        }
        
        else if (element.toString().includes(":brown_") || element.toString().includes("_brown_")) {
            event.get("stoneopolis:brown").add(element).remove("caveopolis:brown_colored_sapling")
        }
        
        else if (element.toString().includes(":light_blue_") || element.toString().includes("_light_blue_")) {
            event.get("stoneopolis:light_blue").add(element).remove("caveopolis:light_blue_colored_sapling")
        }
        
        else if (element.toString().includes(":light_gray_") || element.toString().includes("_light_gray_")) {
            event.get("stoneopolis:light_gray").add(element).remove("caveopolis:light_gray_colored_sapling")
        }
        
        else if (element.toString().includes(":gray_") || element.toString().includes("_gray_")) {
            event.get("stoneopolis:gray").add(element).remove("caveopolis:gray_colored_sapling")
        }
        
        else if (element.toString().includes(":blue_") || element.toString().includes("_blue_")) {
            event.get("stoneopolis:blue").add(element).remove("caveopolis:blue_colored_sapling")
        }
        
        else if (element.toString().includes(":magenta_") || element.toString().includes("_magenta_")) {
            event.get("stoneopolis:magenta").add(element).remove("caveopolis:magenta_colored_sapling")
        }
        
        else if (element.toString().includes(":pink_") || element.toString().includes("_pink_")) {
            event.get("stoneopolis:pink").add(element).remove("caveopolis:pink_colored_sapling")
        }
        
        else if (element.toString().includes(":cyan_") || element.toString().includes("_cyan_")) {
            event.get("stoneopolis:cyan").add(element).remove("caveopolis:cyan_colored_sapling")
        }
        
        else if (element.toString().includes(":lime_") || element.toString().includes("_lime_")) {
            event.get("stoneopolis:lime").add(element).remove("caveopolis:lime_colored_sapling")
        }

        else if (element.toString().includes(":dark_oak_") || element.toString().includes("_dark_oak_")) {
            event.get("stoneopolis:dark_oak_wood").add(element)
        }
        
        else if (element.toString().includes(":oak_") || element.toString().includes("_oak_")) {
            event.get("stoneopolis:oak_wood").add(element)
        }
        
        else if (element.toString().includes(":spruce_") || element.toString().includes("_spruce_")) {
            event.get("stoneopolis:spruce_wood").add(element)
        }
        
        else if (element.toString().includes(":birch_") || element.toString().includes("_birch_")) {
            event.get("stoneopolis:birch_wood").add(element)
        }
        
        else if (element.toString().includes(":jungle_") || element.toString().includes("_jungle_")) {
            event.get("stoneopolis:jungle_wood").add(element)
        }
        
        else if (element.toString().includes(":acacia_") || element.toString().includes("_acacia_")) {
            event.get("stoneopolis:acacia_wood").add(element)
        }
        
        else if (element.toString().includes(":warped_") || element.toString().includes("_warped_")) {
            event.get("stoneopolis:warped_wood").add(element)
        }
        
        else if (element.toString().includes(":crimson_") || element.toString().includes("_crimson_")|| element.toString().includes("weeping")) {
            event.get("stoneopolis:crimson_wood").add(element)
        }
        
        else if (element.toString().includes(":cherry_") || element.toString().includes("_cherry_")) {
            event.get("stoneopolis:cherry_wood").add(element)
        }
        
        else if (element.toString().includes(":mangrove_") || element.toString().includes("_mangrove_")) {
            event.get("stoneopolis:mangrove_wood").add(element)
        }
        
        else if (element.toString().includes(":bamboo") || element.toString().includes("_bamboo_")) {
            event.get("stoneopolis:bamboo").add(element)
        }
        
        else if (element.toString().includes("iron") || element.toString().includes("_iron_")) {
            event.get("stoneopolis:iron").add(element)
        }

        else if (element.toString().includes("gold") || element.toString().includes("_gold_")) {
            event.get("stoneopolis:gold").add(element)
        }

        else if (element.toString().includes("copper") || element.toString().includes("_copper_")) {
            event.get("stoneopolis:copper").add(element)
        
        } else if (element.toString().includes("platinum") || element.toString().includes("_platinum_")) {
            event.get("stoneopolis:platinum").add(element)
        }

        else if (element.toString().includes(":tin") || element.toString().includes("_tin_") || element.toString().includes("raw_tin")) {
            event.get("stoneopolis:tin").add(element)
        }
        else if (element.toString().includes("diamond") || element.toString().includes("_diamond_")  || element.toString().includes("music_disc")) {
            event.get("stoneopolis:diamond").add(element)

        } else if (element.toString().includes("emerald") || element.toString().includes("_emerald_")) {
            event.get("stoneopolis:emerald").add(element)

        } else if (element.toString().includes("lapis") || element.toString().includes("_lapis_")) {
            event.get("stoneopolis:lapis").add(element);

        } else if (element.toString().includes("redstone") || element.toString().includes("_redstone_")) {
            event.get("stoneopolis:redstone").add(element)

        } else if (element.toString().includes("quartz") || element.toString().includes("_quartz_")) {
            event.get("stoneopolis:quartz").add(element)
        }
        
        else if (element.toString().includes("bronze") || element.toString().includes("_bronze_")) {
            event.get("stoneopolis:bronze").add(element)

        } else if (element.toString().includes("netherite") || element.toString().includes("_netherite_")) {
            event.get("stoneopolis:netherite").add(element)

        } else if (element.toString().includes("constantan") || element.toString().includes("_constantan_")) {
            event.get("stoneopolis:constantan").add(element)

        } else if (element.toString().includes("electrum") || element.toString().includes("_electrum_")) {
            event.get("stoneopolis:electrum").add(element)

        } else if (element.toString().includes("enderium") || element.toString().includes("_enderium_")) {
            event.get("stoneopolis:enderium").add(element)

        } else if (element.toString().includes("signalum")|| element.toString().includes("_signalum_")) {
            event.get("stoneopolis:signalum").add(element)

        } else if (element.toString().includes("lumium") || element.toString().includes("_lumium_")) {
            event.get("stoneopolis:lumium").add(element)
            
        } else if (element.toString().includes("steel") || element.toString().includes("_steel_")) {
            event.get("stoneopolis:steel").add(element)

        } else if (element.toString().includes("invar") || element.toString().includes("_invar_")) {
            event.get("stoneopolis:invar").add(element)

        } else if (element.toString().includes("brass") || element.toString().includes("_brass_")) {
            event.get("stoneopolis:brass").add(element)
        
        } else if (element.toString().includes("lead") || element.toString().includes("_lead_")) {
            event.get("stoneopolis:lead").add(element)
        
        } else if (element.toString().includes("coal") || element.toString().includes("_coal_")) {
            event.get("stoneopolis:coal").add(element)
        
        } else if (element.toString().includes("aluminum") || element.toString().includes("_aluminum_")) {
            event.get("stoneopolis:aluminum").add(element)
        
        } else if (element.toString().includes("iridium") || element.toString().includes("_iridium_")) {
            event.get("stoneopolis:iridium").add(element)
        
        } else if (element.toString().includes("nickel") || element.toString().includes("_nickel_")) {
            event.get("stoneopolis:nickel").add(element)
        

        
        } else if (element.toString().includes("silver") || element.toString().includes("_silver_")) {
            event.get("stoneopolis:silver").add(element)
        
        } else if (element.toString().includes("uranium") || element.toString().includes("_uranium_")) {
            event.get("stoneopolis:uranium").add(element)
        
        } else if (element.toString().includes("zinc") || element.toString().includes("_zinc_")) {
            event.get("stoneopolis:zinc").add(element)
    
        } else if (element.toString().includes("osmium") || element.toString().includes("_osmium_")) {
            event.get("stoneopolis:osmium").add(element)
        
        } else if (element.toString().includes("amethyst") || element.toString().includes("_amethyst_")) {
            event.get("stoneopolis:amethyst").add(element)

        } else if (element.toString().includes("prismarine") || element.toString().includes(":sea_lantern")) {
            event.get("stoneopolis:prismarine").add(element)
        
        } else if (element.toString().includes("purpur") || element.toString().includes("chorus")) {
            event.get("stoneopolis:purpur").add(element)
        
        } else if (element.toString().includes(":coral") || element.toString().includes("_coral")) {
            event.get("stoneopolis:coral").add(element)
        
        } 
        
        else if (element.toString().includes("sculk") || element.toString().includes("echo") || element.toString().includes("recovery_compass")) {
            event.get("stoneopolis:sculk").add(element)
        }
        else if (element.toString().includes(":azalea") || element.toString().includes("_azalea")) {
            event.get("stoneopolis:azalea").add(element)
        }
        else if (element.toString().includes(":moss") || element.toString().includes("_moss")) {
            event.get("stoneopolis:moss").add(element)
        }




        else if (element.toString().includes("diorite") || element.toString().includes("granite") || element.toString().includes("andesite") || element.toString().includes("mixed_stone")) {
            event.get("stoneopolis:mixed_stone").add(element)
        }

        else if (element.toString().includes("sand") || element.toString().includes("sandstone") || element.toString().includes("minecraft:gravel") || element.toString().includes("minecraft:flint") || element.toString().includes("glass")) {
            event.get("stoneopolis:sand").add(element)
        }

        else if (element.toString().includes("clay") || element.toString().includes("terracotta") || element.toString().includes(":brick") || element.toString().includes("minecraft:flower_pot") || element.toString().includes("minecraft:flower_pot")) {
            event.get("stoneopolis:clay").add(element)
        }

        else if (element.toString().includes("deepslate")) {
            event.get("stoneopolis:deepslate").add(element)
        }

        else if (element.toString().includes("blackstone")) {
            event.get("stoneopolis:blackstone").add(element)
        }

        else if (element.toString().includes("potion") || element.toString().includes("tipped") || element.toString().includes("enchant") || element.toString().includes('minecraft:experience_bottle')) {
            event.get("stoneopolis:brewing").add(element)
        }  

        else if (element.toString().includes("banner_pattern") || element.toString().includes("smithing_template") || element.toString().includes("sherd") || element.toString().includes("mineraft:brush") || element.toString().includes("suspicious")) {
            event.get("stoneopolis:archaeology").add(element)
        }  

        else if (element.toString().includes("spawn_egg")){
            event.get("stoneopolis:spawn_eggs").add(element)
        }  
        

        else if (element.toString().includes("rainbow") || element.toString().includes("color_core") || element.toString().includes("core_ore")){
            event.get("stoneopolis:rainbow").add(element)
        }  
        

        //Manual Additions of items

            
        event.get(`stoneopolis:flowers`).add([
            `#minecraft:small_flowers`,
            `#minecraft:tall_flowers`,
            `#minecraft:flowers`
        ])

        event.get(`stoneopolis:seeds`).add([
            `#forge:seeds`,
            `#forge:crops`,
            `minecraft:carrot_on_a_stick`,
            `minecraft:sugar`,
            `minecraft:paper`,
            `opolisutilities:soaked_paper`,
            `minecraft:cartography_table`,
            `minecraft:cookie`,
            `minecraft:cake`,
            `minecraft:pumpkin_pie`,
            `minecraft:beetroot_soup`,
            `minecraft:rabbit_stew`,
            `minecraft:suspicious_stew`,
            `minecraft:bread`,
        ])

        event.get(`stoneopolis:nature`).add([
            "minecraft:mushroom_stew",
            "minecraft:poisonous_potato", 
            "minecraft:baked_potato", 
            "minecraft:melon_slice", 
            "minecraft:glow_berries", 
            "minecraft:grass", 
            "minecraft:fern", 
            "minecraft:dead_bush", 
            "minecraft:spore_blossom", 
            "minecraft:sugar_cane", 
            "minecraft:cactus", 
            "minecraft:nether_sprouts", 
            "minecraft:vine", 
            "minecraft:tall_grass", 
            "minecraft:large_fern", 
            "minecraft:big_dripleaf", 
            "minecraft:small_dripleaf", 
            "minecraft:hanging_roots", 
            "minecraft:frogspawn", 
            "minecraft:cocoa_beans", 
            "minecraft:torchflower_seeds", 
            "minecraft:sweet_berries", 
            "minecraft:lily_pad", 
            "minecraft:melon", 
            "minecraft:pumpkin", 
            "minecraft:carved_pumpkin", 
            "minecraft:jack_o_lantern", 
            "minecraft:hay_block", 
            "minecraft:ochre_froglight", 
            "minecraft:verdant_froglight", 
            "minecraft:pearlescent_froglight",
            "minecraft:candle", 
            "minecraft:honeycomb_block", 
            "minecraft:honey_block", 
            "minecraft:honey_bottle", 
            "minecraft:honeycomb", 
            "minecraft:bee_nest", 
            "minecraft:beehive",
            "minecraft:candle",
            ""
        ])

        event.get(`stoneopolis:dirt`).add(
            "minecraft:rooted_dirt", 
            "minecraft:coarse_dirt", 
            "minecraft:dirt", 
            "minecraft:dirt_path", 
            "minecraft:farmland", 
            "minecraft:mud",
            "minecraft:grass_block", 
            "minecraft:podzol", 
            "minecraft:mycelium", 
            "minecraft:packed_mud", 
            "minecraft:mud_bricks", 
            "minecraft:mud_brick_stairs", 
            "minecraft:mud_brick_slab", 
            "minecraft:mud_brick_wall",
            "caveopolis:brown_colored_sapling"
        )
        
        event.get(`stoneopolis:ocean_materials`).add([
            "minecraft:turtle_egg", 
            "minecraft:turtle_helmet", 
            "minecraft:scute", 
            "minecraft:glow_ink_sac", 
            "minecraft:ink_sac", 
            "minecraft:dried_kelp", 
            "minecraft:heart_of_the_sea", 
            "minecraft:nautilus_shell", 
            "minecraft:conduit", 
            "minecraft:trident", 
            "minecraft:seagrass", 
            "minecraft:wet_sponge", 
            "minecraft:dead_horn_coral_block",
            "minecraft:kelp",
            "minecraft:dried_kelp_block",
            "minecraft:sponge",
            "minecraft:sea_pickle"
        ])

        event.get(`stoneopolis:frozen`).add([
            "minecraft:ice", 
            "minecraft:packed_ice", 
            "minecraft:blue_ice",
            "minecraft:snow_block", 
            "minecraft:snowball", 
            "minecraft:snow", 
            "minecraft:powder_snow_bucket"


        ])

        event.get(`stoneopolis:archaeology`).add([
            "minecraft:decorated_pot",
            "minecraft:brush"
        ])
        
        //Never needed items
        event.get("stoneopolis:un_needed_items").add([
            "dimpaintings:overworld_painting",
            "dimpaintings:nether_painting",
            "@ftbquests",
            "@itemfilters",
            "@skyblockbuilder",
            'minecraft:command_block', 
            'minecraft:chain_command_block', 
            'minecraft:command_block_minecart', 
            'minecraft:jigsaw', 
            'minecraft:structure_block', 
            'minecraft:structure_void', 
            'minecraft:debug_stick', 
            'minecraft:light', 
            'mining_dimension:teleporter',
            "minecraft:infested_stone",
            "minecraft:infested_cobblestone",
            "minecraft:infested_stone_bricks",
            "minecraft:infested_cracked_stone_bricks",
            "minecraft:infested_chiseled_stone_bricks",
            "opolisutilities:elite_loot_box",
            "opolisutilities:advanced_loot_box",
            'alltheores:deepslate_ruby_ore', 
            'alltheores:ruby_ore', 
            'alltheores:ruby_block', 
            'alltheores:ruby_dust', 
            'alltheores:ruby', 
            'alltheores:deepslate_peridot_ore', 
            'alltheores:peridot_ore', 
            'alltheores:peridot_block', 
            'alltheores:peridot_dust', 
            'alltheores:peridot', 
            'alltheores:deepslate_sapphire_ore', 
            'alltheores:sapphire_ore', 
            'alltheores:sapphire_block', 
            'alltheores:sapphire_dust', 
            'alltheores:sapphire',
            "morebuckets:rubber_bucket",
            "minecraft:chainmail_helmet",
            "minecraft:chainmail_chestplate",
            "minecraft:chainmail_leggings",
            "minecraft:chainmail_boots",
            "minecraft:barrier",
            "minecraft:repeating_command_block",
            'industrialforegoing:mycelial_meatallurgic', 
            'industrialforegoing:mycelial_crimed', 
            'industrialforegoing:mycelial_rocket', 
            'industrialforegoing:mycelial_death', 
            'industrialforegoing:mycelial_netherstar', 
            'industrialforegoing:mycelial_pink', 
            'industrialforegoing:mycelial_magma', 
            'industrialforegoing:mycelial_halitosis', 
            'industrialforegoing:mycelial_frosty', 
            'industrialforegoing:mycelial_explosive', 
            'industrialforegoing:mycelial_ender', 
            'industrialforegoing:mycelial_disenchantment', 
            'industrialforegoing:mycelial_potion', 
            'industrialforegoing:mycelial_culinary', 
            'industrialforegoing:mycelial_slimey', 
            'industrialforegoing:mycelial_furnace', 
            'industrialforegoing:biofuel_generator', 
            'industrialforegoing:pitiful_generator',
            'industrialforegoing:mycelial_reactor',
            'industrialforegoing:bioreactor'
        ]).remove([
            "ftbquests:book"
        ])

        event.get("stoneopolis:iron").add([
            "minecraft:lantern",
            "minecraft:stonecutter",
            "minecraft:cauldron",
            "minecraft:chain",
            "minecraft:heavy_weighted_pressure_plate",
            "minecraft:hopper",
            'minecraft:lightning_rod', 
            'minecraft:bucket', 
            'minecraft:water_bucket', 
            'minecraft:cod_bucket', 
            'minecraft:salmon_bucket',
            'minecraft:tropical_fish_bucket', 
            'minecraft:pufferfish_bucket', 
            'minecraft:milk_bucket', 
            'minecraft:lava_bucket', 
            'minecraft:tadpole_bucket', 
            'minecraft:axolotl_bucket', 
            'minecraft:shears',
            'minecraft:tnt_minecart', 
            'minecraft:furnace_minecart', 
            'minecraft:chest_minecart', 
            'minecraft:hopper_minecart', 
            'minecraft:minecart', 
            'minecraft:activator_rail', 
            'minecraft:detector_rail', 
            'minecraft:powered_rail', 
            'minecraft:rail', 
            'minecraft:tripwire_hook',
            "minecraft:anvil",
            "minecraft:damaged_anvil",
            "minecraft:chipped_anvil",
            "minecraft:blast_furnace",
            "minecraft:smithing_table",
            "minecraft:grindstone",
            "minecraft:shield",
            "opolisutilities:block_breaker",
            "opolisutilities:block_placer",
            "opolisutilities:item_repairer",

        ])

        event.get("stoneopolis:gold").add([
            "minecraft:light_weighted_pressure_plate",
            "minecraft:clock",
            "minecraft:glistering_melon_slice",
            "constructionwand:core_angel",
            "stoneopolis:gear_box"
        ])

        event.get("stoneopolis:steel").add([
            "minecraft:piston",
            "minecraft:sticky_piston"
        ])

        event.get("stoneopolis:bamboo").add([
            "minecraft:scaffolding",
        ])

        event.get("stoneopolis:redstone").add([
            "minecraft:dropper",
            "minecraft:dispenser",
            "minecraft:note_block",
            "minecraft:repeater",
            "minecraft:comparator",
            "minecraft:target",
            "minecraft:bell",
            "minecraft:trapped_chest"
        ])

        event.get("stoneopolis:diamond").add([
            "minecraft:jukebox",
            "minecraft:disc_fragment_5",
            "constructionwand:core_destruction"
        ])

        event.get("stoneopolis:netherite").add([
            "minecraft:lodestone",
            "minecraft:ancient_debris",
            "miencraft:scrap"
        ])

        event.get("stoneopolis:redstone").add([
            "minecraft:map",
            "minecraft:compass"
        ])

        event.get(`stoneopolis:passive_mobs`).add([
            "caveopolis:green_colored_sapling",
            "strainers:summoning_block",
            "opolisutilities:home_stone", 
            "opolisutilities:opolis_wrench",
            "opolisutilities:super_home_stone", 
            "opolisutilities:advanced_home_stone", 
            "minecraft:ender_chest", "minecraft:ender_eye", 
            "minecraft:ender_pearl", 
            "opolisutilities:ender_pearl_fragment", 
            "opolisutilities:ender_ore", 
            "opolisutilities:deepslate_ender_ore", 
            "opolisutilities:ender_scrambler",
            "minecraft:painting", 
            "opolisutilities:floating_block_item", 
            "minecraft:name_tag", 
            "minecraft:sniffer_egg", 
            "minecraft:pitcher_pod", 
            "opolisutilities:jerky", 
            "minecraft:goat_horn", 
            "minecraft:egg", 
            "minecraft:beef", 
            "minecraft:cooked_beef", 
            "minecraft:porkchop", 
            "minecraft:cooked_porkchop", 
            "minecraft:mutton", 
            "minecraft:cooked_mutton",
            "minecraft:chicken", 
            "minecraft:cooked_chicken", 
            "minecraft:rabbit", 
            "minecraft:cooked_rabbit", 
            "minecraft:rabbit_hide", 
            "minecraft:feather", 
            "minecraft:rabbit_foot",
            "minecraft:armor_stand", 
            "minecraft:lectern", 
            "minecraft:lead", 
            "minecraft:leather_helmet", 
            "minecraft:leather_chestplate", 
            "minecraft:leather_leggings", 
            "minecraft:leather_boots", 
            "minecraft:leather_horse_armor", 
            "minecraft:leather", 
            "opolisutilities:bundled_flesh",
            "minecraft:bookshelf", 
            "minecraft:chiseled_bookshelf", 
            "minecraft:writable_book", 
            "minecraft:book", 
            "minecraft:item_frame", 
            "minecraft:glow_item_frame", 
            "minecraft:saddle",
            "minecraft:leather"
        ])
    
        event.get(`stoneopolis:hostile_mobs`).add([
            "caveopolis:lime_colored_sapling",
            "minecraft:arrow", 
            "minecraft:spectral_arrow", 
            "minecraft:cobweb", 
            "minecraft:slime_block", "minecraft:totem_of_undying", "minecraft:bow", "minecraft:crossbow", "minecraft:spawner", "minecraft:string", "minecraft:firework_rocket", "minecraft:firework_star", "minecraft:tnt","minecraft:zombie_head", "minecraft:skeleton_skull", "minecraft:creeper_head", "minecraft:slime_ball", "minecraft:phantom_membrane", "minecraft:rotten_flesh", "minecraft:spider_eye", "minecraft:gunpowder", "minecraft:fermented_spider_eye", "minecraft:bone_block", "minecraft:bone"]    
        )
    
        event.get(`stoneopolis:hostile_mobs_nether`).add([
            "opolisutilities:resource_generator_2",
            "opolisutilities:fluid_generator",
            "minecraft:beacon", 
            "minecraft:blaze_powder", 
            "minecraft:fire_charge", 
            "minecraft:brewing_stand", 
            "minecraft:piglin_head", 
            "minecraft:wither_skeleton_skull",
            "minecraft:blaze_rod", 
            "minecraft:nether_star", 
            "minecraft:ghast_tear", 
            "minecraft:magma_cream", 
            "minecraft:magma_block",
            "stoneopolis:nether_star_fragment",
            "caveopolis:colored_caves_portal",
            "stoneopolis:fire_stick",
            "stoneopolis:nether_skull_fragment",
            "stoneopolis:blazing_fluid_bucket",
            "constructionwand:infinity_wand",
        ])
    
        event.get(`stoneopolis:hostile_mobs_end`).add(
            ["minecraft:dragon_head", "minecraft:dragon_egg", "minecraft:dragon_breath"]
        )

            
        event.get(`stoneopolis:basic_end`).add(
            ["minecraft:end_crystal", "minecraft:end_portal_frame", "minecraft:end_rod", "minecraft:elytra", "minecraft:shulker_shell", "minecraft:shulker_box", "minecraft:end_stone", "minecraft:end_stone_bricks", "minecraft:end_stone_brick_stairs", "minecraft:end_stone_brick_slab", "minecraft:end_stone_brick_wall"]
        )

        event.get(`stoneopolis:amethyst`).add([
            "minecraft:spyglass",
        ])

        event.get(`stoneopolis:quartz`).add([
            "minecraft:daylight_detector",
            "minecraft:observer"
        ])

        event.get(`stoneopolis:ae2`).add([
            "caveopolis:purple_colored_sapling"
        ])

        event.get(`stoneopolis:lapis`).add([
            "caveopolis:blue_colored_sapling"
        ])


        event.get(`stoneopolis:basic_nether`).add([
            "caveopolis:pink_colored_sapling",
            "caveopolis:magenta_colored_sapling",
            "morebuckets:obsidian_bucket",
            "minecraft:glowstone",
            "minecraft:glowstone_dust",
            "minecraft:glowtone_block",
            "minecraft:obsidian",
            "minecraft:crying_obsidian",
            "minecraft:respawn_anchor",
            "minecraft:shroomlight", 
            "minecraft:netherrack", 
            "minecraft:nether_bricks", 
            "minecraft:cracked_nether_bricks", 
            "minecraft:nether_brick_stairs", 
            "minecraft:nether_brick_slab", 
            "minecraft:red_nether_brick_wall", 
            "minecraft:red_nether_brick_slab", 
            "minecraft:red_nether_brick_stairs", 
            "minecraft:red_nether_bricks", 
            "minecraft:chiseled_nether_bricks", 
            "minecraft:nether_brick_fence", 
            "minecraft:nether_brick_wall", 
            "minecraft:warped_nylium", 
            "minecraft:twisting_vines", 
            "minecraft:crimson_nylium", 
            "minecraft:nether_wart_block", 
            "minecraft:nether_wart", 
            "minecraft:nether_brick", 
            "minecraft:soul_campfire", 
            "minecraft:soul_lantern", 
            "minecraft:soul_torch", 
            "minecraft:soul_soil", 
            "minecraft:soul_sand",
            "minecraft:basalt",
            "minecraft:smooth_basalt",
            "minecraft:polished_basalt"
        ])

        event.get(`stoneopolis:fishing`).add(
            ["minecraft:fishing_rod", "minecraft:cod", "minecraft:cooked_cod", "minecraft:salmon", "minecraft:cooked_salmon", "minecraft:tropical_fish", "minecraft:pufferfish"]
        )

        event.get("stoneopolis:wooden_items").add([
            "caveopolis:white_colored_sapling",
            "minecraft:lever",
            "minecraft:bone_meal",
            "minecraft:stick",
            'minecraft:composter', 
            'minecraft:campfire', 
            'minecraft:smoker', 
            'minecraft:ladder',
            'minecraft:chest', 
            'minecraft:barrel',
            "minecraft:torch",
            "caveopolis:stone_torch",
            "minecraft:loom",
            "minecraft:fletching_table",
            "opolisutilities:wooden_shears",
            "opolisutilities:crook",
            "opolisutilities:log_sheet",
            "minecraft:bowl", 
            wooden_hopper,
            "minecraft:crafting_table"
        ])

        event.get(`stoneopolis:brown`).add([
            "minecraft:mushroom_stem"
        ])

        event.get(`stoneopolis:sand`).add([
            "caveopolis:yellow_colored_sapling"
        ])

        event.get(`stoneopolis:deepslate`).add([
            "caveopolis:black_colored_sapling",
            "stoneopolis:void_nugget",
            "stoneopolis:void_chunk",
            "stoneopolis:void_ingot",
            "stoneopolis:void_bucks",
            "stoneopolis:void_string",
            "javd:portal_block",
            "stoneopolis:stone_charm",
            "farmersdelight:flint_knife",
            "opolisutilities:resource_generator",
            "stoneopolis:void_apple",
            "stoneopolis:void_string",
            "opolisutilities:leafy_string",
            "caveopolis:bright_stone_ore",
            "caveopolis:bright_shard",
            "stoneopolis:bottled_void",
            "stoneopolis:void_stone",
            "stoneopolis:void_dirt",
            "caveopolis:spray_can_remover",
            "strainers:deepslate_pebble", 
            "strainers:leafy_mesh", 
            "strainers:mulch", 
            "strainers:wooden_strainer",
            "strainers:eroding_salt_mulch"
            

        ])

        event.get("stoneopolis:immersiveengineering").add([
            "flopper:flopper"
        ])

        event.get("stoneopolis:lavamotron").add([
            "lavamotron:lavamotron",
            "lavamotron:thermal_shard",
            "stoneopolis:lava_fragment"
        ])

        event.get("stoneopolis:cobblestone").add([
            'minecraft:cobblestone', 
            'minecraft:furnace', 
            'minecraft:cobblestone_stairs', 
            'minecraft:cobblestone_slab', 
            'minecraft:cobblestone_wall', 
            'minecraft:stone_sword',
            'minecraft:stone_shovel',
            'minecraft:stone_pickaxe', 
            'minecraft:stone_axe', 
            'minecraft:stone_hoe', 
            "constructionwand:stone_wand",
            'caveopolis:cobblestone_brick_wall', 
            'caveopolis:cobblestone_brick_stairs', 
            'caveopolis:cobblestone_brick_slab', 
            'caveopolis:cobblestone_bricks'
        ])

        event.get("stoneopolis:geode_plus").add([
            "stoneopolis:geode_fragment",
            "stoneopolis:empty_budding_stone",
            "stoneopolis:cluster_template",
            "stoneopolis:cluster_grower",
            "stoneopolis:budding_charm",
            "caveopolis:light_blue_colored_sapling"
        ])

        event.get("stoneopolis:extendedcrafting").add([
            "stoneopolis:ingot_of_duplication",
            "stoneopolis:stone_ingot",
            "stoneopolis:emerald_ingot"
        ])

        event.get("stoneopolis:gray").add([
            "stoneopolis:fertile_stone"
        ])

        event.get("stoneopolis:bloodmagic").add([
            "stoneopolis:grass_seed",
            "stoneopolis:routing_stick",
            "caveopolis:red_colored_sapling"
        ])

        event.get("stoneopolis:tin").add([
            "caveopolis:light_gray_colored_sapling"
        ])

        event.get("stoneopolis:copper").add([
            "caveopolis:orange_colored_sapling"
        ])

        event.get("stoneopolis:clay").add([
            "caveopolis:cyan_colored_sapling"
        ])

        event.get("stoneopolis:brown").add([
            "opolisutilities:drying_table", 
        ])

        event.get("stoneopolis:oak_wood").add([
            "minecraft:apple", 
        ])

        event.get("stoneopolis:mixed_stone").add([
            "minecraft:calcite",
            "minecraft:tuff",
            "minecraft:dripstone_block",
            "minecraft:pointed_dripstone",
            "caveopolis:sprayer",
            "caveopolis:glowstone_spray_can",
            "caveopolis:marble",
            "caveopolis:marble_slab",
            "caveopolis:marble_stairs",
            "caveopolis:marble_wall",
            "caveopolis:marble_bricks",
            "caveopolis:marble_brick_slab",
            "caveopolis:marble_brick_stairs",
            "caveopolis:marble_brick_wall"
        ])

        event.get("stoneopolis:starting").add([
            "opolisutilities:basic_loot_box", 
            "caveopolis:gray_colored_sapling",
            "@patchouli",
            "ftbquests:book",
            "@eccentrictome",
            "opolisutilities:catalogue",
            "opolisutilities:catalogue_book",
            "opolisutilities:sapling_grower",
            "opolisutilities:wallet",
            "opolisutilities:b_bucks",
            "caveopolis:stone_stick",
            "caveopolis:stone_crafting_table",
            "strainers:stone_pebble",
            "minecraft:stone",
            "minecraft:bedrock",
            "minecraft:glow_lichen",
            "minecraft:smooth_stone_slab",
            "minecraft:smooth_stone",
            "minecraft:stone_slab",
            "minecraft:stone_stairs",
            "minecraft:stone_pressure_plate",
            "minecraft:stone_button",
            "minecraft:stone_bricks",
            "minecraft:stone_brick_slab",
            "minecraft:stone_brick_stairs",
            "minecraft:cracked_stone_bricks",
            "minecraft:chiseled_stone_bricks",
            "minecraft:stone_brick_wall",
        ])

        event.get("stoneopolis:end_painting").add([
            "stoneopolis:dragon_egg_collector",
            "dimpaintings:end_painting",
            "stoneopolis:canvas_of_nothing",
            'endertrigon:baby_dragon_egg'

        ])


    

        

    })

    //Mods To Tags

    event.get("stoneopolis:ae2").add("@ae2").add("@ae2things").add("@aeinfinitybooster")
    event.get("stoneopolis:bloodmagic").add("@bloodmagic")
    event.get("stoneopolis:functionalstorage").add("@functionalstorage")
    event.get("stoneopolis:infinity").add("@infinity")
    event.get("stoneopolis:immersiveengineering").add("@immersiveengineering")
    event.get("stoneopolis:hutoslib").add("@hutoslib")
    event.get("stoneopolis:hostilenetworks").add("@hostilenetworks")
    event.get("stoneopolis:extendedcrafting").add("@extendedcrafting")
    event.get("stoneopolis:geode_plus").add("@geode_plus")
    event.get("stoneopolis:industrialforegoing").add("@industrialforegoing").add("@industrialforegoingsouls").remove(['industrialforegoing:mycelial_meatallurgic', 'industrialforegoing:mycelial_crimed', 'industrialforegoing:mycelial_rocket', 'industrialforegoing:mycelial_death', 'industrialforegoing:mycelial_netherstar', 'industrialforegoing:mycelial_pink', 'industrialforegoing:mycelial_magma', 'industrialforegoing:mycelial_halitosis', 'industrialforegoing:mycelial_frosty', 'industrialforegoing:mycelial_explosive', 'industrialforegoing:mycelial_ender', 'industrialforegoing:mycelial_disenchantment', 'industrialforegoing:mycelial_potion', 'industrialforegoing:mycelial_culinary', 'industrialforegoing:mycelial_slimey', 'industrialforegoing:mycelial_furnace', 'industrialforegoing:biofuel_generator', 'industrialforegoing:pitiful_generator', 'industrialforegoing:mycelial_reactor', 'industrialforegoing:bioreactor'])
    event.get("stoneopolis:framedblocks").add("@framedblocks")
    event.get("stoneopolis:tiab").add("@tiab")
    event.get("stoneopolis:farmersdelight").add("@farmersdelight")
    event.get("stoneopolis:farmersdelight").remove("farmersdelight:flint_knife")
    event.get("stoneopolis:strainers").add("@strainers").remove(["strainers:summoning_block", "strainers:eroding_salt_mulch", "strainers:stone_pebble", "strainers:deepslate_pebble", "strainers:leafy_mesh", "strainers:mulch", "strainers:wooden_strainer"])
    event.get("stoneopolis:bhc").add("@bhc")
    event.get("stoneopolis:fluxnetworks").add("@fluxnetworks")


    

    






    

})

const $CraftingRecipe = Java.loadClass('net.minecraft.world.item.crafting.CraftingRecipe')

ServerEvents.recipes(event => {

    //Recipe staging
    /*

    addStageByMod("extendedcrafting", "extendedcrafting")
    addStageByMod("ae2", "ae2")
    addStageByMod("bloodmagic", "bloodmagic")
    addStageByMod("functionalstorage", "functionalstorage")
    addStageByMod("infinity", "infinity")
    addStageByMod("immersiveengineering", "immersiveengineering")
    addStageByMod("hutoslib", "hutoslib")
    addStageByMod("hostilenetworks", "hostilenetworks")
    addStageByMod("geode_plus", "geode_plus")
    addStageByMod("industrialforegoing", "industrialforegoing")
    addStageByMod("framedblocks", "framedblocks")
    addStageByMod("tiab", "tiab")
    addStageByMod("farmersdelight", "farmersdelight")
    addStageByMod("strainers", "strainers")
    addStageByMod("wooden_items", "wooden_items")
    addStageByMod("bhc", "bhc")
        
    addStageByTag("white", "#stoneopolis:white");
    addStageByTag("orange", "#stoneopolis:orange");
    addStageByTag("magenta", "#stoneopolis:magenta");
    addStageByTag("light_blue", "#stoneopolis:light_blue");
    addStageByTag("yellow", "#stoneopolis:yellow");
    addStageByTag("lime", "#stoneopolis:lime");
    addStageByTag("pink", "#stoneopolis:pink");
    addStageByTag("gray", "#stoneopolis:gray");
    addStageByTag("light_gray", "#stoneopolis:light_gray");
    addStageByTag("cyan", "#stoneopolis:cyan");
    addStageByTag("purple", "#stoneopolis:purple");
    addStageByTag("blue", "#stoneopolis:blue");
    addStageByTag("brown", "#stoneopolis:brown");
    addStageByTag("green", "#stoneopolis:green");
    addStageByTag("red", "#stoneopolis:red");
    addStageByTag("black", "#stoneopolis:black");

    addStageByTag("oak_wood", "#stoneopolis:oak_wood");
    addStageByTag("spruce_wood", "#stoneopolis:spruce_wood");
    addStageByTag("birch_wood", "#stoneopolis:birch_wood");
    addStageByTag("jungle_wood", "#stoneopolis:jungle_wood");
    addStageByTag("acacia_wood", "#stoneopolis:acacia_wood");
    addStageByTag("dark_oak_wood", "#stoneopolis:dark_oak_wood");
    addStageByTag("warped_wood", "#stoneopolis:warped_wood");
    addStageByTag("crimson_wood", "#stoneopolis:crimson_wood");
    addStageByTag("cherry_wood", "#stoneopolis:cherry_wood");
    addStageByTag("bamboo", "#stoneopolis:bamboo");
    addStageByTag("mangrove_wood", "#stoneopolis:mangrove_wood");

    addStageByTag("mixed_stone", "#stoneopolis:mixed_stone");
    addStageByTag("sand", "#stoneopolis:sand");
    addStageByTag("clay", "#stoneopolis:clay");
    addStageByTag("brewing", "#stoneopolis:brewing");
    addStageByTag("purpur", "#stoneopolis:purpur");
    addStageByTag("coral", "#stoneopolis:coral");
    addStageByTag("sculk", "#stoneopolis:sculk");
    addStageByTag("deepslate", "#stoneopolis:deepslate");
    addStageByTag("blackstone", "#stoneopolis:blackstone");
    addStageByTag("azalea", "#stoneopolis:azalea");
    addStageByTag("moss", "#stoneopolis:moss");
    addStageByTag("flowers", "#stoneopolis:flowers");
    addStageByTag("seeds", "#stoneopolis:seeds");
    addStageByTag("nature", "#stoneopolis:nature");
    addStageByTag("ocean_materials", "#stoneopolis:ocean_materials");
    addStageByTag("dirt", "#stoneopolis:dirt");
    addStageByTag("frozen", "#stoneopolis:frozen");
    addStageByTag("archaeology", "#stoneopolis:archaeology");
    addStageByTag("passive_mobs", "#stoneopolis:passive_mobs");
    addStageByTag("hostile_mobs", "#stoneopolis:hostile_mobs");
    addStageByTag("hostile_mobs_nether", "#stoneopolis:hostile_mobs_nether");
    addStageByTag("hostile_mobs_end", "#stoneopolis:hostile_mobs_end");
    addStageByTag("basic_end", "#stoneopolis:basic_end");
    addStageByTag("basic_nether", "#stoneopolis:basic_nether");
    addStageByTag("spawn_eggs", "#stoneopolis:spawn_eggs");
    addStageByTag("rainbow", "#stoneopolis:rainbow");
    addStageByTag("fishing", "#stoneopolis:fishing");
    addStageByTag("lavamotron", "#stoneopolis:lavamotron");
    addStageByTag("cobblestone", "#stoneopolis:cobblestone");
    addStageByTag("un_needed_items", "#stoneopolis:un_needed_items");

    addStageByTag("iron", "#stoneopolis:iron");
    addStageByTag("gold", "#stoneopolis:gold");
    addStageByTag("copper", "#stoneopolis:copper");
    addStageByTag("tin", "#stoneopolis:tin");
    addStageByTag("diamond", "#stoneopolis:diamond");
    addStageByTag("emerald", "#stoneopolis:emerald");
    addStageByTag("lapis", "#stoneopolis:lapis");
    addStageByTag("quartz", "#stoneopolis:quartz");
    addStageByTag("redstone", "#stoneopolis:redstone");
    addStageByTag("bronze", "#stoneopolis:bronze");
    addStageByTag("netherite", "#stoneopolis:netherite");
    addStageByTag("constantan", "#stoneopolis:constantan");
    addStageByTag("electrum", "#stoneopolis:electrum");
    addStageByTag("enderium", "#stoneopolis:enderium");
    addStageByTag("lumium", "#stoneopolis:lumium");
    addStageByTag("signalum", "#stoneopolis:signalum");
    addStageByTag("steel", "#stoneopolis:steel");
    addStageByTag("invar", "#stoneopolis:invar");
    addStageByTag("brass", "#stoneopolis:brass");

    addStageByTag("lead", "#stoneopolis:lead");
    addStageByTag("aluminum", "#stoneopolis:aluminum");
    addStageByTag("iridium", "#stoneopolis:iridium");
    addStageByTag("platinum", "#stoneopolis:platinum");
    addStageByTag("silver", "#stoneopolis:silver");
    addStageByTag("uranium", "#stoneopolis:uranium");
    addStageByTag("zinc", "#stoneopolis:zinc");
    addStageByTag("osmium", "#stoneopolis:osmium");
    addStageByTag("nickel", "#stoneopolis:nickel");
    addStageByTag("prismarine", "#stoneopolis:prismarine");
    addStageByTag("amethyst", "#stoneopolis:amethyst");
    addStageByTag("coal", "#stoneopolis:coal");
    addStageByTag("concrete", "#stoneopolis:concrete");

    */

    //Stage Functions
    function addStageByMod(stage, modid) {
    event.forEachRecipe({ mod: modid }, recipe => {
            if (recipe.originalRecipe instanceof $CraftingRecipe) {
                recipe.stage(stage)
            }
        })
    }
    
    function addStageByTag(stage, tag) {
        event.forEachRecipe({ output: tag }, recipe => {
            if (recipe.originalRecipe instanceof $CraftingRecipe) {
                recipe.stage(stage)
            }
        })
    }

})

