ServerEvents.recipes((event) => {
	const ExileDB = Java.loadClass("com.robertx22.mine_and_slash.database.registry.ExileDB");
	// mns profession based crafting
	for (const { key, value: recipe } of ExileDB.Recipes().getAll().entrySet()) {
		if (key.contains("potion")) {
			event.recipes.create
				.mixing(recipe.toResultStackForJei(), recipe.getMaterials())
				.superheated();
		} else if (key.contains("food")) {
			event.recipes.farmersdelight.cooking(
				recipe.getMaterials(),
				recipe.toResultStackForJei(),
				50, // exp
				10, // cookTime
				"minecraft:bowl", // container
			);
			event.recipes.create
				.mixing(recipe.toResultStackForJei(), recipe.getMaterials())
				.heated();
		} else {
			event.recipes.create.compacting(
				recipe.toResultStackForJei(),
				recipe.getMaterials(),
			);
		}
	}
	for (const i of new Array(5).keys()) {
		// mns minings
		event.remove({ output: `mmorpg:material/mining/${i}` });
		event.shapeless(`mmorpg:material/mining/${i + 1}`, [
			`mmorpg:material/mining/${i}`,
			`mmorpg:material/mining/${i}`,
			`mmorpg:material/mining/${i}`,
			`mmorpg:material/mining/${i}`,
		]);
		event.shapeless(Item.of(`mmorpg:material/mining/${i}`, 4), [
			`mmorpg:material/mining/${i + 1}`,
		]);
		event.recipes.create.filling(`mmorpg:material/mining/${i + 1}`, [
			Fluid.of("create_enchantment_industry:experience", 1000),
			`mmorpg:material/mining/${i}`,
		]);
		// mns stones
		event.remove({ output: `mmorpg:stone/${i}` });
		event.shapeless(`mmorpg:stone/${i + 1}`, [
			`mmorpg:stone/${i}`,
			`mmorpg:stone/${i}`,
			`mmorpg:stone/${i}`,
			`mmorpg:stone/${i}`,
		]);
		event.shapeless(Item.of(`mmorpg:stone/${i}`, 4), [`mmorpg:stone/${i + 1}`]);
		event.custom({
			type: "create_new_age:energising",
			energy_needed: Math.pow(10, i + 3),
			ingredients: [
				{
					item: `mmorpg:stone/${i}`,
				},
			],
			results: [
				{
					item: `mmorpg:stone/${i + 1}`,
				},
			],
		});
	}
	// monster cell -> slime ball
	event.shapeless("minecraft:slime_ball", "minecells:monster_cell");
	// monster cell -> slime ball
	event.smelting("minecraft:rotten_flesh", "minecraft:leather");
	event.remove({ output: "mmorpg:soul_cleaner" });
	event.shaped(
		"mmorpg:soul_cleaner",
		[
			"AAA",
			"ABA",
			"AAA"
		],
		{
			A: "mmorpg:stone/3",
			B: "minecraft:nether_star"
		}
	)
	event.remove({ output: "waystones:warp_stone" });
});

ServerEvents.recipes(event => {
    // Silicon Essence 8개로 둘러싸서 Silicon 4개 만들기
    event.shaped(Item.of('refinedstorage:silicon', 4), [
        'EEE',
        'E E',
        'EEE'
    ], {
        E: 'mysticalagriculture:silicon_essence'
    })
});
