PixLyzerBlock: load material and hardness from block data by default

All pixlyzer data from now on will have the data there.
This commit is contained in:
Bixilon 2023-03-02 19:49:27 +01:00
parent 6f43f9fdb6
commit 26fbc0c231
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -65,8 +65,8 @@ open class PixLyzerBlock(
init { init {
val state = data["states"]?.asAnyMap()!!.iterator().next().value.asJsonObject() val state = data["states"]?.asAnyMap()!!.iterator().next().value.asJsonObject()
material = registries.material[state["material"]]!! material = registries.material[data["material"] ?: state["material"]]!!
hardness = state["hardness"].toFloat() hardness = data["hardness"]?.toFloat() ?: state["hardness"].toFloat()
} }
override fun buildState(settings: BlockStateSettings): BlockState { override fun buildState(settings: BlockStateSettings): BlockState {