registries: make block registry depend on particles

This fixes an eventual crash when loading
This commit is contained in:
Bixilon 2022-12-20 20:29:23 +01:00
parent 72dfeb7557
commit 3338ea145b
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ data class DimensionProperties(
val brightness = FloatArray(16)
init {
check(maxSection >= minSection) { "Upper section can not be lower that the lower section ($minSection > $maxSection)" }
check(maxSection >= minSection) { "Upper section can not be lower that the lower section ($minSection >= $maxSection)" }
check(minSection in ProtocolDefinition.CHUNK_MIN_SECTION..ProtocolDefinition.CHUNK_MAX_SECTION) { "Minimum section out of bounds: $minSection" }
check(maxSection in ProtocolDefinition.CHUNK_MIN_SECTION..ProtocolDefinition.CHUNK_MAX_SECTION) { "Maximum section out of bounds: $minSection" }

View File

@ -192,7 +192,7 @@ class Registries {
worker += WorkerTask(this::biomeRegistry) { biomeRegistry.rawUpdate(pixlyzerData["biomes"]?.toJsonObject(), this) }
worker += WorkerTask(this::dimensionRegistry) { dimensionRegistry.rawUpdate(pixlyzerData["dimensions"]?.toJsonObject(), this) }
worker += WorkerTask(this::fluidRegistry) { fluidRegistry.rawUpdate(pixlyzerData["fluids"]?.toJsonObject(), this) }
worker += WorkerTask(this::blockRegistry, dependencies = arrayOf(this::materialRegistry, this::fluidRegistry, this::shapes, this::soundGroupRegistry)) { blockRegistry.rawUpdate(pixlyzerData["blocks"]?.toJsonObject(), this) }
worker += WorkerTask(this::blockRegistry, dependencies = arrayOf(this::materialRegistry, this::fluidRegistry, this::shapes, this::soundGroupRegistry, this::particleTypeRegistry)) { blockRegistry.rawUpdate(pixlyzerData["blocks"]?.toJsonObject(), this) }
worker += WorkerTask(this::itemRegistry, dependencies = arrayOf(this::materialRegistry, this::blockRegistry, this::entityTypeRegistry, this::fluidRegistry, this::statusEffectRegistry, this::soundEventRegistry)) { itemRegistry.rawUpdate(pixlyzerData["items"]?.toJsonObject(), this) }
worker += WorkerTask(this::blockEntityTypeRegistry, dependencies = arrayOf(this::blockRegistry)) { blockEntityTypeRegistry.rawUpdate(pixlyzerData["block_entities"]?.toJsonObject(), this) }