// 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"),
    AE2("tools/certus_quartz_wrench"),
    AE2("tools/nether_quartz_wrench"),
  ])
  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") })


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

  //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: PHCFC('flouritem'), 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(PHCFC('flouritem'), 2)], F('#flour_plants')).processingTime(processingTimesDefault.milling)

  //wrenches
	e.smithing(AE2("certus_quartz_wrench"), Item.of(MAT('wrench')).ignoreNBT(), AE2('#crystals/certus_quartz'))
	e.smithing(AE2("nether_quartz_wrench"), Item.of(MAT('wrench')).ignoreNBT(), MC('quartz'))
})
