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

const flintBlockID = 'supplementaries:flint_block';

//Mods
const createDG = 'createdieselgenerators:';
const eureka = 'vs_eureka:';
const clockwork = 'vs_clockwork:'
const mowziesmobs = 'mowziesmobs:';

/**
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * Misc Recipe Changes
 */
ServerEvents.recipes((event) => {
  //Replacement
  event.remove([
    { output: "quark:gunpowder_sack" },
    { output: "minecraft:lodestone" },
    { output: "quark:pipe" },
    { output: "createaddition:electrum_amulet" },
    { output: "cyclic:shield_obsidian" },
    { output: "cyclic:shield_bone" },
    { output: "cyclic:snowflake" },
  ]);

  //Last recipe required 6
  //Create copper pipes yield 4 per 3 copper
  //We want to encourage the use of belts
  event.shaped(Item.of("quark:pipe", 1), [
    " C ",
    " B ",
    " C ",
  ],
    {
      C: "create:copper_sheet",
      B: "#forge:glass",
    }
  );

  //Add nametag recipe
  event.shaped(Item.of("minecraft:name_tag", 1), [
    "BCC",
    " BC",
    "A B"
  ],
    {
      A: "minecraft:writable_book",
      B: "minecraft:paper",
      C: "minecraft:string",
    }
  );

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

  event.shaped(Item.of("minecraft:lodestone", 1), [
    "CCC",
    "CBC",
    "CCC"
  ],
    {
      C: "minecraft:chiseled_stone_bricks",
      B: "minecraft:iron_ingot",
      //B: 'kubejs:black_gold_ingot',
    }
  );

  event.shaped(Item.of('cyclic:gem_prismarine', 1), [
    ' O ',
    'OSO',
    ' O ',
  ], {
    S: 'kubejs:abyssal_ingot',
    O: 'minecraft:prismarine_crystals',
  });

  // event.shaped(Item.of('cyclic:shield_bone', 1), [
  //   'OOO',
  //   'OSO',
  //   ' O ',
  // ], {
  //   S: 'cyclic:shield_leather',
  //   O: 'minecraft:bone_block',
  // });

  // event.recipes.create.mechanical_crafting('cyclic:shield_obsidian', [
  event.shaped(Item.of('cyclic:shield_obsidian', 1), [
    'OOO',
    'OSO',
    'OOO',
  ], {
    S: 'cyclic:shield_bone',
    O: 'create:sturdy_sheet',
  });

  //The snowflake is obtained from a boss
  event.shaped(Item.of('cyclic:snowflake', 2), [
    ' P ',
    'POP',
    ' P ',
  ], {
    P: 'minecraft:packed_ice',
    O: 'mowziesmobs:ice_crystal',
  });

  event.shaped(Item.of('cyclic:snowflake', 2), [
    'pPp',
    'POP',
    'pPp',
  ], {
    p: 'minecraft:packed_ice',
    P: 'northstar:polished_amethyst',
    O: 'cyclic:blue_snowflake',
  });

  //Mind as well
  event.shapeless(Item.of('minecraft:glowstone_dust', 12 * 6), [
    'mowziesmobs:glowing_jelly',
  ]);
});


/**
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * Waystones
 */
