// Star Worm Goop: manual item application + Create deploying
// KubeJS 1.21.1 / NeoForge

ServerEvents.recipes(event => {
  const swBlocks = [
    'acacia_leaves', 'acacia_log', 'acacia_planks', 'acacia_wood', 'amethyst_block', 'andesite',
    'azalea_leaves', 'basalt', 'bedrock', 'birch_leaves', 'birch_log', 'birch_planks',
    'birch_wood', 'black_concrete', 'black_concrete_powder', 'black_glazed_terracotta', 'black_stained_glass', 'black_terracotta',
    'black_wool', 'blackstone', 'blue_concrete', 'blue_concrete_powder', 'blue_glazed_terracotta', 'blue_ice',
    'blue_stained_glass', 'blue_terracotta', 'blue_wool', 'bone_block', 'brain_coral_block', 'bricks',
    'brown_concrete', 'brown_concrete_powder', 'brown_glazed_terracotta', 'brown_mushroom_block', 'brown_stained_glass', 'brown_terracotta',
    'brown_wool', 'bubble_coral_block', 'calcite', 'chiseled_copper', 'chiseled_deepslate', 'chiseled_nether_bricks',
    'chiseled_polished_blackstone', 'chiseled_quartz_block', 'chiseled_red_sandstone', 'chiseled_sandstone', 'chiseled_stone_bricks', 'chiseled_tuff',
    'chiseled_tuff_bricks', 'clay', 'coal_block', 'coarse_dirt', 'cobbled_deepslate', 'cobblestone',
    'copper_block', 'cracked_deepslate_bricks', 'cracked_deepslate_tiles', 'cracked_nether_bricks', 'cracked_polished_blackstone_bricks', 'cracked_stone_bricks',
    'crimson_hyphae', 'crimson_nylium', 'crimson_planks', 'crimson_stem', 'crying_obsidian', 'cut_copper',
    'cut_red_sandstone', 'cut_sandstone', 'cyan_concrete', 'cyan_concrete_powder', 'cyan_glazed_terracotta', 'cyan_stained_glass',
    'cyan_terracotta', 'cyan_wool', 'dark_oak_leaves', 'dark_oak_log', 'dark_oak_planks', 'dark_oak_wood',
    'dark_prismarine', 'dead_brain_coral_block', 'dead_bubble_coral_block', 'dead_fire_coral_block', 'dead_horn_coral_block', 'dead_tube_coral_block',
    'deepslate', 'deepslate_bricks', 'deepslate_tiles', 'diamond_block', 'diorite', 'dirt',
    'dried_kelp_block', 'dripstone_block', 'emerald_block', 'end_stone', 'end_stone_bricks', 'exposed_chiseled_copper',
    'exposed_copper', 'exposed_cut_copper', 'fire_coral_block', 'flowering_azalea_leaves', 'gilded_blackstone', 'glass',
    'gold_block', 'granite', 'grass_block', 'gravel', 'gray_concrete', 'gray_concrete_powder',
    'gray_glazed_terracotta', 'gray_stained_glass', 'gray_terracotta', 'gray_wool', 'green_concrete', 'green_concrete_powder',
    'green_glazed_terracotta', 'green_stained_glass', 'green_terracotta', 'green_wool', 'honeycomb_block', 'horn_coral_block',
    'ice', 'iron_block', 'jungle_leaves', 'jungle_log', 'jungle_planks', 'jungle_wood',
    'lapis_block', 'light_blue_concrete', 'light_blue_concrete_powder', 'light_blue_glazed_terracotta', 'light_blue_stained_glass', 'light_blue_terracotta',
    'light_blue_wool', 'light_gray_concrete', 'light_gray_concrete_powder', 'light_gray_glazed_terracotta', 'light_gray_stained_glass', 'light_gray_terracotta',
    'light_gray_wool', 'lime_concrete', 'lime_concrete_powder', 'lime_glazed_terracotta', 'lime_stained_glass', 'lime_terracotta',
    'lime_wool', 'magenta_concrete', 'magenta_concrete_powder', 'magenta_glazed_terracotta', 'magenta_stained_glass', 'magenta_terracotta',
    'magenta_wool', 'moss_block', 'mossy_cobblestone', 'mossy_stone_bricks', 'nether_bricks', 'nether_wart_block',
    'netherite_block', 'netherrack', 'oak_leaves', 'oak_log', 'oak_planks', 'oak_wood',
    'obsidian', 'orange_concrete', 'orange_concrete_powder', 'orange_glazed_terracotta', 'orange_stained_glass', 'orange_terracotta',
    'orange_wool', 'oxidized_chiseled_copper', 'oxidized_copper', 'oxidized_cut_copper', 'packed_ice', 'pink_concrete',
    'pink_concrete_powder', 'pink_glazed_terracotta', 'pink_stained_glass', 'pink_terracotta', 'pink_wool', 'podzol',
    'polished_andesite', 'polished_basalt', 'polished_blackstone', 'polished_blackstone_bricks', 'polished_deepslate', 'polished_diorite',
    'polished_granite', 'polished_tuff', 'prismarine', 'prismarine_bricks', 'purple_concrete', 'purple_concrete_powder',
    'purple_glazed_terracotta', 'purple_stained_glass', 'purple_terracotta', 'purple_wool', 'purpur_block', 'purpur_pillar',
    'quartz_block', 'quartz_bricks', 'quartz_pillar', 'raw_copper_block', 'raw_gold_block', 'raw_iron_block',
    'red_concrete', 'red_concrete_powder', 'red_glazed_terracotta', 'red_mushroom_block', 'red_nether_bricks', 'red_sand',
    'red_sandstone', 'red_stained_glass', 'red_terracotta', 'red_wool', 'redstone_block', 'rooted_dirt',
    'sand', 'sandstone', 'smooth_basalt', 'smooth_quartz', 'smooth_red_sandstone', 'smooth_sandstone',
    'smooth_stone', 'snow_block', 'soul_sand', 'soul_soil', 'spruce_leaves', 'spruce_log',
    'spruce_planks', 'spruce_wood', 'stone', 'stone_bricks', 'stripped_acacia_log', 'stripped_acacia_wood',
    'stripped_birch_log', 'stripped_birch_wood', 'stripped_crimson_hyphae', 'stripped_crimson_stem', 'stripped_dark_oak_log', 'stripped_dark_oak_wood',
    'stripped_jungle_log', 'stripped_jungle_wood', 'stripped_oak_log', 'stripped_oak_wood', 'stripped_spruce_log', 'stripped_spruce_wood',
    'stripped_warped_hyphae', 'stripped_warped_stem', 'terracotta', 'tinted_glass', 'tube_coral_block', 'tuff',
    'tuff_bricks', 'warped_hyphae', 'warped_nylium', 'warped_planks', 'warped_stem', 'warped_wart_block',
    'waxed_chiseled_copper', 'waxed_copper_block', 'waxed_cut_copper', 'waxed_exposed_chiseled_copper', 'waxed_exposed_copper', 'waxed_exposed_cut_copper',
    'waxed_oxidized_chiseled_copper', 'waxed_oxidized_copper', 'waxed_oxidized_cut_copper', 'waxed_weathered_chiseled_copper', 'waxed_weathered_copper', 'waxed_weathered_cut_copper',
    'weathered_chiseled_copper', 'weathered_copper', 'weathered_cut_copper', 'white_concrete', 'white_concrete_powder', 'white_glazed_terracotta',
    'white_stained_glass', 'white_terracotta', 'white_wool', 'yellow_concrete', 'yellow_concrete_powder', 'yellow_glazed_terracotta',
    'yellow_stained_glass', 'yellow_terracotta', 'yellow_wool'
  ]

  swBlocks.forEach(blockName => {
    const normalBlock = `minecraft:${blockName}`
    const swBlock = `swlm:${blockName}`

    // Right-click the placed vanilla block with Star Worm Goop.
    event.custom({
      type: 'create:item_application',
      ingredients: [
        { item: normalBlock },
        { tag: 'swlm:star_worm_goop' }
      ],
      results: [
        { id: swBlock }
      ]
    }).id(`kubejs:star_worm/manual_${blockName}`)

    // Put the vanilla block on a belt/depot and deploy Star Worm Goop onto it.
    event.custom({
      type: 'create:deploying',
      ingredients: [
        { item: normalBlock },
        { tag: 'swlm:star_worm_goop' }
      ],
      results: [
        { id: swBlock }
      ]
    }).id(`kubejs:star_worm/deploying_${blockName}`)
  })
})