ServerEvents.recipes(event => {
	// Economy setup
	let coinPress = Ingredient.of("thermal:press_coin_die")
	let unpackingPress = Ingredient.of("thermal:press_unpacking_die")
	
	let makeCoinPressConversion = (fromType, toType, qty) => {
		event.custom({
			type: "thermal:press",
			ingredients: [
				{ item: fromType, count: qty },
				{ item: "thermal:press_coin_die" }
			],
			result: [Item.of(toType).toJson()]
		});
		event.custom({
			type: "thermal:press",
			ingredients: [
				{ item: toType },
				{ item: "thermal:press_unpacking_die" }
			],
			result: [Item.of(fromType).withCount(qty).toJson()]
		});
	};

	makeCoinPressConversion("minecraft:cobblestone", "dotcoinmod:copper_coin", 9)
	makeCoinPressConversion("dotcoinmod:copper_coin", "dotcoinmod:iron_coin", 10)
	makeCoinPressConversion("dotcoinmod:iron_coin", "dotcoinmod:gold_coin", 10)
	makeCoinPressConversion("dotcoinmod:gold_coin", "dotcoinmod:platinum_coin", 10)
})

/*LootJS.modifiers((event) => {
	event.enableLogging();
    event.removeGlobalModifier("@dotcoinmod");
    event.addBlockLootModifier("minecraft:stone").pool((p) => {
        p.addLoot("dotcoinmod:copper_coin");
        p.applyOreBonus("minecraft:fortune");
    }).randomChance(0.3).anyBiome("forge:is_mountain");
});*/


LootJS.modifiers((event) => {
	event.addBlockLootModifier("minecraft:stone")
		.randomChance(0.05)
		.applyOreBonus("minecraft:fortune")
		.addLoot("kubejs:grist_essence");
});