// priority: 0

onEvent('recipes', e => {
  //removals
  e.remove({ type: AE2("grinder") })
  removeRecipeByID(e, [
    AE2("misc/grindstone"),
    MC("ens_blackstone"),
    MC("ens_gilded_blackstone"),
    AE2("tools/misctools_charged_staff"),
    AE2("tools/misctools_entropy_manipulator"),
  ])
  removeRecipeByInput(e, [
    AE2('flour'),
  ])
  e.remove({ type: ENS("sieve"), output: AE2("sky_dust") })
  e.remove({ type: ENS("sieve"), output: AE2("nether_quartz_dust") })
  e.remove({ type: ENS("sieve"), output: AE2("certus_quartz_dust") })
  e.remove({ type: ENS("sieve"), output: AE2("fluix_dust") })
  e.remove({ type: ENS("sieve"), output: AE2("certus_quartz_crystal") })
  e.remove({ type: ENS("sieve"), output: AE2("charged_certus_quartz_crystal") })



  //grindstone
  e.shaped(AE2('grindstone'), ['SGS', 'QSQ', 'CQC'], {
    S: F('#stone'),
    C: F('#cobblestone'),
    G: AE2('wooden_gear'),
    Q: MC('quartz')
  }).id(KJ(`${AE2()}/grindstone`))

  e.recipes.appliedenergistics2.grinder({
    input: { tag: F('sand') },
    result: { primary: { item: ENS('dust'), count: 2 } },
    turns: 8
  }).id(KJ(`${AE2()}/grinder/${ENS()}_dust`))

  e.recipes.appliedenergistics2.grinder({
    input: { tag: F('flour_plants') },
    result: { primary: { item: AE2('flour'), count: 1 } },
    turns: 8
  }).id(KJ(`${AE2()}/grinder/flour`))



  //energy acceptor
  e.replaceInput({ id: AE2("network/blocks/energy_energy_acceptor") }, AE2("#crystals/fluix"), AE2("#crystals/certus"))



  //sky stone
  e.shaped(AE2('sky_stone_block'), ['AA ', 'AA '], {
    A: ENS('pebble_blackstone'),
  }).id(KJ(`${AE2()}/sky_stone_from_pebble`))

  //flour
  e.recipes.createMilling([Item.of(AE2('flour'), 2)], F('#flour_plants')).processingTime(processingTimesDefault.milling)
})
