block model loader: print failed model name

This commit is contained in:
Moritz Zwerger 2023-10-13 22:32:57 +02:00
parent 15d582cc1a
commit 56adb8fe74
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -63,7 +63,14 @@ class BlockLoader(private val loader: ModelLoader) {
fun load(latch: AbstractLatch?) {
loader.context.connection.registries.block.async {
val model = loadState(it) ?: return@async
val model: DirectBlockModel
try {
model = loadState(it) ?: return@async
} catch (error: Exception) {
Log.log(LogMessageType.RENDERING, LogLevels.WARN) { "Can not load block model for block $it: $error" }
Log.log(LogMessageType.RENDERING, LogLevels.VERBOSE) { error }
return@async
}
val prototype = model.load(loader.context.textures)
it.model = prototype