ServerEvents.recipes((event) => {
  //Replace recipes
  event.remove([
    { output: "waystones:warp_plate" },
    { output: "waystones:warp_stone" },
    { output: "waystones:warp_dust" },
    { output: "waystones:return_scroll" },
    { output: "waystones:bound_scroll" },
    { output: "waystones:warp_scroll" },
  ]);

  //1 netherite scrap makes 8 nethersteel ingots
  //Thats enough for 2 warp plates or 2 warp stones
  event.shaped(Item.of("kubejs:warp_core", 1), [
    "ADA",
    "DGD",
    "ADA",
  ],
    {
      // G: "minecraft:emerald",
      G: 'kubejs:ancient_pearl',
      D: "kubejs:void_ingot",
      A: 'kubejs:black_netherite_ingot',
      //A: 'minecraft:lodestone',
      //A: "northstar:polished_lunar_sapphire",
      //A: "northstar:martian_steel_sheet",
    });

  //By adding lunar amethyst, we
  //1) make a purpose for it
  //2) Prevent everything from being too easy too soon, We can spread out the progression even more
  event.recipes.create.mechanical_crafting("waystones:warp_stone", [
    " AAA ",
    "AEEEA",
    "AEWEA",
    "AEEEA",
    " AAA ",
  ],
    {
      W: 'kubejs:warp_core',
      A: "northstar:polished_lunar_sapphire",
      E: "minecraft:ender_pearl",
    });

  //We could make warp dust harder, since eye_teleport and warp plate are the only 2 that use it (warp plate and block both use 4 warp dust)
  event.shapeless(Item.of("waystones:warp_dust", 4), [
    "thermal:ender_pearl_dust",
    "northstar:polished_lunar_sapphire",
    "northstar:polished_lunar_sapphire",
    "northstar:polished_lunar_sapphire",
  ]);

  event.shaped(Item.of("waystones:return_scroll", 1), [
    "EEE",
    "GDG",
    "PPP"
  ],
    {
      P: "minecraft:paper",
      D: "waystones:warp_dust",
      E: "kubejs:cursium_pearl",
      G: "create_enchantment_industry:hyper_experience_bottle",
    }
  );

  event.shaped(Item.of("waystones:bound_scroll", 1), [
    "PBP",
    "BXB",
    "PBP"
  ],
    {
      X: "waystones:return_scroll",
      B: "minecraft:blaze_rod",
      P: "minecraft:paper",
    }
  );

  event.shaped(Item.of("waystones:warp_scroll", 1), [
    "PBP",
    "BXB",
    "PBP"
  ],
    {
      X: "waystones:bound_scroll",
      B: "minecraft:compass",
      P: "minecraft:paper",
    }
  );

  //Warp plate comes with 4 free warp dust and 1 flint (that is why it is in the original recipe)
  //This should be hard to engourage other means of travel for short distances
  //If we really wanted to make this hard, we should add a nether star
  event.recipes.create.mechanical_crafting('waystones:warp_plate', [
    'OOOOO',
    'DDKDD',
    'ONRNO',
    'FFWFF',
  ],
    {
      D: 'waystones:warp_dust',
      O: 'northstar:martian_steel_sheet',
      K: "minecraft:flint",
      // R: 'create_enchantment_industry:hyper_experience_bottle',
      R: 'minecraft:nether_star',
      N: 'thermal:netherite_plate',
      W: 'kubejs:warp_core',
      F: 'minecraft:obsidian',
    });
});



/**
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * 
 * Thermal Recipe Changes
 */
