// priority: 9
//Run this at a lower priority than cyclic_whitelist.js
/*


























 * Edit cyclic Recipes
 */
ServerEvents.recipes((event) => {


  //Change emerald armor
  event.remove([
    { output: "cyclic:emerald_chestplate" },
    { output: "cyclic:emerald_leggings" },
    { output: "cyclic:emerald_helmet" },
    { output: "cyclic:emerald_boots" },
    { output: "cyclic:emerald_pickaxe" },
    { output: "cyclic:emerald_axe" },
    { output: "cyclic:emerald_shovel" },
    { output: "cyclic:emerald_sword" },
    { output: "cyclic:emerald_hoe" }
  ]);
  event.shaped(
    Item.of('cyclic:emerald_chestplate', 1),[
      'EDE',
      'EEE',
      'EEE'
    ],
    {
      E: 'minecraft:emerald',
      D: 'minecraft:diamond_chestplate'
    });

  event.shaped(
    Item.of('cyclic:emerald_leggings', 1),[
      'EEE',
      'EDE',
      'E E'
    ],
    {
      E: 'minecraft:emerald',
      D: 'minecraft:diamond_leggings'
    });

  event.shaped(
    Item.of('cyclic:emerald_helmet', 1),[
      '   ',
      'EEE',
      'EDE'
    ],
    {
      E: 'minecraft:emerald',
      D: 'minecraft:diamond_helmet'
    });

  event.shaped(
    Item.of('cyclic:emerald_boots', 1),[
      '   ',
      'EDE',
      'E E'
    ],
    {
      E: 'minecraft:emerald',
      D: 'minecraft:diamond_boots'
    });

  event.shaped(
    Item.of('cyclic:emerald_pickaxe', 1),[
      'EEE',
      ' D ',
      ' S '
    ],
    {
      E: 'minecraft:emerald',
      S: 'minecraft:stick',
      D: 'minecraft:diamond_pickaxe'
    });

  event.shaped(
    Item.of('cyclic:emerald_axe', 1),[
      'EE ',
      'ED ',
      ' S '
    ],
    {
      E: 'minecraft:emerald',
      S: 'minecraft:stick',
      D: 'minecraft:diamond_axe'
    });

  event.shaped(
    Item.of('cyclic:emerald_shovel', 1),[
      ' E ',
      ' D ',
      ' S '
    ],
    {
      E: 'minecraft:emerald',
      S: 'minecraft:stick',
      D: 'minecraft:diamond_shovel'
    });

  event.shaped(
    Item.of('cyclic:emerald_sword', 1),[
      ' E ',
      ' E ',
      ' D '
    ],
    {
      E: 'minecraft:emerald',
      D: 'minecraft:diamond_sword'
    });

  event.shaped(
    Item.of('cyclic:emerald_hoe', 1),[
      'EE ',
      ' D ',
      ' S '
    ],
    {
      E: 'minecraft:emerald',
      S: 'minecraft:stick',
      D: 'minecraft:diamond_hoe'
    });


  /**
   * Replace recipes
   */
  event.remove([
    { output: "cyclic:glowing_helmet" },
    { output: "cyclic:anvil" },
    { output: "cyclic:apple_honey"},
    { output: "cyclic:eye_teleport" },
    { output: "cyclic:altar_destruction" },
    { output: "cyclic:battery"},
    { output: "cyclic:battery_clay"},
    { output: "cyclic:generator_solar"},
    { output: "cyclic:fire_killer"},
    { output: "cyclic:workbench"},
    { output: "cyclic:beacon" },
    { output: "cyclic:crafter"},
    { output: "cyclic:crate_mini"},
    { output: "cyclic:dark_glass"},
  ]);

  event.shaped(
    Item.of('cyclic:dark_glass', 5),[
      'TAT',
      'ATA',
      'TAT'
    ],
    {
      T: 'thermal:obsidian_glass',
      // A: 'minecraft:amethyst_shard',
      A: 'northstar:polished_amethyst',
    });


  event.recipes.create.mechanical_crafting('cyclic:eye_teleport', [
    'CCWCC',
    'CPPPC',
    'WPFPW',
    'CPPPC',
    'CCWCC'
  ], {
    P: 'minecraft:ender_eye',
    F: 'quark:ender_watcher',
    C: 'cyclic:gem_obsidian',
	  W: 'waystones:warp_stone',
  });

  /**
   * The apple is worth 20 HP, but given that it requires 8 gold apples of 5HP each, the recipe makes this item totally fair.
   */
  event.shaped(
    Item.of('cyclic:apple_honey', 1),[
      'GGG',
      'GAG',
      'GGG'
    ],
    {
      A: 'create:honeyed_apple',
      // H: 'minecraft:honey_block',
      G: 'minecraft:golden_apple',
    });

  event.shaped(
    Item.of('cyclic:glowing_helmet', 1),[
        'JDJ',
        'DOD',
        'JGJ'
    ],{
      D: 'minecraft:glowstone',
      O: 'cyclic:gem_amber',
      G: 'minecraft:gold_block',
      J: 'mowziesmobs:glowing_jelly',
    });

  // With end dimension requirement
  event.recipes.create.mechanical_crafting('cyclic:anvil', [
    'OOCOO',
    'DDTDD',
    ' TVT ',
    'GVTVG',
    'GGAGG'
  ], {
    D: 'minecraft:diamond_block',
    O: 'cyclic:gem_obsidian',
    A: 'minecraft:anvil',
    G: 'minecraft:quartz_block',
    T: 'thermal:upgrade_augment_3',
    V: 'cataclysm:witherite_ingot',
    C: 'cataclysm:void_stone'
  });


  event.shaped(
    Item.of('cyclic:altar_destruction', 1),[
      'GGG',
      'ONO',
      'OOO'
  ],{
    // C: 'minecraft:creeper_head',
    O: 'thermal:gunpowder_block',
    N: 'minecraft:nether_star',
    G: 'thermal:obsidian_glass',
    // G: 'minecraft:glass'
  });


  event.shaped(
    Item.of('cyclic:generator_solar', 2),[
        ' R ',
        'ICI',
        'LBL'
    ],{
      R: 'thermal:rf_coil',
      B: 'minecraft:redstone',
      I: 'minecraft:iron_ingot',
      L: 'minecraft:bone_block',
      // C: 'cyclic:compressed_cobblestone',
      C: 'thermal:iron_gear',
    });
    
  event.shaped(
    Item.of('cyclic:fire_killer', 1),[
        ' T ',
        'IRI',
        'IGI'
    ],{
      R: 'minecraft:crimson_hyphae',
      G: 'minecraft:red_dye',
      T: 'minecraft:tripwire_hook',
      I: 'minecraft:iron_ingot',
    });
  
  event.shaped(
    Item.of('cyclic:workbench', 1),[
        'CCC',
        'CWC',
        'CCC'
    ],{
      C: 'cyclic:compressed_cobblestone',
      W: 'minecraft:crafting_table',
    });

  event.shaped(
    Item.of('cyclic:crafter', 1),[
        'WPW',
        'WRW',
        'WCW'
    ],{
      C: 'cyclic:gem_obsidian',
      R: 'thermal:rf_coil',
      P: 'create:precision_mechanism',
      W: 'create:mechanical_crafter',
    });




      // event.shaped(
  //   Item.of('cyclic:crate_mini', 1),[
  //     'SCS',
  //     'CGC',
  //     'SCS'
  //   ],
  //   {
  //     C: 'minecraft:chest',
  //     G: 'minecraft:gunpowder',
  //     S: 'minecraft:stick',
  //   });

    // event.shaped(
  //   Item.of('cyclic:beacon', 1),[
  //     'GGG',
  //     'GBG',
  //     'DDD'
  // ],{
  //   D: 'minecraft:diamond_block',
  //   B: 'minecraft:beacon',
  //   G: 'thermal:enderium_glass'
  // });

  //Batteries
  // event.shaped(
  //   Item.of('cyclic:battery', 1),[
  //     'CRC',
  //     'C C',
  //     'CRC'
  // ],{
  //   R: 'thermal:rf_coil',
  //   C: 'thermal:energy_cell',
  // });

  // event.recipes.create.mechanical_crafting('thermal:energy_cell', [
  //   ' BBBBBB ',
  //   'BBBBBBBB',
  //   'BBBBBBBB',
  //   'BBBBBBBB',
  //   'BBBBBBBB',
  //   'BBBBBBBB',
  //   'BBBBBBBB',
  //   ' BBBBBB '
  // ], {
  //   B: 'cyclic:battery_clay'
  // });

  // event.shaped(
  //   Item.of('cyclic:battery_clay', 1),[
  //       'KCK',
  //       'IRI',
  //       'KCK'
  //   ],{
  //     R: 'thermal:rf_coil',
  //     K: 'thermal:cured_rubber',
  //     // B: 'minecraft:redstone',
  //     C: 'minecraft:clay_ball',
  //     I: 'minecraft:iron_ingot',
  //   });



/* ---------------- */
});