// priority: 10

ServerEvents.recipes(event => {

    //Luminessence

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 50000,
        input: {item: "minecraft:glowstone_dust"},
        ingredients: [
          {item: "stoneopolis:rainbow_color_core"},
          {item: "stoneopolis:rainbow_color_core"},
          {item: "minecraft:prismarine_shard"},
          {item: "minecraft:prismarine_shard"}
        ],
        result: {item: "extendedcrafting:luminessence"}
    }).id("extendedcrafting:luminessence")

    //Basic Component

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 25000,
        input: {item: "extendedcrafting:luminessence"},
        ingredients: [
          {item: "minecraft:iron_ingot"},
          {item: "minecraft:iron_ingot"},
          {item: "extendedcrafting:black_iron_ingot"},
          {item: "extendedcrafting:black_iron_ingot"}
        ],
        result: {item: "extendedcrafting:basic_component"}
    }).id("extendedcrafting:basic_component")

    //Ender Ingot

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 50000,
        input: {item: "minecraft:ender_pearl"},
        ingredients: [
          {item: "minecraft:iron_ingot"},
          {item: "minecraft:iron_ingot"},
          {item: "extendedcrafting:black_iron_ingot"},
          {item: "extendedcrafting:black_iron_ingot"}
        ],
        result: {item: "extendedcrafting:ender_ingot", count: 2}
    }).id("extendedcrafting:ender_ingot")

    //Advanced Component

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 50000,
        input: {item: "extendedcrafting:luminessence"},
        ingredients: [
          {item: "minecraft:gold_ingot"},
          {item: "minecraft:gold_ingot"},
          {item: "extendedcrafting:enhanced_ender_ingot"},
          {item: "extendedcrafting:enhanced_ender_ingot"}
        ],
        result: {item: "extendedcrafting:advanced_component"}
    }).id("extendedcrafting:advanced_component")

    //Elite Component

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 75000,
        input: {item: "extendedcrafting:luminessence"},
        ingredients: [
          {item: "extendedcrafting:crystaltine_ingot"},
          {item: "extendedcrafting:crystaltine_ingot"},
          {item: "extendedcrafting:enhanced_redstone_ingot"},
          {item: "extendedcrafting:enhanced_redstone_ingot"}
        ],
        result: {item: "extendedcrafting:elite_component"}
    }).id("extendedcrafting:elite_component")

    //Ultimate Component

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 75000,
        input: {item: "extendedcrafting:luminessence"},
        ingredients: [
          {item: "stoneopolis:stone_ingot"},
          {item: "stoneopolis:stone_ingot"},
          {item: "stoneopolis:emerald_ingot"},
          {item: "stoneopolis:emerald_ingot"}
        ],
        result: {item: "extendedcrafting:ultimate_component"}
    }).id("extendedcrafting:ultimate_component")

    //Crystaltine Ingot

    event.custom({
        type: "extendedcrafting:combination",
        powerCost: 50000,
        input: {item: "minecraft:diamond"},
        ingredients: [
          {item: "stoneopolis:rainbow_color_core"},
          {item: "stoneopolis:rainbow_color_core"},
          {item: "stoneopolis:rainbow_color_core"},
          {item: "stoneopolis:rainbow_color_core"}
        ],
        result: {item: "extendedcrafting:crystaltine_ingot"}
    }).id("extendedcrafting:crystaltine_ingot")

    //Stone Ingot
    
    event.custom({
        type: "extendedcrafting:compressor",
        powerCost: 100000,
        inputCount: 256,
        ingredient: {
          tag: "caveopolis:colored_stone"
        },
        catalyst: {
          item: "stoneopolis:rainbow_color_core"
        },
        result: {item: "stoneopolis:stone_ingot"}
    }).id('stoneopolis:stone_ingot')

    //Emerald Ingot
    
    event.custom({
        type: "extendedcrafting:compressor",
        powerCost: 100000,
        inputCount: 8,
        ingredient: {
          tag: "forge:gems/emerald"
        },
        catalyst: {
          item: "stoneopolis:rainbow_color_core"
        },
        result: {item: "stoneopolis:emerald_ingot"}
    }).id('stoneopolis:emerald_ingot')

    //Pure Color Core
    
    function pureColorRecipes (color, int) {
        event.custom({
            type: "extendedcrafting:compressor",
            powerCost: 100000,
            inputCount: 512,
            ingredient: {
            item: `caveopolis:${color}_colored_stone`
            },
            catalyst: {
            item: `industrialforegoing:laser_lens${int}`
            },
            result: {item: `stoneopolis:pure_${color}_color_core`}
        }).id(`stoneopolis:pure_${color}_color_core`)
    }

    pureColorRecipes("black", "15")
    pureColorRecipes("white", "0")
    pureColorRecipes("blue", "11")
    pureColorRecipes("light_blue", "3")
    pureColorRecipes("light_gray", "8")
    pureColorRecipes("gray", "7")
    pureColorRecipes("yellow", "4")
    pureColorRecipes("orange", "1")
    pureColorRecipes("brown", "12")
    pureColorRecipes("magenta", "2")
    pureColorRecipes("pink", "6")
    pureColorRecipes("purple", "10")
    pureColorRecipes("lime", "5")
    pureColorRecipes("green", "13")
    pureColorRecipes("cyan", "9")
    pureColorRecipes("red", "14")

    //Pure Rainbow Core

    event.custom({
      "type": "extendedcrafting:shaped_table",
      "pattern": [
        "    A    ",
        "   ABA   ",
        "   ACA   ",
        " AADEFAA ",
        "AGHIAJKLA",
        " AAMNOAA ",
        "   APA   ",
        "   AQA   ",
        "    A    "
      ],
      "key": {
        "A": {
          "item": "stoneopolis:rainbow_color_core"
        },
        "B": {
          "item": "stoneopolis:pure_purple_color_core"
        },
        "C": {
          "item": "stoneopolis:pure_pink_color_core"
        },
        "D": {
          "item": "stoneopolis:pure_white_color_core"
        },
        "E": {
          "item": "stoneopolis:pure_magenta_color_core"
        },
        "F": {
          "item": "stoneopolis:pure_green_color_core"
        },
        "G": {
          "item": "stoneopolis:pure_blue_color_core"
        },
        "H": {
          "item": "stoneopolis:pure_cyan_color_core"
        },
        "I": {
          "item": "stoneopolis:pure_light_blue_color_core"
        },
        "J": {
          "item": "stoneopolis:pure_black_color_core"
        },
        "K": {
          "item": "stoneopolis:pure_gray_color_core"
        },
        "L": {
          "item": "stoneopolis:pure_light_gray_color_core"
        },
        "M": {
          "item": "stoneopolis:pure_lime_color_core"
        },
        "N": {
          "item": "stoneopolis:pure_red_color_core"
        },
        "O": {
          "item": "stoneopolis:pure_brown_color_core"
        },
        "P": {
          "item": "stoneopolis:pure_orange_color_core"
        },
        "Q": {
          "item": "stoneopolis:pure_yellow_color_core"
        }
      },
      "result": {
        "item": "stoneopolis:pure_rainbow_color_core"
      }
    }).id('stoneopolis:pure_rainbow_color_core')

  //Ultimate Ingot
  
  event.custom({
    "type": "extendedcrafting:shaped_table",
    "pattern": [
      "ABCDEDCBA",
      "BFGHIJGFB",
      "KGLMNMLGK",
      "COMPQPMOC",
      "ERNQSQNRE",
      "COMPQPMOC",
      "KGLMNMLGK",
      "BFGHIJGFB",
      "ABCDEDCBA"
    ],
    "key": {
      "A": {
        "item": "minecraft:shulker_shell"
      },
      "B": {
        "item": "minecraft:dragon_breath"
      },
      "C": {
        "item": "minecraft:end_stone"
      },
      "D": {
        "item": "stoneopolis:void_ingot"
      },
      "E": {
        "item": "hostilenetworks:twilight_prediction"
      },
      "F": {
        "item": "immersiveengineering:coke"
      },
      "G": {
        "item": "immersiveengineering:treated_wood_horizontal"
      },
      "H": {
        "item": "extendedcrafting:flux_star"
      },
      "I": {
        "item": "minecraft:nether_star"
      },
      "J": {
        "item": "extendedcrafting:ender_star"
      },
      "K": {
        "item": "bloodmagic:ingot_hellforged"
      },
      "L": {
        "item": "bloodmagic:bloodstonebrick"
      },
      "M": {
        "type": "forge:nbt",
        "item": "extendedcrafting:singularity",
        "count": 1,
        "nbt": "{Id:\"extendedcrafting:stone\"}"
      },
      "N": {
        "item": "ae2:singularity"
      },
      "O": {
        "item": "stoneopolis:emerald_ingot"
      },
      "P": {
        "item": "infinity:infinity_generator"
      },
      "Q": {
        "item": "stoneopolis:pure_rainbow_color_core"
      },
      "R": {
        "item": "caveopolis:mixed_stone_ingot"
      },
      "S": {
        "item": "minecraft:dragon_egg"
      }
    },
    "result": {
      "item": 'extendedcrafting:the_ultimate_ingot'
    }
  })
  .id('stoneopolis:ultimate_ingot')


})
