//Priority: 1000
/*
  ---╔═══╗------------╔═╗--╔═══╗--╔╗-------
  ---║╔═╗║------------║╔╝--║╔══╝-╔╝╚╗------
  ---║║ ║╠══╦══╗--╔══╦╝╚╗--║╚══╦═╩╗╔╬══╗---
  ---║╚═╝║╔╗║║═╣--║╔╗╠╗╔╝--║╔══╣╔╗║║║║═╣---
  ---║╔═╗║╚╝║║═╣--║╚╝║║║---║║--║╔╗║╚╣║═╣---
  ---╚╝ ╚╩═╗╠══╝--╚══╝╚╝---╚╝--╚╝╚╩═╩══╝---
  -------╔═╝║------------------------------
  -------╚══╝------------------------------
*/
/**

  ☻/  * @file Recipe Immersive Aircraft script
  /▌  * @copyright KnightDexx's Modded Minecraft World
  /\

*/
ServerEvents.recipes(event => {

   //======= Bluprint =======
   event.shaped('kubejs:blueprint', [' A ', 'ABA', ' A '], {
      A: '#forge:paper',
      B: '#forge:dyes/blue'
   }).id(`kubejs:immersive_aircraft/blueprint`)

   //======= Airship Bluprint =======
   event.shapeless('kubejs:airship_blueprint', [
      'kubejs:blueprint', '2x #minecraft:planks'
   ]).id(`kubejs:immersive_aircraft/airship_blueprint`)

   //======= Cargo Airship Blueprint =======
   event.shapeless('kubejs:cargo_blueprint', [
      'kubejs:blueprint', '2x #forge:chests/wooden'
   ]).id(`kubejs:immersive_aircraft/cargo_blueprint`)

   //======= Biplane Blueprint =======
   event.shapeless('kubejs:biplane_blueprint', [
      'kubejs:blueprint', '2x #forge:ingots/compressed_iron'
   ]).id(`kubejs:immersive_aircraft/biplane_blueprint`)

   //======= Gyrodyne Blueprint =======
   event.shapeless('kubejs:gyrodyne_blueprint', [
      'kubejs:blueprint', '#forge:ingots/compressed_iron', '#forge:ingots/copper'
   ]).id(`kubejs:immersive_aircraft/gyrodyne_blueprint`)

   //======= Quadrocopter Blueprint =======
   event.shapeless('kubejs:quadrocopter_blueprint', [
      'kubejs:blueprint', '2x minecraft:bamboo_block'
   ]).id(`kubejs:immersive_aircraft/quadrocopter_blueprint`)

   //======= Airship =======
   event.custom({
      type: "create:sequenced_assembly",
      ingredient: {
         item: "kubejs:airship_blueprint"
      },
      loops: 1,
      results: [{
         chance: 100,
         item: "immersive_aircraft:airship"
      }],
      sequence: [{
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:airship_blueprint"
            }, {
               item: "create:precision_mechanism"
            }],
            results: [{
               item: "kubejs:airship_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:airship_blueprint"
            }, {
               item: "immersive_aircraft:sail"
            }],
            results: [{
               item: "kubejs:airship_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:airship_blueprint"
            }, {
               item: "immersive_aircraft:sail"
            }],
            results: [{
               item: "kubejs:airship_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:airship_blueprint"
            }, {
               item: "immersive_aircraft:hull"
            }],
            results: [{
               item: "kubejs:airship_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:airship_blueprint"
            }, {
               item: "immersive_aircraft:engine"
            }],
            results: [{
               item: "kubejs:airship_blueprint"
            }]
         }
      ],
      transitionalItem: {
         item: "kubejs:airship_blueprint"
      }
   }).id(`kubejs:immersive_aircraft/airship`)

   //======= Cargo Airship =======
   event.custom({
      type: "create:sequenced_assembly",
      ingredient: {
         item: "kubejs:cargo_blueprint"
      },
      loops: 1,
      results: [{
         chance: 100,
         item: "immersive_aircraft:cargo_airship"
      }],
      sequence: [{
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:cargo_blueprint"
            }, {
               item: "create:precision_mechanism"
            }],
            results: [{
               item: "kubejs:cargo_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:cargo_blueprint"
            }, {
               item: "immersive_aircraft:airship"
            }],
            results: [{
               item: "kubejs:cargo_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:cargo_blueprint"
            }, {
               item: "immersiveengineering:crate"
            }],
            results: [{
               item: "kubejs:cargo_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:cargo_blueprint"
            }, {
               item: "immersive_aircraft:hull"
            }],
            results: [{
               item: "kubejs:cargo_blueprint"
            }]
         }
      ],
      transitionalItem: {
         item: "kubejs:cargo_blueprint"
      }
   }).id(`kubejs:immersive_aircraft/cargo_airship`)

   //======= Biplane =======
   event.custom({
      type: "create:sequenced_assembly",
      ingredient: {
         item: "kubejs:biplane_blueprint"
      },
      loops: 1,
      results: [{
         chance: 100,
         item: "immersive_aircraft:biplane"
      }],
      sequence: [{
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:biplane_blueprint"
            }, {
               item: "create:precision_mechanism"
            }],
            results: [{
               item: "kubejs:biplane_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:biplane_blueprint"
            }, {
               item: "immersive_aircraft:hull"
            }],
            results: [{
               item: "kubejs:biplane_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:biplane_blueprint"
            }, {
               item: "immersive_aircraft:hull"
            }],
            results: [{
               item: "kubejs:biplane_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:biplane_blueprint"
            }, {
               item: "immersive_aircraft:engine"
            }],
            results: [{
               item: "kubejs:biplane_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:biplane_blueprint"
            }, {
               item: "immersive_aircraft:propeller"
            }],
            results: [{
               item: "kubejs:biplane_blueprint"
            }]
         }
      ],
      transitionalItem: {
         item: "kubejs:biplane_blueprint"
      }
   }).id(`kubejs:immersive_aircraft/biplane`)

   //======= Gyrodyne =======
   event.custom({
      type: "create:sequenced_assembly",
      ingredient: {
         item: "kubejs:gyrodyne_blueprint"
      },
      loops: 1,
      results: [{
         chance: 100,
         item: "immersive_aircraft:gyrodyne"
      }],
      sequence: [{
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:gyrodyne_blueprint"
            }, {
               item: "create:precision_mechanism"
            }],
            results: [{
               item: "kubejs:gyrodyne_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:gyrodyne_blueprint"
            }, {
               item: "immersive_aircraft:sail"
            }],
            results: [{
               item: "kubejs:gyrodyne_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:gyrodyne_blueprint"
            }, {
               item: "immersive_aircraft:sail"
            }],
            results: [{
               item: "kubejs:gyrodyne_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:gyrodyne_blueprint"
            }, {
               item: "immersive_aircraft:hull"
            }],
            results: [{
               item: "kubejs:gyrodyne_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:gyrodyne_blueprint"
            }, {
               item: "immersive_aircraft:propeller"
            }],
            results: [{
               item: "kubejs:gyrodyne_blueprint"
            }]
         }
      ],
      transitionalItem: {
         item: "kubejs:gyrodyne_blueprint"
      }
   }).id(`kubejs:immersive_aircraft/gyrodyne`)

   //======= Quadrocopter =======
   event.custom({
      type: "create:sequenced_assembly",
      ingredient: {
         item: "kubejs:quadrocopter_blueprint"
      },
      loops: 1,
      results: [{
         chance: 100,
         item: "immersive_aircraft:quadrocopter"
      }],
      sequence: [{
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:quadrocopter_blueprint"
            }, {
               item: "immersive_aircraft:propeller"
            }],
            results: [{
               item: "kubejs:quadrocopter_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:quadrocopter_blueprint"
            }, {
               item: "immersive_aircraft:propeller"
            }],
            results: [{
               item: "kubejs:quadrocopter_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:quadrocopter_blueprint"
            }, {
               item: "immersive_aircraft:engine"
            }],
            results: [{
               item: "kubejs:quadrocopter_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:quadrocopter_blueprint"
            }, {
               item: "farmersdelight:basket"
            }],
            results: [{
               item: "kubejs:quadrocopter_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:quadrocopter_blueprint"
            }, {
               item: "immersive_aircraft:propeller"
            }],
            results: [{
               item: "kubejs:quadrocopter_blueprint"
            }]
         },
         {
            type: "create:deploying",
            ingredients: [{
               item: "kubejs:quadrocopter_blueprint"
            }, {
               item: "immersive_aircraft:propeller"
            }],
            results: [{
               item: "kubejs:quadrocopter_blueprint"
            }]
         }
      ],
      transitionalItem: {
         item: "kubejs:quadrocopter_blueprint"
      }
   }).id(`kubejs:immersive_aircraft/quadrocopter`)

   removeRecipeByID(event, [
      'immersive_aircraft:airship',
      'immersive_aircraft:cargo_airship',
      'immersive_aircraft:biplane',
      'immersive_aircraft:gyrodyne',
      'immersive_aircraft:quadrocopter'
   ])
})