mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
block models: allow loading of models with broken block properties
This commit is contained in:
parent
642c381484
commit
ea183139a7
@ -18,6 +18,9 @@ import de.bixilon.minosoft.data.registries.blocks.properties.BlockProperties
|
||||
import de.bixilon.minosoft.gui.rendering.models.block.state.DirectBlockModel
|
||||
import de.bixilon.minosoft.gui.rendering.models.block.state.apply.BlockStateApply
|
||||
import de.bixilon.minosoft.gui.rendering.models.loader.BlockLoader
|
||||
import de.bixilon.minosoft.util.logging.Log
|
||||
import de.bixilon.minosoft.util.logging.LogLevels
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
|
||||
interface VariantBlockModel : DirectBlockModel {
|
||||
|
||||
@ -28,8 +31,12 @@ interface VariantBlockModel : DirectBlockModel {
|
||||
for (pair in variant.split(',')) {
|
||||
val (key, rawValue) = pair.split('=', limit = 2)
|
||||
|
||||
val (property, value) = BlockProperties.parseProperty(key, rawValue)
|
||||
properties[property] = value
|
||||
try {
|
||||
val (property, value) = BlockProperties.parseProperty(key, rawValue)
|
||||
properties[property] = value
|
||||
} catch (error: Throwable) {
|
||||
Log.log(LogMessageType.LOADING, LogLevels.WARN) { error }
|
||||
}
|
||||
}
|
||||
|
||||
return properties
|
||||
|
@ -201,7 +201,7 @@ internal class ChatComponentTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hypixelMotd() {
|
||||
fun hypixelMotd() { // ↓ Note that extra paragraph
|
||||
val string = " §aHypixel Network §c[1.8-1.19]\n §c§lLUNAR MAPS §7§l§ §6§lCOSMETICS §7| §d§lSKYBLOCK 0.17.3"
|
||||
val component = ChatComponent.of(string)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user