world events: ignore null events

This commit is contained in:
Bixilon 2022-05-11 21:24:00 +02:00
parent e30a5de578
commit 2779fd3be5
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -26,7 +26,7 @@ import de.bixilon.minosoft.util.logging.LogMessageType
@LoadPacket
class WorldEventS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
val eventId: Int = buffer.readInt()
val event = buffer.connection.registries.worldEventRegistry[eventId]
val event = buffer.connection.registries.worldEventRegistry.getOrNull(eventId)
var position: Vec3i = if (buffer.versionId < ProtocolVersions.V_14W03B) {
buffer.readByteBlockPosition()
} else {