mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
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:
parent
caadc4d89f
commit
29ae124be3
@ -64,16 +64,18 @@ open class PixLyzerBlock(
|
|||||||
|
|
||||||
override val jumpBoost = data["jump_velocity_multiplier"]?.toFloat() ?: 1.0f
|
override val jumpBoost = data["jump_velocity_multiplier"]?.toFloat() ?: 1.0f
|
||||||
|
|
||||||
var material: Material = unsafeNull()
|
private val material: Material?
|
||||||
override var hardness: Float = 0.0f
|
override var hardness: Float = 0.0f
|
||||||
val requiresTool: Boolean
|
val requiresTool: Boolean
|
||||||
|
val replaceable: Boolean
|
||||||
override val item: Item = unsafeNull()
|
override val item: Item = unsafeNull()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val state = data["states"]?.asAnyMap()!!.iterator().next().value.asJsonObject()
|
val state = data["states"]?.asAnyMap()!!.iterator().next().value.asJsonObject()
|
||||||
material = registries.material[data["material"] ?: state["material"]]!!
|
|
||||||
hardness = data["hardness"]?.toFloat() ?: state["hardness"].toFloat()
|
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"])
|
this::item.inject(data["item"])
|
||||||
}
|
}
|
||||||
@ -83,7 +85,7 @@ open class PixLyzerBlock(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun canReplace(connection: PlayConnection, state: BlockState, position: BlockPosition): Boolean {
|
override fun canReplace(connection: PlayConnection, state: BlockState, position: BlockPosition): Boolean {
|
||||||
return material.replaceable
|
return replaceable
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isFullOpaque(state: BlockState): Boolean {
|
override fun isFullOpaque(state: BlockState): Boolean {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user