ServerEvents.recipes((event) => {
  event.remove([
    { output: "thermal:flux_drill" },
    { output: "thermal:flux_saw" },
    { output: "thermal:machine_pulverizer" },
    { output: "thermal:area_radius_augment" },
    { output: "thermal:drill_head" },
    { output: "thermal:flux_capacitor" },
    { output: "thermal:hazmat_fabric" },
    { output: "thermal:diving_fabric" },

    { output: "thermal:diving_helmet" },

    { output: "thermal:hazmat_helmet" },
    { output: "thermal:hazmat_chestplate" },
    { output: "thermal:hazmat_leggings" },
    { output: "thermal:hazmat_boots" },
  ]);

  event.recipes.create.deploying('kubejs:steel_string', ['minecraft:string', 'createbigcannons:cast_iron_nugget']);

  //Hazmat suit grants fire and lava protection but has less durability
  event.shaped(Item.of('thermal:hazmat_fabric', 1), [
    'SRS',
    'MRM',
    'SRS',
  ], {
    R: 'thermal:cured_rubber',
    S: "kubejs:steel_string", //TODO Add Iron String
    M: "minecraft:magma_cream",
    // M: "northstar:tungsten_nugget",
  });

  event.shaped(Item.of('thermal:diving_fabric', 1), [
    'S S',
    'SRS',
    'S S',
  ], {
    R: 'minecraft:prismarine_crystals',
    S: "minecraft:string",
  });

  /**
   * To prevent the hazmat suit from eclipsing the phoenix armor, the hazmat suit requires tungsten
   * The hazmat suit has very low durability, so that is going to be a factor that would help with the balance
   * The hazmat suit also protects against harmful potions, increases air supply and reduces fall damage
   * If because of the low durability, I decide to make this easier to obtain, do so by reducing/removing magma cream
   */
  event.shaped(Item.of('thermal:hazmat_helmet', 1), [
    '   ',
    'FIF',
    'IGI',
  ], {
    F: 'thermal:hazmat_fabric',
    I: "northstar:tungsten_ingot",
    G: "#forge:glass",
  });

  event.shaped(Item.of('thermal:hazmat_chestplate', 1), [
    'F F',
    'IFI',
    'FFF',
  ], {
    F: 'thermal:hazmat_fabric',
    I: "northstar:tungsten_ingot",
  });

  event.shaped(Item.of('thermal:hazmat_leggings', 1), [
    'FFF',
    'I I',
    'F F',
  ], {
    F: 'thermal:hazmat_fabric',
    I: "northstar:tungsten_ingot",
  });

  event.shaped(Item.of('thermal:hazmat_boots', 1), [
    'F F',
    'IRI',
  ], {
    F: 'thermal:hazmat_fabric',
    I: "northstar:tungsten_ingot",
    // R: "thermal:cured_rubber",
    R: "minecraft:leather",
  });

  /**
   * The diving helmet doesnt run out of durability nor does the player die as long as they are wearing it
   * Lets prevent this from eclipsing create helmet and backtank
   * The aether iron bubble provides infinite water breathing, and doesnt run out of durability, it can be obtained in a gold dungeon
   */
  event.shaped(Item.of('thermal:diving_helmet', 1), [
    'FGF',
    'GIG',
    'TBT'
  ], {
    F: 'thermal:diving_fabric',
    G: 'minecraft:gold_ingot',
    // I: "minecraft:conduit",
    I: "#forge:glass",
    B: "aether:iron_bubble",
    T: "minecraft:iron_ingot",
  });
  //The diving helmet does a damage hit but you cant die because it regenerates, so I think it might also be fare to add an alternative tungsten recipe
  event.shaped(Item.of('thermal:diving_helmet', 1), [
    'FGF',
    'GIG',
    'TBT'
  ], {
    F: 'thermal:diving_fabric',
    G: 'minecraft:gold_ingot',
    // I: "minecraft:conduit",
    B: "minecraft:heart_of_the_sea",
    I: "#forge:glass",
    T: "northstar:tungsten_ingot",
  });

  //Dont make this too hard, but radial enhanncment is pretty good for any item
  //Allows increased radius
  event.shaped(Item.of('thermal:area_radius_augment', 1), [
    'GrG',
    'PtP',
    'GrG',
  ], {
    // t: 'thermal:tin_ingot',
    t: 'thermal:silver_gear',
    r: 'thermal:redstone_servo',
    G: 'thermal:gold_gear',
    P: 'kubejs:precision_component',
  });


  //The pulverizer allows a chance to get additional stuff (sometimes ore doubling), if using a catalyst
  //Pulverizer affectively increases diamond yield to about 1.5x (50% chance of additional diamond)
  event.shaped(Item.of('thermal:machine_pulverizer', 1), [
    ' b ',
    'sfs',
    'iri',
  ], {
    b: 'minecraft:blast_furnace',
    r: 'thermal:rf_coil',
    f: 'thermal:machine_frame',
    s: flintBlockID,
    // i: 'thermal:copper_gear',
    //Changed copper to signalum
    i: 'thermal:signalum_gear',
  });

  //This is only used for the drill, so it makes sense to add diamond
  event.recipes.create.mechanical_crafting('thermal:drill_head', [
    ' D ',
    'DDD',
    'iii',
    'ici'
  ], {
    c: 'minecraft:copper_ingot',
    i: 'minecraft:iron_ingot',
    D: '#forge:dusts/diamond',
  });


  // Since this is like an unbreakable pick, it needs some diamonds, we will put most on the drill head
  // It has infinite durability and can be upgraded with radial enhancment to mine 3x3, 5x5 or 7x7 blocks
  // These recipes roughly require 1 diamond chestplate, 1 netherite ingot, silver, presicion mechanism and rubber
  event.recipes.create.mechanical_crafting('thermal:flux_drill', [
    ' d ',
    'GWG',
    'trt',
    'NNN',
    //
    'EPE',
    'RER',
  ], {
    d: 'thermal:drill_head',
    r: 'thermal:rf_coil',
    N: 'thermal:netherite_plate',
    // W: 'kubejs:black_netherite_ingot',
    W: 'cataclysm:witherite_ingot',
    t: 'thermal:silver_gear',
    G: 'northstar:tungsten_sheet',
    E: 'thermal:enderium_gear',
    P: 'kubejs:precision_machine',
    R: 'thermal:cured_rubber',
  });

  event.recipes.create.mechanical_crafting('thermal:flux_saw', [
    ' d ',
    'ggg',
    'trt',
    'GGG',
    //
    'PPP',
    'RER',
  ], {
    d: 'thermal:saw_blade',
    r: 'thermal:rf_coil',
    G: 'thermal:netherite_plate',
    // W: 'kubejs:black_netherite_ingot',
    // W: 'minecraft:netherite_axe',
    t: 'thermal:silver_gear',
    g: 'create:sturdy_sheet',

    // i: '#forge:plates/iron',

    E: 'thermal:enderium_gear',
    P: 'create:precision_mechanism',
    R: 'thermal:cured_rubber',
  });

  //Thermal battery has 4 lead ingots, 1 electrum gear and 4 cured rubber
  //The original capacitor had 3 lead ingots, 3 redstone, 1 rf coil
  //Can recharge all items in inventory
  event.recipes.create.mechanical_crafting('thermal:flux_capacitor', [
    'aEa',
    'RrR',
    'lal',
    'lal'
  ], {
    r: 'thermal:rf_coil',
    l: 'thermal:lead_ingot',
    a: 'minecraft:redstone',
    //added
    R: 'thermal:cured_rubber',
    E: 'thermal:electrum_gear',
  });

});

