
/**
 * 
 * 
 * 
 * 
 *
 * 
 * 
 * 
 * 
 * Create Northstar
 * 
 */
ServerEvents.recipes((event) => {

  //createdeco:industrial_iron_sheet
  var ironIngot = "createdeco:industrial_iron_ingot";
  var spaceIngot = "kubejs:titanium_ingot";
  var spaceSheet = "kubejs:titanium_sheet";

  event.recipes.create.compacting('kubejs:titanium_ingot', ['createdeco:industrial_iron_ingot', '#forge:sand']).superheated();
  event.recipes.create.compacting('kubejs:titanium_ingot', ['minecraft:iron_ingot', '#forge:sand']).superheated();
  event.recipes.create.compacting('kubejs:titanium_sheet', 'kubejs:titanium_ingot').superheated();
  // event.recipes.create.mixing('kubejs:heat_tile', ['kubejs:titanium_sheet', '#forge:sand']).superheated();

  event.remove([
    { output: "northstar:jet_engine" },
    { output: "northstar:rocket_controls" },
    { output: "northstar:circuit_engraver" },
    { output: "northstar:interplanetary_navigator" },
    { output: "northstar:oxygen_filler" },
    { output: "northstar:oxygen_generator" },
    { output: "northstar:oxygen_concentrator" },
    { output: "northstar:iron_plating" },
    { output: "northstar:iron_space_door" },
    { output: "northstar:iron_sheetmetal" },
    { output: "northstar:vent_block" },
    { output: "northstar:temperature_regulator" },
    { output: "northstar:rocket_station" },
  ]);

  event.shaped(Item.of("northstar:iron_plating", 1), [
    "II",
    "II"
  ], {
    "I": spaceIngot,
  });

  event.shaped(Item.of("northstar:iron_sheetmetal", 1), [
    "II",
    "II"
  ], {
    "I": spaceSheet,
  });

  event.shaped(Item.of("northstar:iron_space_door", 2), [
    "GG",
    "IC",
    "II"
  ], {
    "I": spaceIngot,
    "G": "#forge:glass",
    "C": "northstar:circuit",
  });

  event.recipes.create.mechanical_crafting('northstar:circuit_engraver', [
    "IQI",
    "SQS",
    "IQI",
    " C ",
  ], {
    "I": ironIngot,
    "S": "create:shaft",
    "Q": "create:polished_rose_quartz",
    "C": "northstar:amethyst_crystal",
  });

  event.recipes.create.mechanical_crafting('northstar:rocket_controls', [
    "L L",
    "iii",
    "iCi",
    "IPI",
  ], {
    "i": spaceIngot,
    "I": "create:industrial_iron_block",
    "C": "northstar:circuit",
    "L": "minecraft:lever",
    "P": "kubejs:steering_mechanism",
  });

  event.recipes.create.mechanical_crafting('northstar:interplanetary_navigator', [
    "iAi",
    "CAC",
    "iAi",
    "CAC",
    "iAi",
    "CPC",
  ],
    {
      "i": spaceIngot,
      "A": "northstar:polished_lunar_sapphire",
      "C": "northstar:circuit",
      "P": "northstar:targeting_computer",
    }
  );

  event.shaped(Item.of("northstar:oxygen_filler", 1), [
    "iCi",
    "iTi",
    "III"
  ],
    {
      "I": spaceIngot,
      "i": ironIngot,
      "C": "northstar:circuit",
      "T": "create:fluid_tank",
    }
  );

  event.shaped(Item.of("kubejs:oxygen_separator", 4), [
    " I ",
    " T ",
    " W "
  ],
    {
      "I": spaceIngot,
      "T": "create:encased_fan",
      "W": "#minecraft:wool",
    }
  );

  event.shaped(Item.of("kubejs:strong_fabric", 2), [
    "   ",
    "SWS",
    "   "
  ],
    {
      "W": "#minecraft:wool",
      "S": "minecraft:string",
    }
  );

  event.recipes.create.mechanical_crafting('northstar:oxygen_concentrator', [
    "W W",
    "W W",
    "iPi",
    "CTC",
    "iSi",
  ],
    {
      "i": ironIngot,
      "P": "kubejs:oxygen_separator",//Create:propellor
      "T": "create:fluid_tank",
      "W": "#minecraft:wool",
      "C": "northstar:circuit",
      "S": "create:shaft",
    }
  );

  event.recipes.create.mechanical_crafting('northstar:rocket_station', [
    " iii ",
    "iPCPi",
    "iwTwi",
    "iPCPi",
    "iiiii",
  ],
    {
      "i": spaceIngot,
      "P": "create:precision_mechanism",
      "C": "northstar:circuit",
      "T": "northstar:targeting_computer",
      "w": "northstar:iron_cogwheel",
    }
  );

  event.recipes.create.mechanical_crafting('northstar:temperature_regulator', [
    "BIb",
    "BIb",
    "isi",
    "aaa",
    "isi",
  ],
    {
      "I": spaceIngot,
      "i": spaceSheet,
      "B": "minecraft:blue_ice",
      "b": "minecraft:blaze_rod",
      "s": "create:shaft",
      "a": "northstar:advanced_circuit",
    }
  );

  event.recipes.create.mechanical_crafting('northstar:oxygen_generator', [
    "iFi",
    "iSi",
    "CTC",
    "iSi",
  ],
    {
      "i": ironIngot,
      "F": "kubejs:oxygen_separator",//create:encased_fan
      "T": "create:fluid_tank",
      "C": "northstar:circuit",
      "S": "create:shaft",
    }
  );

  event.shaped(Item.of("northstar:vent_block", 1), [
    "III",
    "I I",
    "III"
  ],
    {
      "I": ironIngot
    }
  );

  event.shaped(Item.of("northstar:jet_engine", 1), [
    "ITI",
    "ICI",
    "IPI"
  ],
    {
      "I": spaceIngot,
      "P": "create:propeller",
      "C": "tjetpacks:combustion_chamber", //Adds 6 nickel plates and a redstone servo to every engine
      "T": "create:fluid_pipe",//"T": "create:fluid_tank", //Easier (requires 4x less copper)
    }
  );

  event.shaped(Item.of("northstar:lunar_sapphire_crystal", 1), [
    " C ",
    "RCR",
    "ICI"
  ],
    {
      I: "minecraft:iron_ingot",
      R: "minecraft:redstone",
      C: "northstar:polished_lunar_sapphire",
    }
  );

  /**
   * Space suits
   */
  event.remove([
    { output: "northstar:martian_steel_space_suit_boots" },
    { output: "northstar:martian_steel_space_suit_chestpiece" },
    { output: "northstar:martian_steel_space_suit_helmet" },
    { output: "northstar:martian_steel_space_suit_leggings" },
    { output: "northstar:iron_space_suit_boots" },
    { output: "northstar:iron_space_suit_chestpiece" },
    { output: "northstar:iron_space_suit_helmet" },
    { output: "northstar:iron_space_suit_leggings" },
  ]);


  var fabricMaterial = "kubejs:strong_fabric";
  var ironSpaceSuitPlating = "#forge:plates/iron";

  //Iron
  event.shaped(Item.of("northstar:iron_space_suit_helmet", 1), [
    "III",
    "GTG",
    "GGG"
  ], {
    "I": ironSpaceSuitPlating,
    "G": "minecraft:tinted_glass",
    "T": "minecraft:iron_helmet",
  });

  event.shaped(Item.of("northstar:iron_space_suit_boots", 1), [
    "IWI",
    "WTW",
    "IWI"
  ], {
    "I": ironSpaceSuitPlating,
    "W": fabricMaterial,
    "T": "minecraft:iron_boots",
  });

  event.shaped(Item.of("northstar:iron_space_suit_leggings", 1), [
    "IWI",
    "WTW",
    "IWI"
  ], {
    "I": ironSpaceSuitPlating,
    "W": fabricMaterial,
    "T": "minecraft:iron_leggings",
  });

  event.shaped(Item.of("northstar:iron_space_suit_chestpiece", 1), [
    "IBI",
    "WTW",
    "IWI"
  ], {
    "I": ironSpaceSuitPlating,
    "W": fabricMaterial,
    "T": "minecraft:iron_chestplate",
    "B": "create:copper_backtank",
  });


  //Martian steel
  event.shaped(Item.of("northstar:martian_steel_space_suit_helmet", 1), [
    "III",
    "GTG",
    "GGG"
  ], {
    "I": "northstar:martian_steel_sheet",
    "G": "minecraft:tinted_glass",
    "T": "northstar:martian_steel_helmet",
  });

  event.shaped(Item.of("northstar:martian_steel_space_suit_boots", 1), [
    "IWI",
    "WTW",
    "IWI"
  ], {
    "I": "northstar:martian_steel_sheet",
    "W": fabricMaterial,
    "T": "northstar:martian_steel_boots",
  });

  event.shaped(Item.of("northstar:martian_steel_space_suit_leggings", 1), [
    "IWI",
    "WTW",
    "IWI"
  ], {
    "I": "northstar:martian_steel_sheet",
    "W": fabricMaterial,
    "T": "northstar:martian_steel_leggings",
  });

  event.shaped(Item.of("northstar:martian_steel_space_suit_chestpiece", 1), [
    "IBI",
    "WTW",
    "IWI"
  ], {
    "I": "northstar:martian_steel_sheet",
    "W": fabricMaterial,
    "T": "northstar:martian_steel_chestplate",
    "B": "create:copper_backtank", //was "create:copper_backtank"
  });

  /**
   * Create factory recipes
   */
  //Mars soil and gravel
  event.recipes.create.crushing([Item.of("northstar:mars_sand").withChance(0.75)], "northstar:mars_gravel").processingTime(500);
  event.recipes.create.crushing([Item.of("northstar:mars_gravel").withChance(0.75)], "northstar:mars_soil").processingTime(500);
  event.recipes.create.mixing('northstar:mars_soil', ['minecraft:soul_soil', 'minecraft:iron_ingot', 'minecraft:gold_nugget']).heated()

});