aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/plugins/chunks.rs7
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs6
-rw-r--r--azalea-client/src/test_simulation.rs4
3 files changed, 6 insertions, 11 deletions
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![],
},