/**
 * 
 * 
 * 
 * Aether recipes
 */
ServerEvents.recipes((event) => {
  event.remove([
    { output: "aether:altar" },
  ]);

  //The Altar allows items to be recharged using ambrosium shards
  //https://aether.fandom.com/wiki/Zanite_Gemstone
  //Zanite is the second most common ore in The Aether. 
  //https://aether.fandom.com/wiki/Ambrosium_Shard
  //Holystone Tools when being used have a chance to cause whatever they are being used on to drop an Ambrosium Shard.
  //The altar smelts gravitite into enchanted gravitite (block)
  event.shaped(Item.of('aether:altar', 1), [
    'ZZZ',
    'ZZZ',
    'HHH',
  ], {
    Z: 'aether:zanite_block',
    // z: 'aether:zanite_gemstone',
    H: 'aether:holystone'
  });
});


/**
 * 
 * 
 * 
 * Create Power Loader recipes
 * In order to prevent lag, these recipes must be very hard
 */
ServerEvents.recipes((event) => {
  event.remove([
    { output: "create_power_loader:empty_andesite_chunk_loader" },
    { output: "create_power_loader:empty_brass_chunk_loader" },
  ]);

  //The andesite chunkloader only loads the current chunk
  //it requires 1 netherite gear and way more precision mechanisms
  event.recipes.create.mechanical_crafting('create_power_loader:empty_andesite_chunk_loader', [
    'GGGGG',
    'G   G',
    'GVXVG',
    'AVSVA',
    'AASAA'
  ], {
    G: '#forge:glass',
    S: 'create:shaft',
    A: 'create:andesite_casing',
    X: 'minecraft:respawn_anchor',
    // n: 'thermal:steel_gear',
    V: 'kubejs:abyssal_ingot',
  });

  //The brass chunkloader works in a  1x1, 3x3 or 5x5 pattern
  //It reqires 3x as much netherite gear
  event.recipes.create.mechanical_crafting('create_power_loader:empty_brass_chunk_loader', [
    'GGGGG',
    'GNNNG',
    'GVXVG',
    'AVSVA',
    'AASAA'
  ], {
    // G: '#forge:glass',
    G: 'thermal:enderium_glass',
    S: 'create:shaft',
    A: 'create:brass_casing',
    // P: 'kubejs:precision_machine',
    X: 'minecraft:respawn_anchor',
    N: 'thermal:netherite_gear',
    // n: 'thermal:steel_gear',
    V: 'kubejs:abyssal_ingot',
  });

});




