diff options
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/packet_handling/configuration.rs | 10 | ||||
| -rw-r--r-- | azalea-client/src/packet_handling/game.rs | 14 |
2 files changed, 20 insertions, 4 deletions
diff --git a/azalea-client/src/packet_handling/configuration.rs b/azalea-client/src/packet_handling/configuration.rs index e7d3ffd8..ddf77a52 100644 --- a/azalea-client/src/packet_handling/configuration.rs +++ b/azalea-client/src/packet_handling/configuration.rs @@ -174,7 +174,7 @@ pub fn process_packet_events(ecs: &mut World) { .write_packet(ServerboundPongPacket { id: p.id }.get()) .unwrap(); } - ClientboundConfigurationPacket::ResourcePack(p) => { + ClientboundConfigurationPacket::ResourcePackPush(p) => { debug!("Got resource pack packet {p:?}"); let mut system_state: SystemState<Query<&RawConnection>> = SystemState::new(ecs); @@ -183,9 +183,15 @@ pub fn process_packet_events(ecs: &mut World) { // always accept resource pack raw_connection.write_packet( - ServerboundResourcePackPacket { action: azalea_protocol::packets::configuration::serverbound_resource_pack_packet::Action::Accepted }.get() + ServerboundResourcePackPacket { + id: p.id, + action: azalea_protocol::packets::configuration::serverbound_resource_pack_packet::Action::Accepted + }.get() ).unwrap(); } + ClientboundConfigurationPacket::ResourcePackPop(_) => { + // we can ignore this + } ClientboundConfigurationPacket::UpdateEnabledFeatures(p) => { debug!("Got update enabled features packet {p:?}"); } diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 750764df..afa0f4c0 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -31,6 +31,7 @@ use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId, use bevy_ecs::{prelude::*, system::SystemState}; use parking_lot::RwLock; use tracing::{debug, error, trace, warn}; +use uuid::Uuid; use crate::{ chat::{ChatPacket, ChatReceivedEvent}, @@ -123,6 +124,9 @@ pub struct KeepAliveEvent { #[derive(Event, Debug, Clone)] pub struct ResourcePackEvent { pub entity: Entity, + /// The random ID for this request to download the resource pack. The packet + /// for replying to a resource pack push must contain the same ID. + pub id: Uuid, pub url: String, pub hash: String, pub required: bool, @@ -1265,7 +1269,7 @@ pub fn process_packet_events(ecs: &mut World) { } ClientboundGamePacket::PlayerLookAt(_) => {} ClientboundGamePacket::RemoveMobEffect(_) => {} - ClientboundGamePacket::ResourcePack(p) => { + ClientboundGamePacket::ResourcePackPush(p) => { debug!("Got resource pack packet {p:?}"); let mut system_state: SystemState<EventWriter<ResourcePackEvent>> = @@ -1274,6 +1278,7 @@ pub fn process_packet_events(ecs: &mut World) { resource_pack_events.send(ResourcePackEvent { entity: player_entity, + id: p.id, url: p.url.to_owned(), hash: p.hash.to_owned(), required: p.required, @@ -1282,6 +1287,7 @@ pub fn process_packet_events(ecs: &mut World) { system_state.apply(ecs); } + ClientboundGamePacket::ResourcePackPop(_) => {} ClientboundGamePacket::Respawn(p) => { debug!("Got respawn packet {p:?}"); @@ -1398,7 +1404,11 @@ pub fn process_packet_events(ecs: &mut World) { ClientboundGamePacket::DamageEvent(_) => {} ClientboundGamePacket::HurtAnimation(_) => {} - ClientboundGamePacket::StartConfiguration(_) => todo!(), + ClientboundGamePacket::StartConfiguration(_) => {} + ClientboundGamePacket::TickingState(_) => {} + ClientboundGamePacket::TickingStep(_) => {} + + ClientboundGamePacket::ResetScore(_) => {} } } } |
