fix: ores glow textures are not loading

This commit is contained in:
minjaesong
2023-11-23 17:03:48 +09:00
parent 08d69ba09c
commit 99bc57acdf
2 changed files with 14 additions and 5 deletions

View File

@@ -46,6 +46,10 @@ class OreCodex {
}
}
fun getOrNull(blockID: ItemID?): OreProp? {//<O>
return oreProps[blockID]
}
private fun setProp(modname: String, key: Int, record: CSVRecord) {
val prop = OreProp()
prop.id = "ores@$modname:$key"

View File

@@ -178,11 +178,16 @@ class CreateTileAtlas {
}
}
else {
// TODO test
dir.list().filter { tgaFile -> tgaFile.extension() == "tga" && !tgaFile.isDirectory }.sortedBy { it.nameWithoutExtension().toInt() }.forEach { tgaFile: FileHandle ->
val newFile = ModMgr.GameRetextureLoader.altFilePaths.getOrDefault(tgaFile.path(), tgaFile)
tgaList[dirName]!!.add(modname to newFile)
}
// filter files that do not exist on the orecodex
dir.list()
.filter { tgaFile -> tgaFile.extension() == "tga" && !tgaFile.isDirectory && (OreCodex.getOrNull("ores@$modname:${tgaFile.nameWithoutExtension()}") != null) }
.sortedBy { it.nameWithoutExtension().toInt() }
.forEach { tgaFile: FileHandle -> // toInt() to sort by the number, not lexicographically
// tgaFile be like: ./assets/mods/basegame/blocks/32.tga (which is not always .tga)
val newFile = ModMgr.GameRetextureLoader.altFilePaths.getOrDefault(tgaFile.path(), tgaFile)
tgaList[dirName]!!.add(modname to newFile)
// printdbg(this, "modname = $modname, file = $newFile")
}
}
}
}