/**
 * 
 * 
 * 
 * 
 *
 * 
 * 
 * 
 * 
 * Clockwork / vs_eureka
 * 
 */
ServerEvents.recipes((event) => {

  event.remove([
    { output: "create_enchantment_industry:printer" }
  ]);

  event.shaped(Item.of("create_enchantment_industry:printer", 1), [
    " C ",
    "BGB",
    "III"
  ],
    {
      C: "create:copper_casing",
      B: "minecraft:dried_kelp",
      I: "#forge:plates/iron",
      G: "aether:enchanted_gravitite"
    });

});

/**
 * 
 * 
 * 
 * 
 *
 * 
 * 
 * 
 * 
 * Clockwork / vs_eureka
 * 
 */
ServerEvents.recipes((event) => {

  event.remove([
    { output: "vs_eureka:engine" },
    { output: "vs_eureka:oak_ship_helm" },
    { output: "vs_eureka:birch_ship_helm" },
    { output: "vs_eureka:spruce_ship_helm" },
    { output: "vs_eureka:acacia_ship_helm" },
    { output: "vs_eureka:dark_oak_ship_helm" },
    { output: "vs_eureka:jungle_ship_helm" },
    { output: "vs_eureka:crimson_ship_helm" },
    { output: "vs_eureka:warped_ship_helm" },
  ]);

  event.shaped(Item.of("vs_eureka:engine", 1), [
    "SSS",
    "IBp",
    "PGP"
  ],
    {
      G: "create:brass_block",
      I: "thermal:iron_gear",
      // S: "minecraft:smooth_stone",
      S: "minecraft:iron_block",
      p: "minecraft:glass_pane",
      B: "minecraft:blast_furnace",
      // P: "createdieselgenerators:engine_piston",
      P: "kubejs:brass_piston",
    }
  );


  //Ship helms
  let helm_layout = [
    'FBF',
    'BWB',
    'FOF',
    'ZSZ',
  ];

  function helm_key(woodType) {
    return {
      B: 'create:brass_ingot',
      W: 'kubejs:wanderlite_ingot',
      O: 'minecraft:' + woodType + '_planks',
      S: 'kubejs:steering_mechanism',
      F: 'minecraft:' + woodType + '_fence',
      Z: 'create:brass_block',
    }
  }

  event.recipes.create.mechanical_crafting('vs_eureka:oak_ship_helm', helm_layout, helm_key("oak"));
  event.recipes.create.mechanical_crafting('vs_eureka:birch_ship_helm', helm_layout, helm_key("birch"));
  event.recipes.create.mechanical_crafting('vs_eureka:spruce_ship_helm', helm_layout, helm_key("spruce"));
  event.recipes.create.mechanical_crafting('vs_eureka:acacia_ship_helm', helm_layout, helm_key("acacia"));
  event.recipes.create.mechanical_crafting('vs_eureka:dark_oak_ship_helm', helm_layout, helm_key("dark_oak"));
  event.recipes.create.mechanical_crafting('vs_eureka:jungle_ship_helm', helm_layout, helm_key("jungle"));
  event.recipes.create.mechanical_crafting('vs_eureka:crimson_ship_helm', helm_layout, helm_key("crimson"));
  event.recipes.create.mechanical_crafting('vs_eureka:warped_ship_helm', helm_layout, helm_key("warped"));

});






