// priority: 0

settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info('Server Startup Scripts - Stone Tweaks - Cinnamon Buns')

onEvent('recipes', event => {
	// Remove all Deepslate Quark Recipes (Just for removal sake)
	event.remove({output: 'quark:deepslate'})
	event.remove({output: 'quark:cobbled_deepslate'})
	event.remove({output: 'quark:chiseled_deepslate'})
	event.remove({output: 'quark:cobbled_deepslate_slab'})
	event.remove({output: 'quark:cobbled_deepslate_stairs'})
	event.remove({output: 'quark:cobbled_deepslate_vertical_slab'})
	event.remove({output: 'quark:cobbled_deepslate_wall'})
	event.remove({output: 'quark:cracked_deepslate_bricks'})
	event.remove({output: 'quark:cracked_deepslate_tiles'})
	event.remove({output: 'quark:deepslate_bricks'})
	event.remove({output: 'quark:deepslate_bricks_slab'})
	event.remove({output: 'quark:deepslate_bricks_stairs'})
	event.remove({output: 'quark:deepslate_bricks_vertical_slab'})
	event.remove({output: 'quark:deepslate_bricks_wall'})
	event.remove({output: 'quark:deepslate_tiles'})
	event.remove({output: 'quark:deepslate_tiles_slab'})
	event.remove({output: 'quark:deepslate_tiles_stairs'})
	event.remove({output: 'quark:deepslate_tiles_vertical_slab'})
	event.remove({output: 'quark:deepslate_tiles_wall'})
	event.remove({output: 'quark:polished_deepslate'})
	event.remove({output: 'quark:polished_deepslate_slab'})
	event.remove({output: 'quark:polished_deepslate_stairs'})
	event.remove({output: 'quark:polished_deepslate_vertical_slab'})
	event.remove({output: 'quark:polished_deepslate_wall'})

	// Removed generation, added alternate method
	event.shapeless('create:limestone_cobblestone', ['#forge:cobblestone', '#forge:gems/quartz'])
	event.shapeless('create:dolomite', ['create:limestone'])

	// Deepslate Conversion (One way)
	event.shapeless('cavesandcliffs:deepslate',                        ['quark:deepslate'])
	event.shapeless('cavesandcliffs:cobbled_deepslate',                ['quark:cobbled_deepslate'])
	event.shapeless('cavesandcliffs:chiseled_deepslate',               ['quark:chiseled_deepslate'])
	event.shapeless('cavesandcliffs:cobbled_deepslate_slab',           ['quark:cobbled_deepslate_slab'])
	event.shapeless('cavesandcliffs:cobbled_deepslate_stairs',         ['quark:cobbled_deepslate_stairs'])
	event.shapeless('cavesandcliffs:cobbled_deepslate_vertical_slab',  ['quark:cobbled_deepslate_vertical_slab'])
	event.shapeless('cavesandcliffs:cobbled_deepslate_wall',           ['quark:cobbled_deepslate_wall'])
	event.shapeless('cavesandcliffs:cracked_deepslate_bricks',         ['quark:cracked_deepslate_bricks'])
	event.shapeless('cavesandcliffs:cracked_deepslate_tiles',          ['quark:cracked_deepslate_tiles'])
	event.shapeless('cavesandcliffs:deepslate_bricks',                 ['quark:deepslate_bricks'])
	event.shapeless('cavesandcliffs:deepslate_brick_slab',             ['quark:deepslate_bricks_slab'])
	event.shapeless('cavesandcliffs:deepslate_brick_stairs',           ['quark:deepslate_bricks_stairs'])
	event.shapeless('cavesandcliffs:deepslate_brick_vertical_slab',    ['quark:deepslate_bricks_vertical_slab'])
	event.shapeless('cavesandcliffs:deepslate_brick_wall',             ['quark:deepslate_bricks_wall'])
	event.shapeless('cavesandcliffs:deepslate_tiles',                  ['quark:deepslate_tiles'])
	event.shapeless('cavesandcliffs:deepslate_tile_slab',              ['quark:deepslate_tiles_slab'])
	event.shapeless('cavesandcliffs:deepslate_tile_stairs',            ['quark:deepslate_tiles_stairs'])
	event.shapeless('cavesandcliffs:deepslate_tile_vertical_slab',     ['quark:deepslate_tiles_vertical_slab'])
	event.shapeless('cavesandcliffs:deepslate_tile_wall',              ['quark:deepslate_tiles_wall'])
	event.shapeless('cavesandcliffs:polished_deepslate',               ['quark:polished_deepslate'])
	event.shapeless('cavesandcliffs:polished_deepslate_slab',          ['quark:polished_deepslate_slab'])
	event.shapeless('cavesandcliffs:polished_deepslate_stairs',        ['quark:polished_deepslate_stairs'])
	event.shapeless('cavesandcliffs:polished_deepslate_vertical_slab', ['quark:polished_deepslate_vertical_slab'])
	event.shapeless('cavesandcliffs:polished_deepslate_wall',          ['quark:polished_deepslate_wall'])
})

onEvent('block.loot_tables', event => {
	// Reconstruct Quark Deepslate Loot Table to use Caves and Cliffs
	event.addBlock('quark:deepslate', table => {
		table.addPool(pool => {
			pool.survivesExplosion()
			pool.addItem('cavesandcliffs:cobbled_deepslate')
		})
	})
})