From ef357fdf3667f3ded03203fc0f7cdec48a01ad8f Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Tue, 25 Mar 2025 11:17:39 -0500 Subject: 1.21.5 (#198) * 25w02a * move item_components codegen to a different module * remove outdated test * 25w03a * start updating to 24w09b * 1.21.5-pre2 * fix broken packets * 1.21.5-rc2 * merge main * delete unused acket_handling * 1.21.5 --- azalea-client/src/plugins/chunks.rs | 7 +------ azalea-client/src/plugins/packet/game/mod.rs | 6 +++--- azalea-client/src/test_simulation.rs | 4 ++-- azalea-client/tests/change_dimension_to_nether_and_back.rs | 2 +- azalea-client/tests/despawn_entities_when_changing_dimension.rs | 2 +- azalea-client/tests/move_despawned_entity.rs | 2 +- azalea-client/tests/receive_start_config_packet.rs | 2 +- azalea-client/tests/set_health_before_login.rs | 2 +- 8 files changed, 11 insertions(+), 16 deletions(-) (limited to 'azalea-client') diff --git a/azalea-client/src/plugins/chunks.rs b/azalea-client/src/plugins/chunks.rs index 089cc5d4..060b94e2 100644 --- a/azalea-client/src/plugins/chunks.rs +++ b/azalea-client/src/plugins/chunks.rs @@ -4,7 +4,6 @@ use std::{ io::Cursor, - ops::Deref, time::{Duration, Instant}, }; @@ -15,7 +14,6 @@ use azalea_protocol::packets::game::{ }; use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; -use simdnbt::owned::BaseNbt; use tracing::{error, trace}; use super::packet::game::handle_outgoing_packets; @@ -98,10 +96,7 @@ pub fn handle_receive_chunk_events( } } - let heightmaps_nbt = &event.packet.chunk_data.heightmaps; - // necessary to make the unwrap_or work - let empty_nbt = BaseNbt::default(); - let heightmaps = heightmaps_nbt.unwrap_or(&empty_nbt).deref(); + let heightmaps = &event.packet.chunk_data.heightmaps; if let Err(e) = partial_instance.chunks.replace_with_packet_data( &pos, diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index cc67bcd7..6bb93178 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -57,6 +57,7 @@ pub fn process_packet_events(ecs: &mut World) { ecs, }; + // the order of these doesn't matter, that's decided by the protocol library declare_packet_handlers!( ClientboundGamePacket, packet.as_ref(), @@ -113,7 +114,6 @@ pub fn process_packet_events(ecs: &mut World) { server_data, set_equipment, update_mob_effect, - add_experience_orb, award_stats, block_changed_ack, block_destruction, @@ -193,6 +193,7 @@ pub fn process_packet_events(ecs: &mut World) { recipe_book_add, recipe_book_remove, recipe_book_settings, + test_instance_block_status, ] ); } @@ -1196,8 +1197,6 @@ impl GamePacketHandler<'_> { debug!("Got update mob effect packet {p:?}"); } - pub fn add_experience_orb(&mut self, _p: &ClientboundAddExperienceOrb) {} - pub fn award_stats(&mut self, _p: &ClientboundAwardStats) {} pub fn block_changed_ack(&mut self, _p: &ClientboundBlockChangedAck) {} @@ -1601,4 +1600,5 @@ impl GamePacketHandler<'_> { pub fn recipe_book_add(&mut self, _p: &ClientboundRecipeBookAdd) {} pub fn recipe_book_remove(&mut self, _p: &ClientboundRecipeBookRemove) {} pub fn recipe_book_settings(&mut self, _p: &ClientboundRecipeBookSettings) {} + pub fn test_instance_block_status(&mut self, _p: &ClientboundTestInstanceBlockStatus) {} } diff --git a/azalea-client/src/test_simulation.rs b/azalea-client/src/test_simulation.rs index 13d65bbb..7b422567 100644 --- a/azalea-client/src/test_simulation.rs +++ b/azalea-client/src/test_simulation.rs @@ -22,7 +22,7 @@ use azalea_world::{Chunk, Instance, MinecraftEntityId, Section}; use bevy_app::App; use bevy_ecs::{prelude::*, schedule::ExecutorKind}; use parking_lot::{Mutex, RwLock}; -use simdnbt::owned::{Nbt, NbtCompound, NbtTag}; +use simdnbt::owned::{NbtCompound, NbtTag}; use tokio::task::JoinHandle; use tokio::{sync::mpsc, time::sleep}; use uuid::Uuid; @@ -299,7 +299,7 @@ pub fn make_basic_empty_chunk( x: pos.x, z: pos.z, chunk_data: ClientboundLevelChunkPacketData { - heightmaps: Nbt::None, + heightmaps: Default::default(), data: Arc::new(chunk_bytes.into()), block_entities: vec![], }, diff --git a/azalea-client/tests/change_dimension_to_nether_and_back.rs b/azalea-client/tests/change_dimension_to_nether_and_back.rs index 969c5053..cc1fcb14 100644 --- a/azalea-client/tests/change_dimension_to_nether_and_back.rs +++ b/azalea-client/tests/change_dimension_to_nether_and_back.rs @@ -5,7 +5,7 @@ use azalea_protocol::packets::{ ConnectionProtocol, Packet, config::{ClientboundFinishConfiguration, ClientboundRegistryData}, }; -use azalea_registry::DimensionType; +use azalea_registry::{DataRegistry, DimensionType}; use azalea_world::InstanceName; use bevy_log::tracing_subscriber; use simdnbt::owned::{NbtCompound, NbtTag}; diff --git a/azalea-client/tests/despawn_entities_when_changing_dimension.rs b/azalea-client/tests/despawn_entities_when_changing_dimension.rs index 3d7f2cb4..967e0aac 100644 --- a/azalea-client/tests/despawn_entities_when_changing_dimension.rs +++ b/azalea-client/tests/despawn_entities_when_changing_dimension.rs @@ -5,7 +5,7 @@ use azalea_protocol::packets::{ ConnectionProtocol, config::{ClientboundFinishConfiguration, ClientboundRegistryData}, }; -use azalea_registry::{DimensionType, EntityKind}; +use azalea_registry::{DataRegistry, DimensionType, EntityKind}; use bevy_ecs::query::With; use bevy_log::tracing_subscriber; use simdnbt::owned::{NbtCompound, NbtTag}; diff --git a/azalea-client/tests/move_despawned_entity.rs b/azalea-client/tests/move_despawned_entity.rs index 74f7e942..d590cb39 100644 --- a/azalea-client/tests/move_despawned_entity.rs +++ b/azalea-client/tests/move_despawned_entity.rs @@ -2,7 +2,7 @@ use azalea_client::test_simulation::*; use azalea_core::{position::ChunkPos, resource_location::ResourceLocation}; use azalea_entity::metadata::Cow; use azalea_protocol::packets::{ConnectionProtocol, game::ClientboundMoveEntityRot}; -use azalea_registry::{DimensionType, EntityKind}; +use azalea_registry::{DataRegistry, DimensionType, EntityKind}; use azalea_world::MinecraftEntityId; use bevy_ecs::query::With; use bevy_log::tracing_subscriber; diff --git a/azalea-client/tests/receive_start_config_packet.rs b/azalea-client/tests/receive_start_config_packet.rs index 36762966..9b0c734d 100644 --- a/azalea-client/tests/receive_start_config_packet.rs +++ b/azalea-client/tests/receive_start_config_packet.rs @@ -1,7 +1,7 @@ use azalea_client::{InConfigState, packet::game::SendPacketEvent, test_simulation::*}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol::packets::{ConnectionProtocol, game::ClientboundStartConfiguration}; -use azalea_registry::DimensionType; +use azalea_registry::{DataRegistry, DimensionType}; use azalea_world::InstanceName; use bevy_ecs::event::Events; use bevy_log::tracing_subscriber; diff --git a/azalea-client/tests/set_health_before_login.rs b/azalea-client/tests/set_health_before_login.rs index c078cae4..d81dd48f 100644 --- a/azalea-client/tests/set_health_before_login.rs +++ b/azalea-client/tests/set_health_before_login.rs @@ -6,7 +6,7 @@ use azalea_protocol::packets::{ config::{ClientboundFinishConfiguration, ClientboundRegistryData}, game::ClientboundSetHealth, }; -use azalea_registry::DimensionType; +use azalea_registry::{DataRegistry, DimensionType}; use bevy_log::tracing_subscriber; use simdnbt::owned::{NbtCompound, NbtTag}; -- cgit v1.2.3