/**
 * 
 * 
 * 
 * 
 *
 * 
 * 
 * 
 * 
 * Redstone Pen
 * 
 */
ServerEvents.recipes((event) => {

  event.remove([
    { output: "redstonepen:pen" },
    { output: "redstonepen:quill" },
    { output: "redstonepen:control_box" },
    { output: "redstonepen:relay" },
    { output: "redstonepen:basic_pulse_button" },
  ]);

  event.recipes.create.mechanical_crafting('redstonepen:control_box', [
    // event.shaped(Item.of("redstonepen:control_box", 1), [
    "QRQ",
    "EsL",
    "QGQ",
    "PPP",
  ],
    {
      //sides
      "R": "minecraft:redstone",
      "L": "minecraft:lapis_lazuli",
      "G": "minecraft:gold_ingot",
      "E": "minecraft:emerald",
      //material
      // "P": "kubejs:precision_machine",
      "P": "create:precision_mechanism",
      "Q": "create:brass_ingot",

      // "s": "thermal:enderium_gear",
      // "s": "thermal:signalum_gear",
      // "s": "northstar:circuit",
      "s": "northstar:advanced_circuit",
    }
  );

  event.shapeless(Item.of("redstonepen:basic_pulse_button", 1), [
    "#minecraft:wooden_buttons",
    "create:brass_ingot",
  ]);

  event.shaped(Item.of("redstonepen:relay", 1), [
    "TCT",
    "CDC",
    "III"
  ],
    {
      "C": "minecraft:smooth_stone",
      "T": "minecraft:redstone_torch",
      "D": "minecraft:redstone",
      "I": "create:brass_ingot",
    }
  );

});










/**
 * 
 * 
 * 
 * 
 *
 * 
 * 
 * 
 * 
 * Add custom item and block recipes
 * 
 */
