aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azalea-brigadier/src/command_dispatcher.rs2
-rw-r--r--azalea-client/src/client.rs1
-rw-r--r--azalea-client/src/plugins/join.rs3
-rw-r--r--azalea-client/src/test_utils/simulation.rs26
-rw-r--r--azalea-client/src/test_utils/tracing.rs3
-rw-r--r--azalea-world/src/bit_storage.rs2
6 files changed, 19 insertions, 18 deletions
diff --git a/azalea-brigadier/src/command_dispatcher.rs b/azalea-brigadier/src/command_dispatcher.rs
index b27df6d1..d9a45132 100644
--- a/azalea-brigadier/src/command_dispatcher.rs
+++ b/azalea-brigadier/src/command_dispatcher.rs
@@ -55,7 +55,7 @@ impl<S> CommandDispatcher<S> {
build
}
- pub fn parse(&self, command: StringReader, source: S) -> ParseResults<S> {
+ pub fn parse(&self, command: StringReader, source: S) -> ParseResults<'_, S> {
let source = Arc::new(source);
let context = CommandContextBuilder::new(self, source, self.root.clone(), command.cursor());
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index f73e939b..0304e7b0 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -572,7 +572,6 @@ impl Client {
#[derive(Bundle)]
pub struct LocalPlayerBundle {
pub raw_connection: RawConnection,
- pub client_information: ClientInformation,
pub instance_holder: InstanceHolder,
pub metadata: azalea_entity::metadata::PlayerMetadataBundle,
diff --git a/azalea-client/src/plugins/join.rs b/azalea-client/src/plugins/join.rs
index 8d094b7d..ed2d6ed3 100644
--- a/azalea-client/src/plugins/join.rs
+++ b/azalea-client/src/plugins/join.rs
@@ -129,6 +129,8 @@ pub fn handle_start_join_server_event(
// localentity is always present for our clients, even if we're not actually logged
// in
LocalEntity,
+ // this is inserted early so the user can always access and modify it
+ ClientInformation::default(),
// ConnectOpts is inserted as a component here
event.connect_opts.clone(),
// we don't insert InLoginState until we actually create the connection. note that
@@ -216,7 +218,6 @@ pub fn poll_create_connection_task(
write_conn,
ConnectionProtocol::Login,
),
- client_information: ClientInformation::default(),
instance_holder,
metadata: azalea_entity::metadata::PlayerMetadataBundle::default(),
},
diff --git a/azalea-client/src/test_utils/simulation.rs b/azalea-client/src/test_utils/simulation.rs
index c53a624a..00b35dee 100644
--- a/azalea-client/src/test_utils/simulation.rs
+++ b/azalea-client/src/test_utils/simulation.rs
@@ -11,14 +11,17 @@ use azalea_core::{
tick::GameTick,
};
use azalea_entity::metadata::PlayerMetadataBundle;
-use azalea_protocol::packets::{
- ConnectionProtocol, Packet, ProtocolPacket,
- common::CommonPlayerSpawnInfo,
- config::{ClientboundFinishConfiguration, ClientboundRegistryData},
- game::{
- ClientboundAddEntity, ClientboundLevelChunkWithLight, ClientboundLogin, ClientboundRespawn,
- c_level_chunk_with_light::ClientboundLevelChunkPacketData,
- c_light_update::ClientboundLightUpdatePacketData,
+use azalea_protocol::{
+ common::client_information::ClientInformation,
+ packets::{
+ ConnectionProtocol, Packet, ProtocolPacket,
+ common::CommonPlayerSpawnInfo,
+ config::{ClientboundFinishConfiguration, ClientboundRegistryData},
+ game::{
+ ClientboundAddEntity, ClientboundLevelChunkWithLight, ClientboundLogin,
+ ClientboundRespawn, c_level_chunk_with_light::ClientboundLevelChunkPacketData,
+ c_light_update::ClientboundLightUpdatePacketData,
+ },
},
};
use azalea_registry::{Biome, DimensionType, EntityKind};
@@ -30,8 +33,8 @@ use simdnbt::owned::{NbtCompound, NbtTag};
use uuid::Uuid;
use crate::{
- ClientInformation, InConfigState, LocalPlayerBundle, connection::RawConnection,
- disconnect::DisconnectEvent, local_player::InstanceHolder, player::GameProfileComponent,
+ InConfigState, LocalPlayerBundle, connection::RawConnection, disconnect::DisconnectEvent,
+ local_player::InstanceHolder, player::GameProfileComponent,
};
/// A way to simulate a client in a server, used for some internal tests.
@@ -49,7 +52,7 @@ impl Simulation {
let mut entity = app.world_mut().spawn_empty();
let (player, rt) =
create_local_player_bundle(entity.id(), ConnectionProtocol::Configuration);
- entity.insert(player);
+ entity.insert((player, ClientInformation::default()));
let entity = entity.id();
@@ -171,7 +174,6 @@ fn create_local_player_bundle(
let local_player_bundle = LocalPlayerBundle {
raw_connection,
- client_information: ClientInformation::default(),
instance_holder,
metadata: PlayerMetadataBundle::default(),
};
diff --git a/azalea-client/src/test_utils/tracing.rs b/azalea-client/src/test_utils/tracing.rs
index 85ac4bd6..207a4625 100644
--- a/azalea-client/src/test_utils/tracing.rs
+++ b/azalea-client/src/test_utils/tracing.rs
@@ -1,10 +1,9 @@
use bevy_log::tracing_subscriber::{
self, EnvFilter, Layer,
layer::{Context, SubscriberExt},
- registry::LookupSpan,
util::SubscriberInitExt,
};
-use tracing::{Event, Level, Subscriber, level_filters::LevelFilter};
+use tracing::{Event, Level, Subscriber};
pub fn init_tracing() {
init_tracing_with_level(Level::WARN);
diff --git a/azalea-world/src/bit_storage.rs b/azalea-world/src/bit_storage.rs
index 7d1b72e1..01e9f349 100644
--- a/azalea-world/src/bit_storage.rs
+++ b/azalea-world/src/bit_storage.rs
@@ -219,7 +219,7 @@ impl BitStorage {
self.size
}
- pub fn iter(&self) -> BitStorageIter {
+ pub fn iter(&self) -> BitStorageIter<'_> {
BitStorageIter {
storage: self,
index: 0,