// Kubejs scripts for the custom power gen multiblocks

ServerEvents.recipes(event => {

// MLEM Gen Parts
event.custom({
  "type": "create_new_age:energising",
  "energy_needed": 10000,
  "ingredients": [
    {
      "item": "minecraft:amethyst_shard"
    }
  ],
  "results": [
    {
      "item": "kubejs:overcharged_amethyst"
    }
  ]
})

event.recipes.thermal.smelter('kubejs:slapis_ingot', ['#forge:ingots/silver', '2x minecraft:lapis_lazuli']).energy(5000)
event.recipes.thermal.press('kubejs:slapis_plate', ['kubejs:slapis_ingot'])
event.recipes.thermal.press('2x kubejs:slapis_rod', ['kubejs:slapis_ingot', 'thermal_extra:press_rod_die'])
event.recipes.thermal.press('kubejs:slapis_gear', ['4x kubejs:slapis_ingot', 'thermal:press_gear_die'])

event.shaped(
  Item.of('kubejs:slapis_repair'),
  [
    '  a',
    ' b ',
    'a  '
  ],
  {
    a: 'kubejs:slapis_rod',
    b: 'kubejs:slapis_gear'
  }
)

// MLEM casings
event.shaped(
  Item.of('2x kubejs:lapidary_casing'),
  [
    'aaa',
    'a a',
    'aaa'
  ],
  {
    a: 'kubejs:slapis_plate'
  }
)

event.shaped(
  Item.of('2x kubejs:amethyst_coil'),
  [
    'aaa',
    'aba',
    'aaa'
  ],
  {
    a: 'kubejs:overcharged_amethyst',
	b: 'kubejs:slapis_gear'
  }
)

event.shaped(
  Item.of('mbd2:lapidary_port_hatch'),
  [
    ' c ',
    'bab',
    ' d '
  ],
  {
    a: 'kubejs:lapidary_casing',
	b: 'minecraft:hopper',
	c: 'minecraft:chest',
	d: 'minecraft:bucket'
  }
)

event.shaped(
  Item.of('mbd2:lapidary_flux_port'),
  [
    ' c ',
    'bab',
    ' c '
  ],
  {
    a: 'kubejs:lapidary_casing',
	b: 'thermal:rf_coil',
	c: 'thermal:energy_cell'
  }
)

event.shaped(
  Item.of('mbd2:mlem_generator'),
  [
    'cbc',
    'bab',
    'cbc'
  ],
  {
    a: 'kubejs:lapidary_casing',
	b: 'thermal:dynamo_lapidary',
	c: 'kubejs:slapis_gear'
  }
)

// MLEM crystal processing
event.recipes.thermal.pulverizer('thermal:ruby_dust', 'thermal:ruby').energy(4000)
event.recipes.thermal.pulverizer('thermal:sapphire_dust', 'thermal:sapphire').energy(4000)

event.recipes.thermal.centrifuge([Item.of('thermal:apatite_dust').withChance(0.1), Item.of('thermal:cinnabar_dust').withChance(0.1), Item.of('thermal:ruby_dust').withChance(0.1), Item.of('thermal:sapphire_dust').withChance(0.1)], 'projecte:medium_covalence_dust').energy(9600)

event.custom({
  "type": "thermal:crystallizer",
  "ingredients": [
    {
      "fluid": "minecraft:water",
      "amount": 2000
    },
    {
      "tag": "forge:dusts/ruby"
    }
  ],
  "result": [
    {
      "item": "thermal:ruby"
    }
  ]	
})

event.custom({
  "type": "thermal:crystallizer",
  "ingredients": [
    {
      "fluid": "minecraft:water",
      "amount": 2000
    },
    {
      "tag": "forge:dusts/sapphire"
    }
  ],
  "result": [
    {
      "item": "thermal:sapphire"
    }
  ]	
})

// Overcharging gems
event.recipes.thermal.bottler('kubejs:energized_ruby', [Fluid.of('thermal:redstone', 1000), 'thermal:ruby']).energy(16000)
event.recipes.thermal.bottler('kubejs:energized_sapphire', [Fluid.of('thermal:redstone', 1000), 'thermal:sapphire']).energy(16000)

event.custom({
  "type": "create_new_age:energising",
  "energy_needed": 50000,
  "ingredients": [
    {
      "item": "kubejs:energized_ruby"
    }
  ],
  "results": [
    {
      "item": "kubejs:overcharged_ruby"
    }
  ]
})

event.custom({
  "type": "create_new_age:energising",
  "energy_needed": 50000,
  "ingredients": [
    {
      "item": "kubejs:energized_sapphire"
    }
  ],
  "results": [
    {
      "item": "kubejs:overcharged_sapphire"
    }
  ]
})

// Actual lapidary value
event.recipes.thermal.lapidary_fuel('kubejs:overcharged_ruby').energy(2500000)
event.recipes.thermal.lapidary_fuel('kubejs:overcharged_sapphire').energy(2500000)

// Items for the LCE
event.recipes.create.mixing(['kubejs:stiesel_ingot'], ['#forge:ingots/compressed_iron', Fluid.of('createdieselgenerators:biodiesel', 100)]).heated()
event.recipes.create.compacting('2x kubejs:stiesel_plate', ['kubejs:stiesel_ingot', '#forge:ingots/bronze']).heated()

event.shaped(
  Item.of('2x kubejs:compression_casing'),
  [
    'aaa',
    'a a',
    'aaa'
  ],
  {
    a: 'kubejs:stiesel_plate'
  }
)

event.custom({
	"type": "create:item_application",
  "ingredients": [
    {
      "item": "kubejs:compression_casing"
    },
    {
      "item": "create:fluid_tank"
    }
  ],
  "results": [
    {
      "item": "mbd2:compression_input_hatch"
    }
  ]
})

event.custom({
	"type": "create:item_application",
  "ingredients": [
    {
      "item": "kubejs:compression_casing"
    },
    {
      "item": "pneumaticcraft:compressed_iron_block"
    }
  ],
  "results": [
    {
      "item": "mbd2:compression_heat_vent"
    }
  ]
})

event.custom({
	"type": "create:item_application",
  "ingredients": [
    {
      "item": "kubejs:compression_casing"
    },
    {
      "item": "immersiveengineering:coil_lv"
    }
  ],
  "results": [
    {
      "item": "mbd2:compression_flux_port"
    }
  ]
})

event.custom({
	"type": "create:item_application",
  "ingredients": [
    {
      "item": "mbd2:compression_heat_vent"
    },
    {
      "item": "thermal:dynamo_compression"
    }
  ],
  "results": [
    {
      "item": "mbd2:compression_generator"
    }
  ]
})

// Chroma Gen Recipes
event.shaped(
  Item.of('mbd2:chroma_hatch'),
  [
    ' a ',
    'aba',
    ' a '
  ],
  {
    a: '#forge:dyes',
	b: 'mbd2:pcasinginputhatch'
  }
)

event.shaped(
  Item.of('mbd2:cpr_hatch'),
  [
    ' a ',
    'aba',
    ' a '
  ],
  {
    a: 'kubejs:containment_casing',
	b: 'enderstorage:ender_tank'
  }
)

event.shaped(
  Item.of('mbd2:cpr_port'),
  [
    ' a ',
    'aba',
    ' a '
  ],
  {
    a: 'kubejs:containment_casing',
	b: 'draconicevolution:energy_core'
  }
)

event.recipes.mekanism.crushing('bigreactors:blutonium_dust', 'bigreactors:blutonium_ingot')

})