ServerEvents.recipes((event) => {



  /**
   * 
   * 
   * Kubejs Wanderlite ingot
   */
  event.recipes.create.crushing([
    "kubejs:wanderlite_dust",
    // Item.of("kubejs:wanderlite_dust").withChance(0.1)
  ], "vs_clockwork:wanderlite_matrix").processingTime(500);

  event.recipes.create.crushing([
    Item.of("kubejs:wanderlite_dust").withChance(0.5)
  ], "vs_clockwork:wanderlite_crystal").processingTime(300);

  event.recipes.create.crushing([
    Item.of("kubejs:wanderlite_dust")
  ], "kubejs:wanderlite_ingot").processingTime(700);


  event.recipes.create.mixing(
    ['kubejs:wanderlite_ingot', 'kubejs:wanderlite_ingot'],
    [
      "kubejs:wanderlite_dust",

      //1 enderium ingot requires 0.5 diamonds, 1 ender pearls, 1.5 lead
      "thermal:enderium_ingot", "thermal:enderium_ingot",
      "thermal:enderium_ingot", "thermal:enderium_ingot",
      "thermal:enderium_ingot", "thermal:enderium_ingot",
      "thermal:enderium_ingot", "thermal:enderium_ingot",
      "thermal:enderium_ingot", "thermal:enderium_ingot",

      "create:powdered_obsidian", "create:powdered_obsidian",
      "create:powdered_obsidian", "create:powdered_obsidian",
      "create:powdered_obsidian", "create:powdered_obsidian",
      "create:powdered_obsidian", "create:powdered_obsidian",

      "create:rose_quartz", "create:rose_quartz",
      "create:rose_quartz", "create:rose_quartz",
      "create:rose_quartz", "create:rose_quartz",
      "create:rose_quartz", "create:rose_quartz",
    ]).superheated();


  /**
   * 
   * 
   * Create components
   */
  event.shaped(Item.of("kubejs:brass_piston", 1), [
    "  G",
    " I ",
    "P  "
  ], {
    //top
    G: "kubejs:brass_gear",
    // G: "create:brass_ingot",
    //end
    P: "create:brass_nugget",
    //rod
    // I: "createaddition:iron_rod",
    I: "createaddition:brass_rod",
  });

  event.shaped(Item.of("kubejs:brass_gear", 1), [
    " P ",
    "PIP",
    " P "
  ], {
    P: "create:brass_ingot",
    I: "minecraft:iron_nugget",
  });

  event.shaped(Item.of("kubejs:precision_component", 1),
    ["PPP", "PPP", "PPP"], {
    P: "create:precision_mechanism",
  });

  event.shaped(Item.of("kubejs:precision_machine", 1),
    ["PPP", "PPP", "PPP"], {
    P: "kubejs:precision_component",
  });


  event.shaped(Item.of("create:precision_mechanism", 9), ["kubejs:precision_component"]);
  event.shaped(Item.of("kubejs:precision_component", 9), ["kubejs:precision_machine"]);


  //Dirt
  event.shaped(Item.of("kubejs:phantom_dirt", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:dirt",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //Stone
  event.shaped(Item.of("kubejs:phantom_stone", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:stone",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //netherrack
  event.shaped(Item.of("kubejs:phantom_netherrack", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:netherrack",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //snow
  event.shaped(Item.of("kubejs:phantom_snow", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:snow_block",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //sandstone
  event.shaped(Item.of("kubejs:phantom_sandstone", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:sandstone",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //red sandstone
  event.shaped(Item.of("kubejs:phantom_red_sandstone", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:red_sandstone",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //cobblestone
  event.shaped(Item.of("kubejs:phantom_cobblestone", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:cobblestone",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //stone bricks
  event.shaped(Item.of("kubejs:phantom_stone_bricks", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:stone_bricks",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });

  //end stone
  event.shaped(Item.of("kubejs:phantom_end_stone", 12), ["BSB", "BFB", "BSB"], {
    B: "minecraft:end_stone",
    F: "minecraft:phantom_membrane",
    S: "minecraft:string",
  });


  //Steering mechanism
  let incomplete = 'kubejs:incomplete_steering_mechanism';
  // let incomplete = 'create:incomplete_precision_mechanism';

  event.recipes.create.sequenced_assembly([
    Item.of('kubejs:steering_mechanism').withChance(125.0), // this is the item that will appear in JEI as the result
    Item.of('create:brass_sheet').withChance(8.0), // the rest of these items will be part of the scrap
    Item.of('create:andesite_alloy').withChance(15.0),
    Item.of('create:cogwheel').withChance(5.0),
    Item.of('create:shaft').withChance(2.0),
    Item.of('create:crushed_gold_ore').withChance(2.0),
    Item.of('2x minecraft:gold_nugget').withChance(2.0),
    'minecraft:iron_ingot',

    //create:brass_sheet
  ], 'northstar:circuit', [ // the input #forge:plates/iron
    // the transitional item set by `transitionalItem('create:incomplete_large_cogwheel')` is the item used during the intermediate stages of the assembly
    // like a normal recipe function, is used as a sequence step in this array. Input and output have the transitional item
    event.recipes.createDeploying(incomplete, [incomplete, 'create:golden_sheet']),
    event.recipes.createPressing(incomplete, incomplete),
    event.recipes.createDeploying(incomplete, [incomplete, 'create:large_cogwheel']),
    event.recipes.createDeploying(incomplete, [incomplete, 'create:cogwheel']),
    // event.recipes.createDeploying(incomplete, [incomplete, 'minecraft:iron_nugget']),
    // event.recipes.createCutting(incomplete, incomplete), 
    event.recipes.createDeploying(incomplete, [incomplete, 'create:precision_mechanism'])

  ]).transitionalItem(incomplete).loops(20) // set the transitional item and the number of loops



});