mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
registries: damage type codec
This fixes a joining crash on 1.19.4
This commit is contained in:
parent
42ea8dcb5f
commit
c5cba29fe9
@ -26,6 +26,7 @@ class DamageType(
|
|||||||
val scaling: String?,
|
val scaling: String?,
|
||||||
) : RegistryItem() {
|
) : RegistryItem() {
|
||||||
|
|
||||||
|
|
||||||
companion object : ResourceLocationCodec<DamageType> {
|
companion object : ResourceLocationCodec<DamageType> {
|
||||||
override fun deserialize(registries: Registries?, resourceLocation: ResourceLocation, data: Map<String, Any>): DamageType {
|
override fun deserialize(registries: Registries?, resourceLocation: ResourceLocation, data: Map<String, Any>): DamageType {
|
||||||
return DamageType(
|
return DamageType(
|
||||||
|
@ -115,7 +115,7 @@ class Registries : Parentable<Registries> {
|
|||||||
|
|
||||||
val entityDataIndexMap: MutableMap<EntityDataField, Int> = mutableMapOf()
|
val entityDataIndexMap: MutableMap<EntityDataField, Int> = mutableMapOf()
|
||||||
val entityType: Registry<EntityType> = register("entity_type", Registry(codec = EntityType))
|
val entityType: Registry<EntityType> = register("entity_type", Registry(codec = EntityType))
|
||||||
val damageType: Registry<DamageType> = register("damage_type", Registry())
|
val damageType: Registry<DamageType> = register("damage_type", Registry(codec = DamageType))
|
||||||
|
|
||||||
val blockEntityType = BlockEntityTypeRegistry()
|
val blockEntityType = BlockEntityTypeRegistry()
|
||||||
val blockDataType: Registry<BlockDataDataType> = Registry(codec = BlockDataDataType)
|
val blockDataType: Registry<BlockDataDataType> = Registry(codec = BlockDataDataType)
|
||||||
@ -259,7 +259,11 @@ class Registries : Parentable<Registries> {
|
|||||||
value.asJsonObject()["value"].listCast()!!
|
value.asJsonObject()["value"].listCast()!!
|
||||||
}
|
}
|
||||||
|
|
||||||
registry.update(values, this)
|
try {
|
||||||
|
registry.update(values, this)
|
||||||
|
} catch (error: Throwable) {
|
||||||
|
throw Exception("Can not update $fixedKey registry", error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user