diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-12-05 10:59:05 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-05 10:59:05 -0600 |
| commit | 7857a014b92e64361ee237ceae7ef1acc185ac46 (patch) | |
| tree | 5d70ea6b41943493873810e6a03c3483ff90a235 /azalea-client | |
| parent | ea3e8600126a58f5666d50fbf70dff8209d8979f (diff) | |
| download | azalea-drasl-7857a014b92e64361ee237ceae7ef1acc185ac46.tar.xz | |
1.20.3 (#110)
* 23w40a
* 23w41a
* 23w42a
* 23w43a
* 23w44a
* serialize FormattedText as nbt in network
* use azalea-nbt/serde in azalea-chat
* 23w45a
* fix 23w45a to compile
* handle Object in codegen
* 1.20.3-pre2
* remove unused clientbound_resource_pack_packet.rs
* merge main and make azalea-chat use simdnbt
* 1.20.3-rc1
* fix tests
* use simdnbt 0.3
* fix ServerboundSetJigsawBlockPacket
* 1.20.3
Diffstat (limited to 'azalea-client')
| -rw-r--r-- | azalea-client/Cargo.toml | 2 | ||||
| -rw-r--r-- | azalea-client/src/packet_handling/configuration.rs | 10 | ||||
| -rw-r--r-- | azalea-client/src/packet_handling/game.rs | 14 |
3 files changed, 21 insertions, 5 deletions
diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 1a7168c8..d934d3d5 100644 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -14,7 +14,7 @@ anyhow = "1.0.75" async-trait = "0.1.74" azalea-auth = { path = "../azalea-auth", version = "0.8.0" } azalea-block = { path = "../azalea-block", version = "0.8.0" } -simdnbt = { version = "0.2.1" } +simdnbt = "0.3" azalea-chat = { path = "../azalea-chat", version = "0.8.0" } azalea-core = { path = "../azalea-core", version = "0.8.0" } azalea-crypto = { path = "../azalea-crypto", version = "0.8.0" } 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(_) => {} } } } |
