ServerEvents.recipes(event => {

	let breaking = (output, input) => {
		event.shapeless(output, [input])
	}
	breaking('2x minecraft:oak_planks', '#backrooms:oak_furniture')
	breaking('2x minecraft:spruce_planks', '#backrooms:spruce_furniture')
	breaking('2x minecraft:birch_planks', '#backrooms:birch_furniture')
	breaking('2x minecraft:jungle_planks', '#backrooms:jungle_furniture')
	breaking('2x minecraft:acacia_planks', '#backrooms:acacia_furniture')
	breaking('2x minecraft:dark_oak_planks', '#backrooms:dark_oak_furniture')
	breaking('2x minecraft:mangrove_planks', '#backrooms:mangrove_furniture')
	breaking('2x minecraft:cherry_planks', '#backrooms:cherry_furniture')
	breaking('2x minecraft:warped_planks', '#backrooms:warped_furniture')
	breaking('2x minecraft:crimson_planks', '#backrooms:crimson_furniture')



	let chopping = (output, input) => {
		event.recipes.farmersdelight.cutting(
			input,
			"#minecraft:axes",
			[
				output,
				Item.of("minecraft:stick")
                .withChance(0.5)
			],
			"minecraft:block.wood.break");
	}
	chopping('6x minecraft:oak_planks', '#backrooms:oak_furniture')
	chopping('6x minecraft:spruce_planks', '#backrooms:spruce_furniture')
	chopping('6x minecraft:birch_planks', '#backrooms:birch_furniture')
	chopping('6x minecraft:jungle_planks', '#backrooms:jungle_furniture')
	chopping('6x minecraft:acacia_planks', '#backrooms:acacia_furniture')
	chopping('6x minecraft:dark_oak_planks', '#backrooms:dark_oak_furniture')
	chopping('6x minecraft:mangrove_planks', '#backrooms:mangrove_furniture')
	chopping('6x minecraft:cherry_planks', '#backrooms:cherry_furniture')
	chopping('6x minecraft:warped_planks', '#backrooms:warped_furniture')
	chopping('6x minecraft:crimson_planks', '#backrooms:crimson_furniture')
	chopping('4x minecraft:bamboo_planks', 'chimes:carved_bamboo_chimes')

	let cutting = (output, input) => {
		event.recipes.create.cutting(
			[
				output,
				Item.of("mekanism:sawdust")
				.withChance(0.2)
			],
		input
	)}
	cutting('9x minecraft:oak_planks', '#backrooms:oak_furniture')
	cutting('9x minecraft:spruce_planks', '#backrooms:spruce_furniture')
	cutting('9x minecraft:birch_planks', '#backrooms:birch_furniture')
	cutting('9x minecraft:jungle_planks', '#backrooms:jungle_furniture')
	cutting('9x minecraft:acacia_planks', '#backrooms:acacia_furniture')
	cutting('9x minecraft:dark_oak_planks', '#backrooms:dark_oak_furniture')
	cutting('9x minecraft:mangrove_planks', '#backrooms:mangrove_furniture')
	cutting('9x minecraft:cherry_planks', '#backrooms:cherry_furniture')
	cutting('9x minecraft:warped_planks', '#backrooms:warped_furniture')
	cutting('9x minecraft:crimson_planks', '#backrooms:crimson_furniture')

	//add precision sawmill?
	let sofaRecipes = (color) => {
    	let sofa   = `refurbished_furniture:${color}_sofa`
    	let stool  = `refurbished_furniture:${color}_stool`
    	let wool  = `minecraft:${color}_wool`
    	event.shapeless(wool, [sofa])
    	event.shapeless(wool, [stool])
    	let chop = (input) => {
      	event.recipes.farmersdelight.cutting(input,
        "#forge:tools/axes",
        ["3x minecraft:oak_planks",`2x ${wool}`],
		"minecraft:block.wood.break")}
    	let saw = (input) => {event.recipes.create.cutting(["5x minecraft:oak_planks",`2x ${wool}`],input)}
		let precisionSaw = (input) => {event.custom({"type": "mekanism:sawing",
        "input": {"ingredient": { "item": input }},
        "mainOutput": {"item": "minecraft:oak_planks", "count": 6},
		"secondaryOutput": {"item": wool, "count": 2},"secondaryChance": 1.0})}
    chop(sofa)
    saw(sofa)
    precisionSaw(sofa)
    chop(stool)
    saw(stool)
    precisionSaw(stool)
  	}
  	sofaRecipes("red")
  	sofaRecipes("orange")
  	sofaRecipes("yellow")
  	sofaRecipes("lime")
  	sofaRecipes("green")
  	sofaRecipes("cyan")
  	sofaRecipes("blue")
  	sofaRecipes("purple")
  	sofaRecipes("magenta")
  	sofaRecipes("pink")
  	sofaRecipes("brown")
  	sofaRecipes("gray")
  	sofaRecipes("black")
  	sofaRecipes("white")
  	sofaRecipes("light_gray")
  	sofaRecipes("light_blue")

	let crate = (woodtype, output) => {
		event.shaped(output, [
			'ppp',
			'pfp',
			'ppp'
		], { f: 'supplementaries:timber_frame', p: woodtype })
	}

	crate('minecraft:oak_planks', 'refurbished_furniture:oak_crate')
	crate('minecraft:spruce_planks', 'refurbished_furniture:spruce_crate')
	crate('minecraft:birch_planks', 'refurbished_furniture:birch_crate')
	crate('minecraft:jungle_planks', 'refurbished_furniture:jungle_crate')
	crate('minecraft:acacia_planks', 'refurbished_furniture:acacia_crate')
	crate('minecraft:dark_oak_planks', 'refurbished_furniture:dark_oak_crate')
	crate('minecraft:mangrove_planks', 'refurbished_furniture:mangrove_crate')
	crate('minecraft:cherry_planks', 'refurbished_furniture:cherry_crate')
	crate('minecraft:warped_planks', 'refurbished_furniture:warped_crate')
	crate('minecraft:crimson_planks', 'refurbished_furniture:crimson_crate')
})