1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

don't error on bad entity data packet

This commit is contained in:
Ubuntu 2022-11-09 17:34:48 +00:00
parent c4843b347d
commit 0675e05e28

View file

@ -595,8 +595,11 @@ impl Client {
ClientboundGamePacket::SetEntityData(p) => { ClientboundGamePacket::SetEntityData(p) => {
debug!("Got set entity data packet {:?}", p); debug!("Got set entity data packet {:?}", p);
let mut dimension = client.dimension.lock(); let mut dimension = client.dimension.lock();
let mut entity = dimension.entity_mut(p.id).expect("Entity doesn't exist"); if let Some(mut entity) = dimension.entity_mut(p.id) {
entity.apply_metadata(&p.packed_items.0); entity.apply_metadata(&p.packed_items.0);
} else {
warn!("Server sent an entity data packet for an entity id ({}) that we don't know about", p.id);
}
} }
ClientboundGamePacket::UpdateAttributes(_p) => { ClientboundGamePacket::UpdateAttributes(_p) => {
// debug!("Got update attributes packet {:?}", p); // debug!("Got update attributes packet {:?}", p);