From 9e061be903a2293ed7cfce705acd5551c875ac5c Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 24 Feb 2025 04:14:54 +0000 Subject: fix an error in set_entity_data --- azalea-client/src/plugins/packet/game/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'azalea-client/src/plugins') diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index 5f3e125f..f3670c71 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -742,9 +742,13 @@ impl GamePacketHandler<'_> { return; }; - let entity_kind = *entity_kind_query - .get(entity) - .expect("EntityKind component should always be present for entities"); + let Ok(entity_kind) = entity_kind_query.get(entity) else { + debug!( + "Server sent an entity data packet for an entity id ({}) that we have indexed as {entity} but they don't have EntityKind. Maybe a second local client that just disconnected?", + p.id + ); + return; + }; debug!("Got set entity data packet {p:?} for entity of kind {entity_kind:?}"); -- cgit v1.2.3