onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:dirt', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:dirt')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:podzol', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:podzol')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:farmland', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:farmland')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:grass_path', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:grass_path')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:coarse_dirt', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 3, [3,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:stone_pebble', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:coarse_dirt')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:grass_block', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:grass_block')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('quark:glowcelium', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_dirt', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('quark:glowcelium')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:sand', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_sand', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:sand')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:red_sand', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_red_sand', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:red_sand')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:gravel', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:stone_pebble', 1, [3,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:andesite_pebble', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:gravel')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('supplementaries:raked_gravel', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:stone_pebble', 1, [3,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:andesite_pebble', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('supplementaries:raked_gravel')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('farmersdelight:rich_soil', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_rich_soil', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('farmersdelight:rich_soil')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:soul_sand', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_soul_sand', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:soul_sand')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:soul_soil', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_soul_soil', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:soul_soil')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('endergetic:eumus', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_eumus', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('endergetic:eumus')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('endergetic:eumus_poismoss', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_eumus', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('endergetic:eumus_poismoss')
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('endergetic:eumus_poismoss_path', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:pile_of_eumus', 1, 4)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('endergetic:eumus_poismoss_path')
		})
	})
})

onEvent('recipes', event => {
	event.replaceOutput({id:'minecraft:glass'}, 'minecraft:glass', 'quark:dirty_glass')
	event.remove({id:'minecraft:tnt'})
	event.remove({id:'minecraft:sandstone'})
	event.remove({id:'minecraft:red_sandstone'})
	event.remove({id:'goety:dead_sandstone'})
	event.remove({id:'goety:remnant_rock'})
	event.remove({id:'quark:building/crafting/soul_sandstone'})
	
	event.shaped('minecraft:dirt', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_dirt'
	})
	
	event.shaped('minecraft:sand', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_sand'
	})
	
	event.shaped('minecraft:red_sand', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_red_sand'
	})
	
	event.shaped('minecraft:soul_sand', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_soul_sand'
	})
	
	event.shaped('minecraft:soul_soil', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_soul_soil'
	})
	
	event.shaped('farmersdelight:rich_soil', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_rich_soil'
	})
	
	event.shaped('endergetic:eumus', [
		'DD',
		'DD'
	], {
		D: 'kubejs:pile_of_eumus'
	})
	
	event.shaped('2x minecraft:tnt', [
		'PSP',
		'SGS',
		'PSP'
	], {
		P: 'minecraft:paper',
		S: 'kubejs:pile_of_sand',
		G: 'charm:gunpowder_block'
	})
	
	event.shaped('2x minecraft:tnt', [
		'PSP',
		'SGS',
		'PSP'
	], {
		P: 'minecraft:paper',
		S: 'kubejs:pile_of_red_sand',
		G: 'charm:gunpowder_block'
	})
	
	event.recipes.createCompacting('minecraft:sandstone', '2x minecraft:sand')
	event.recipes.createCompacting('minecraft:red_sandstone', '2x minecraft:red_sand')
	event.recipes.createCompacting('goety:dead_sandstone', '2x goety:dead_sand')
	event.recipes.createCompacting('goety:remnant_rock', '2x goety:remnant_block')
	event.recipes.createCompacting('quark:soul_sandstone', '2x minecraft:soul_sand')
})