/// Made by LiviiYS ///

// I'm using tech reborn items for a texturing reason, MI textures look too much like GregTech, and i don't want my pack to be a gregtech pack

events.listen("recipes", function (event) {

  // Ingots, nuggets, blocks

  ["silver", "tin", "lead", "bronze", "electrum", "steel", "tungsten", "nickel", "titanium", "platinum", "invar", "aluminum", "chrome", "iridium"].forEach(function (item, index) {
    event.replaceOutput({}, "modern_industrialization:" + item + "_ingot", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "modern_industrialization:" + item + "_nugget", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "modern_industrialization:" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_ingot", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_nugget", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  ["silver", "tin", "lead", "bronze", "electrum", "steel", "tungsten"].forEach(function (item, index) {
    event.replaceOutput({}, "indrev:" + item + "_ingot", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "indrev:" + item + "_nugget", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "indrev:" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_ingot", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_nugget", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  // Raw ores and raw ore blocks

  ["iridium", "lead", "silver", "tin", "tungsten"].forEach(function (item, index) {
    event.replaceOutput({}, "modern_industrialization:raw_" + item, "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "modern_industrialization:raw_" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:raw_" + item, "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:raw_" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  ["lead", "silver", "tin", "tungsten"].forEach(function (item, index) {
    event.replaceOutput({}, "indrev:raw_" + item, "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "indrev:raw_" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:raw_" + item + "_block", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  // Plates

  ["aluminum", "bronze", "chrome", "copper", "diamond", "electrum", "emerald", "gold", "invar", "iron", "lapis", "lead", "nickel", "platinum", "silicon", "silver", "steel", "tin", "titanium", "tungsten"].forEach(function (item, index) {
    event.replaceOutput({}, "modern_industrialization:" + item + "_plate", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_plate", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  ["bronze", "copper", "electrum", "gold", "iron", "lead", "silicon", "silver", "steel", "tin", "tungsten"].forEach(function (item, index) {
    event.replaceOutput({}, "indrev:" + item + "_plate", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_plate", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  // Dusts

  ["aluminum", "bauxite", "bronze", "chrome", "coal", "diamond", "electrum", "emerald", "invar", "nickel", "platinum", "ruby", "steel", "sulfur", "titanium"].forEach(function (item, index) {
    event.replaceOutput({}, "modern_industrialization:" + item + "_dust", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_dust", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  ["bronze", "coal", "diamond", "electrum", "steel", "sulfur"].forEach(function (item, index) {
    event.replaceOutput({}, "indrev:" + item + "_dust", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_dust", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  ["tungsten", "tin", "silver", "lead", "iron", "gold", "copper"].forEach(function (item, index) {
    event.replaceOutput({}, "modern_industrialization:" + item + "_dust", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
    event.replaceOutput({}, "techreborn:" + item + "_dust", "#c:" + "item" + "_ingots" + "_dust" + "_storage_block");
  });

  // Applied Energistics 2

  event.remove({ output: "appliedenergistics2:ender_dust" });
  event.replaceInput({}, "#c:ender_pearl_dusts", "techreborn:ender_pearl_dust");

  ["1151", "1152", "10754", "12738"].forEach(function (item, index) {
    event.remove({ id: "appliedenergistics2:facade_" + item });
  });

  
  // Resource Blocks

  event.remove({ output: "blockus:ender_block" });

  // Sleeping Bags

  ["white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "light_gray", "cyan", "purple", "green", "brown", "red", "black"].forEach(function (item, index) {
    event.remove({ output: "kibe:" + item + "_sleeping_bag" });
  });
  event.remove({ output: "kibe:sleeping_bag" });
});