// priority: 0

// Visit the wiki for more info - https://kubejs.com/

console.info('Executing KubeJS Recipe Scripts...')

ServerEvents.recipes(event => {
  event.recipes.create.compacting('minecraft:tuff', ['minecraft:andesite', 'minecraft:diorite', 'minecraft:cobblestone', 'minecraft:granite'])
  event.recipes.create.haunting('minecraft:redstone', 'minecraft:glowstone_dust')
  event.recipes.create.crushing('minecraft:glowstone_dust', 'minecraft:torch')
  //event.recipes.create.mixing('jaffactory:jaffa_base', ['create:dough', 'minecraft:sugar', 'minecraft:egg']).heated()
  //event.recipes.create.mixing('createaddition:biomass', ['jaffactory:orange_sapling', Fluid.of('createaddition:seed_oil', 100)]).heated()
	event.recipes.create.filling('jaffactory:jaffa_cake', ['jaffactory:jaffa_slime_base', Fluid.of('create:chocolate', 250)])
	event.recipes.create.deploying('create:andesite_casing', ['jaffactory:stripped_orange_log', 'create:andesite_alloy'])
	event.recipes.create.deploying('create:brass_casing', ['jaffactory:stripped_orange_log', 'create:brass_ingot'])
	event.recipes.create.deploying('create:copper_casing', ['jaffactory:stripped_orange_log', 'minecraft:copper_ingot'])
	event.shaped(
  	Item.of('minecraft:chest'), // arg 1: output
	  [ 
    	'AAA', 
	    'A A', // arg 2: the shape (array of strings)
    	'AAA'  
	  ],
  	{
	    A: 'jaffactory:orange_planks_block'
  	}
	)

  event.shaped(
    Item.of('ae2:facade'), // arg 1: output
    [ 
      ' A ', 
      'ABA', // arg 2: the shape (array of strings)
      ' A '  
    ],
    {
      A: 'ae2:cable_anchor',
      B: 'minecraft:stone'
    }
  )

event.recipes.shapeless('jaffactory:jaffa_cake', ['jaffactory:jaffa_slime_base', 'create:chocolate_bucket'])
	event.remove({id:'jaffactory:jaffa_chocolating'})

event.recipes.shapeless('jaffactory_continued:empty_jaffa_pallet', ['3x #minecraft:planks', '2x #forge:rods/iron'])

event.custom({
    "type":"create:cutting",
  "ingredients": [
    {
      "item": "jaffactory:orange_log"
    }
  ],
  "processingTime": 50,
  "results": [
    {
      "item": "jaffactory:stripped_orange_log"
    }
  ]
})

event.custom({
    "type":"create:cutting",
  "ingredients": [
    {
      "item": "jaffactory:stripped_orange_log"
    }
  ],
  "processingTime": 50,
  "results": [
    {
    	"count": 6,
      "item": "jaffactory:orange_planks_block"
    }
  ]
})

event.custom({
    "type":"create:cutting",
  "ingredients": [
    {
      "item": "jaffactory:stripped_orange_wood"
    }
  ],
  "processingTime": 50,
  "results": [
    {
    	"count": 6,
      "item": "jaffactory:orange_planks_block"
    }
  ]
})

event.custom({
    "type":"create:cutting",
  "ingredients": [
    {
      "item": "jaffactory:orange_wood"
    }
  ],
  "processingTime": 50,
  "results": [
    {
    	"count": 6,
      "item": "jaffactory:stripped_orange_wood"
    }
  ]
})

event.custom({
  "type":"createaddition:rolling",
  "input": {
        "item": "jaffactory_continued:printed_jaffa_cake_box"
  },
  "result": {
    "item": "jaffactory_continued:empty_jaffa_cake_box",
    "count": 1
  }
  })


event.custom({
    "type":"createaddition:rolling",
  "input": [
    {
      "item": "jaffactory_continued:printed_jaffa_cake_box",
    }
  ],
  "processingTime": 40,
  "results": [
    {
      "item": "jaffactory_continued:empty_jaffa_cake_box",
    }
  ]
})

event.shapeless('2x create:brass_nugget', ['#forge:nuggets/copper', 'create:zinc_nugget'])

event.recipes.create.milling('24x jaffactory_continued:box_of_jaffa_cakes', 'jaffactory_continued:tied_jaffa_cake_pallet')
event.shapeless('24x jaffactory_continued:box_of_jaffa_cakes', 'jaffactory_continued:tied_jaffa_cake_pallet')

event.custom({
    "type":"create:mixing",
  "ingredients": [
    {
      "tag": "balm:eggs" 
    },
    {
        "item": "minecraft:cocoa_beans"
    },
    {
        "amount": 200,
        "fluidTag": "forge:milk"
    }
  ],
  "processingTime": 60,
  "results": [
    {
      "amount": 250,
      "fluid": "jaffactory:chocolate_fluid"
    }
  ]
})

event.custom({
    "type":"create:filling",
  "ingredients": [
    {
        "item": "jaffactory:jaffa_slime_base"
    },
    {
      "amount": 250,
      "fluid": "jaffactory:chocolate_fluid"
    }
  ],
  "results": [
    {
        "item": "jaffactory:jaffa_cake"
    }
  ]
})

event.recipes.create.sequenced_assembly([  //OK
		Item.of('jaffactory_continued:box_of_jaffa_cakes'), // this is the item that will appear in JEI as the result
	], 'jaffactory_continued:empty_jaffa_cake_box', [ // 'create:golden_sheet' is the input
		// the transitional item set by `transitionalItem('create:incomplete_large_cogwheel')` is the item used during the intermediate stages of the assembly
		event.recipes.createDeploying('jaffactory_continued:incomplete_jaffa_cake_box', ['jaffactory_continued:incomplete_jaffa_cake_box', Item.of('jaffactory:jaffa_cake')]),
	]).transitionalItem('jaffactory_continued:incomplete_jaffa_cake_box').loops(8) // set the transitional item and the number of loops

event.recipes.create.sequenced_assembly([  //OK
    Item.of('jaffactory_continued:untied_jaffa_cake_pallet'), // this is the item that will appear in JEI as the result
  ], 'jaffactory_continued:empty_jaffa_pallet', [ // 'create:golden_sheet' is the input
    // the transitional item set by `transitionalItem('create:incomplete_large_cogwheel')` is the item used during the intermediate stages of the assembly
    event.recipes.createDeploying('jaffactory_continued:incomplete_jaffa_cake_pallet', ['jaffactory_continued:incomplete_jaffa_cake_pallet', Item.of('jaffactory_continued:box_of_jaffa_cakes')]),
  ]).transitionalItem('jaffactory_continued:incomplete_jaffa_cake_pallet').loops(24) // set the transitional item and the number of loops

  event.recipes.create.deploying('jaffactory_continued:tied_jaffa_cake_pallet', ['jaffactory_continued:untied_jaffa_cake_pallet', 'minecraft:string']) //OK

event.custom({
  "type": "tfmg:distillation",
  "ingredients": [

    {
      "fluid": "tfmg:lpg",
      "nbt": {},
      "amount": 100
    }
  ],
  "results": [
    {
      "fluid": "tfmg:diesel",
      "amount": 35
    },
    {
      "fluid": "tfmg:gasoline",
      "amount": 35
    }
  ]
})

event.custom({
  "type": "tfmg:distillation",
  "ingredients": [
      {
        "fluid": "tfmg:kerosene",
        "nbt": {},
        "amount": 100
      }
    ],
    "results": [
      {
        "fluid": "tfmg:diesel",
        "amount": 65
      },
      {
        "fluid": "tfmg:gasoline",
        "amount": 25
      }
    ]
  })

event.custom({
  "type":"createaddition:liquid_burning",
  "input": {
        "fluid": "tfmg:creosote",
        "amount": 1000
  },
  "burnTime": 4800,
  "superheated": true
})

event.custom({
  "type":"createaddition:liquid_burning",
  "input": {
        "fluid": "tfmg:kerosene",
        "amount": 1000
  },
  "burnTime": 48000,
  "superheated": false
})

event.custom({
  "type":"createaddition:liquid_burning",
  "input": {
        "fluid": "tfmg:lpg",
        "amount": 1000
  },
  "burnTime": 18000,
  "superheated": false
})

event.remove({ id: 'tfmg:crafting/pipes/plastic_pipe_horizontal' })
event.replaceInput({ id: 'jaffactory:jaffa_base' }, 'minecraft:egg', '#balm:eggs')
event.replaceInput({ id: 'jaffactory:jaffa_base_mixing' }, 'minecraft:egg', '#balm:eggs')
event.replaceInput({ id: 'farmersdelight:fried_egg' }, 'minecraft:egg', '#balm:eggs')
})

ServerEvents.tags('item', event => {
	 event.get('forge:plates/zinc').add('createdeco:zinc_sheet')
   event.get('create:chain_rideable').add('mekanism:configurator')
   event.get('create:chain_rideable').add('ad_astra:wrench')
   event.get('create:chain_rideable').add('refurbished_furnither:wrench')
   event.get('create:chain_rideable').add('refinedstorage:wrench')
   event.get('create:chain_rideable').add('supplementaries:wrench')
   event.get('create:chain_rideable').add('thermal:wrench')
   event.get('create:chain_rideable').add('alexscaves:candy_cane_hook')
   event.get('create:chain_rideable').add('minecraft:tripwire_hook')
})

ServerEvents.compostableRecipes(event => {
	event.add('jaffactory:orange_sapling', 0.35)
})