// priority: 0

// Visit the wiki for more info - https://kubejs.com/

console.info('Hello, World! (Loaded server scripts)')


ServerEvents.recipes(event => {

  //Avaritia

  event.shaped('avaritia:compressed_crafting_table', ['CSC', 'SES', 'CSC'], {C:'minecraft:crafting_table', S: 'caveopolis:stone_crafting_table', E:'enderio:end_steel_ingot'}).id('avaritia:compressed_crafting_table')
  event.shaped('extendedcrafting:ultimate_table', ['CCC', 'CCC', 'CCC'], {C:'avaritia:double_compressed_crafting_table'}).id('extendedcrafting:ultimate_table')
  event.shaped('extendedcrafting:ultimate_auto_table', ['HHH', 'HCH', 'HHH'], {H: hopper, C:'extendedcrafting:ultimate_table'}).id('extendedcrafting:ultimate_auto_table')
  event.shaped('avaritia:star_fuel', [' C ', 'CSC', ' C '], {S:'minecraft:nether_star', C:Item.of('extendedcrafting:singularity', '{Id:"extendedcrafting:coal"}').strongNBT()}).id('desertopolis:star_fuel')
  event.shaped('avaritia:neutron_ingot', [' N ', 'NIN', ' N '], {N:'avaritia:neutron_nugget', I:iron_ingot}).id('avaritia:neutron_ingot')


  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "D": {
        "item": "strainers:diamond_mesh"
      },
      "E": {
        "item": "enderio:end_steel_bars"
      }
    },
    "pattern": [
      "         ",
      "         ",
      "  DEDED  ",
      "  EEEEE  ",
      "  DEEED  ",
      "  EEEEE  ",
      "  DEDED  ",
      "         ",
      "         "
    ],
    "result": {
      "item": "avaritia:diamond_lattice",
      "count": 8
    }
  }).id('avaritia:diamond_lattice')

  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "D": {
        "item": "avaritia:diamond_lattice"
      },
      "E": {
        "item": "enderio:end_steel_ingot"
      },
      "P": {
        "item": "enderio:vibrant_crystal"
      },
      "S": {
        "item": "enderio:pulsating_crystal"
      }
    },
    "pattern": [
      " EEEEEEE ",
      " DPPPPPD ",
      " SSSSSSS ",
      " DPPPPPD ",
      " EEEEEEE "
    ],
    "result": {
      "item": "avaritia:crystal_matrix_ingot",
      "count": 8
    }
  }).id('avaritia:crystal_matrix_ingot')

  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "Q": {
        "item": "refinedstorage:quartz_enriched_iron_block"
      },
      "E": {
        "item": "enderio:end_steel_ingot"
      },
      "A": {
        "item": "refinedstorage:advanced_processor"
      },
      "I": {
        "item": "refinedstorage:improved_processor"
      },
      "R": {
        "item": "minecraft:redstone_block"
      },
      "T": {
        "item": "opolisutilities:resource_generator_2"
      },
      "C": {
        "tag": "refinedstorage:crafter"
      },
      "M": {
        "item": "avaritia:crystal_matrix_ingot"
      }
    },
    "pattern": [
      "EEEEEEEEE",
      "EAQIMIQAE",
      "EQARTRAQE",
      "EIRCRCRIE",
      "EMTRCRTME",
      "EIRCRCRIE",
      "EQARTRAQE",
      "EAQIMIQAE",
      "EEEEEEEEE"
    ],
    "result": {
      "item": "avaritia:neutron_collector",
      "count": 4
    }
  }).id('avaritia:neutron_collector')

  event.shapeless('1x avaritia:neutron_collector', ["infinity:collector"])


  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "Q": {
        "item": "pneumaticcraft:compressed_iron_block"
      },
      "E": {
        "item": "enderio:end_steel_ingot"
      },
      "A": {
        "item": "refinedstorage:advanced_processor"
      },
      "I": {
        "item": "refinedstorage:improved_processor"
      },
      "R": {
        "item": 'avaritia:neutron_nugget'
      },
      "T": {
        "item": "pneumaticcraft:advanced_air_compressor"
      },
      "C": {
        "item": "enderio:impulse_hopper"
      },
      "M": {
        "item": "avaritia:crystal_matrix_ingot"
      },
      "N": {
        "item": "avaritia:neutron_pile"
      }
    },
    "pattern": [
      "EEEEEEEEE",
      "EAQIMIQAE",
      "EQANTNAQE",
      "EINCRCNIE",
      "EMTRCRTME",
      "EINCRCNIE",
      "EQANTNAQE",
      "EAQIMIQAE",
      "EEEEEEEEE"
    ],
    "result": {
      "item": 'extendedcrafting:compressor',
      "count": 1
    }
  }).id('extendedcrafting:compressor')

  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "R": {
        "item": 'avaritia:neutron_nugget'
      },
      "V": {
        "item": "enderio:vibrant_gear"
      },
      "D": {
        "item": "enderio:dark_bimetal_gear"
      },
      "E": {
        "item": "enderio:energized_gear"
      },
      "I": {
        "item": "enderio:iron_gear"
      },
      "F": {
        "item": "pneumaticcraft:compressed_iron_gear"
      },
      "W": {
        "item": "enderio:wood_gear"
      },
      "S": {
        "item": "enderio:stone_gear"
      }
    },
    "pattern": [
      "RRRVVVRRR",
      "RRVDEDVRR",
      "RVEIFIEVR",
      "VDISWSIDV",
      "VEFWWWFEV",
      "VDISWSIDV",
      "RVEIFIEVR",
      "RRVDEDVRR",
      "RRRVVVRRR"
    ],
    "result": {
      "item": 'avaritia:neutron_gear',
      "count": 9
    }
  }).id('avaritia:neutron_gear')

  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "M": {
        "item": 'avaritia:crystal_matrix_ingot'
      },
      "R": {
        "item": "avaritia:record_fragment"
      },
      "G": {
        "item": "avaritia:neutron_gear"
      },
      "F": {
        "item": "avaritia:star_fuel"
      },
      "1": Item.of('extendedcrafting:singularity', '{Id:"extendedcrafting:energetic_alloy"}').strongNBT().toJson(),
      "2": Item.of('extendedcrafting:singularity', '{Id:"extendedcrafting:pulsating_alloy"}').strongNBT().toJson(),
      "3": Item.of('extendedcrafting:singularity', '{Id:"extendedcrafting:conductive_alloy"}').strongNBT().toJson(),
      "4": Item.of('extendedcrafting:singularity', '{Id:"extendedcrafting:copper_alloy"}').strongNBT().toJson(),
      "C": {
        "item": "avaritia:neutron_pile"
      },
      "B": Item.of('strainers:netherite_mesh'),
      "S": {
        "item": "ae2:singularity"
      },
      "P": {
        "item": "avaritia:endest_pearl"
      },
      "E": {
        "tag": "desertopolis:rare_extreme_recator_part"
      }
    },
    "pattern": [
      "   EME   ",
      " MGRMRGM ",
      " GMF1FMG ",
      "ERCBSBCRE",
      "MM2SPS3MM",
      "ERCBSBCRE",
      " GMF4FMG ",
      " MGRMRGM ",
      "   EME   "
    ],
    "result": {
      "item": 'avaritia:infinity_catalyst',
      "count": 5
    }
  })

  event.custom({
    "type": "extendedcrafting:shaped_table",
    "pattern": [
      "AABBBBBAA",
      "ABBCDCBBA",
      "BBCCDCCBB",
      "BCCDEDCCB",
      "BDDEFEDDB",
      "BCCDEDCCB",
      "BBCCDCCBB",
      "ABBCDCBBA",
      "AABBBBBAA"
    ],
    "key": {
      "A": {
        "item": "enderio:end_steel_ingot"
      },
      "B": {
        "item": "minecraft:netherite_ingot"
      },
      "C": {
        "item": "minecraft:diamond"
      },
      "D": {
        "item": "opolisutilities:resource_generator_2"
      },
      "E": {
        "item": "avaritia:double_compressed_crafting_table"
      },
      "F": {
        "item": "extendedcrafting:ultimate_auto_table"
      }
    },
    "result": {
      "item": "opolisutilities:resource_generator"
    }
  }).id("opolisutilities:resource_generator/resource_generator")
  
  event.custom({
    "type": "extendedcrafting:shaped_table",
    "pattern": [
      "         ",
      "         ",
      "ABBBABBBA",
      "BBBCCCBBB",
      "ACDDDDDCA",
      "BBBCCCBBB",
      "ABBBABBBA",
      "         ",
      "         "
    ],
    "key": {
      "A": {
        "item": "avaritia:neutron_pile"
      },
      "B": {
        "item": "avaritia:neutron_nugget"
      },
      "C": {
        "item": "avaritia:crystal_matrix_ingot"
      },
      "D": {
        "item": "avaritia:infinity_catalyst"
      }
    },
    "result": {
      "item": 'avaritia:infinity_ingot',
      "count": 5
    }
  }).id('avaritia:infinity_ingot')

  event.remove({output:'avaritia:infinity_catalyst'})
 

})