using 'smelting dictionary' for smelter recipes

This commit is contained in:
minjaesong
2024-03-10 00:46:46 +09:00
parent c6999e0794
commit 247cf9bd33
14 changed files with 681 additions and 111 deletions

View File

@@ -846,11 +846,16 @@ object ModMgr {
object GameCraftingRecipeLoader {
const val recipePath = "crafting/"
const val smeltingPath = "smelting/"
@JvmStatic operator fun invoke(module: String) {
getFile(module, recipePath).listFiles { it: File -> it.name.lowercase().endsWith(".json") }?.forEach { jsonFile ->
Terrarum.craftingCodex.addFromJson(JsonFetcher(jsonFile), module, jsonFile.name)
}
getFile(module, smeltingPath).listFiles { it: File -> it.name.lowercase().endsWith(".json") }?.forEach { jsonFile ->
Terrarum.craftingCodex.addSmeltingFromJson(JsonFetcher(jsonFile), module, jsonFile.name)
}
}
}