1.20: don't require block material

This was removed from minecraft/pixlyzer in 1.20, finally in 23w17a.

This crashed the loading of 23w17a, thus the pipeline failed.
This commit is contained in:
Bixilon 2023-04-30 17:26:28 +02:00
parent caadc4d89f
commit 29ae124be3
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 7 additions and 5 deletions

View File

@ -64,16 +64,18 @@ open class PixLyzerBlock(
override val jumpBoost = data["jump_velocity_multiplier"]?.toFloat() ?: 1.0f
var material: Material = unsafeNull()
private val material: Material?
override var hardness: Float = 0.0f
val requiresTool: Boolean
val replaceable: Boolean
override val item: Item = unsafeNull()
init {
val state = data["states"]?.asAnyMap()!!.iterator().next().value.asJsonObject()
material = registries.material[data["material"] ?: state["material"]]!!
hardness = data["hardness"]?.toFloat() ?: state["hardness"].toFloat()
requiresTool = state["requires_tool"]?.toBoolean() ?: !material.soft
material = registries.material[data["material"] ?: state["material"]]
requiresTool = data["requires_tool"]?.toBoolean() ?: state["requires_tool"]?.toBoolean() ?: material?.let { !it.soft } ?: false
replaceable = data["replaceable"]?.toBoolean() ?: false
this::item.inject(data["item"])
}
@ -83,7 +85,7 @@ open class PixLyzerBlock(
}
override fun canReplace(connection: PlayConnection, state: BlockState, position: BlockPosition): Boolean {
return material.replaceable
return replaceable
}
override fun isFullOpaque(state: BlockState): Boolean {

File diff suppressed because one or more lines are too long