particles: don't throw exception if no sprites available

important for <1.13
This commit is contained in:
Moritz Zwerger 2023-11-23 21:28:42 +01:00
parent 6449d2d54d
commit 70d736a289
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -43,7 +43,9 @@ abstract class SimpleTextureParticle(connection: PlayConnection, position: Vec3d
}
fun setRandomSprite() {
texture = connection.rendering?.context?.textures?.staticTextures?.get(data.type.textures.random())
val textures = data.type.textures
if (textures.isEmpty()) return
texture = connection.rendering?.context?.textures?.staticTextures?.get(textures.random())
}
override fun tick() {