// 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.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": "infinity:collector",
      "count": 4
    }
  }).id('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_ingot'
      },
      "T": {
        "item": "pneumaticcraft:advanced_air_compressor"
      },
      "C": {
        "item": "enderio:impulse_hopper"
      },
      "M": {
        "item": "avaritia:crystal_matrix_ingot"
      }
    },
    "pattern": [
      "EEEEEEEEE",
      "EAQIMIQAE",
      "EQARTRAQE",
      "EIRCRCRIE",
      "EMTRCRTME",
      "EIRCRCRIE",
      "EQARTRAQE",
      "EAQIMIQAE",
      "EEEEEEEEE"
    ],
    "result": {
      "item": 'extendedcrafting:compressor',
      "count": 1
    }
  }).id('extendedcrafting:compressor')

  event.custom({
    "type": "extendedcrafting:shaped_table",
    "key": {
      "R": {
        "item": 'avaritia:neutron_ingot'
      },
      "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": 1
    }
  }).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', '{Damage:0,RepairCost:1}').enchant('minecraft:unbreaking', 3).strongNBT().toJson(),
      "S": {
        "item": "ae2:quantum_entangled_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": 1
    }
  })

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

})