aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/lib.rs1
-rw-r--r--azalea-client/src/plugins/attack.rs1
-rw-r--r--azalea-client/src/plugins/loading.rs9
-rw-r--r--azalea-client/src/plugins/movement.rs36
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs17
5 files changed, 32 insertions, 32 deletions
diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs
index df04a606..19e13253 100644
--- a/azalea-client/src/lib.rs
+++ b/azalea-client/src/lib.rs
@@ -16,6 +16,7 @@ pub mod ping;
pub mod player;
mod plugins;
+#[cfg(feature = "log")]
#[doc(hidden)]
pub mod test_utils;
diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs
index 86ed5de5..ec4337e5 100644
--- a/azalea-client/src/plugins/attack.rs
+++ b/azalea-client/src/plugins/attack.rs
@@ -90,6 +90,7 @@ impl Client {
pub struct AttackQueued {
pub target: Entity,
}
+#[allow(clippy::type_complexity)]
pub fn handle_attack_queued(
mut commands: Commands,
mut query: Query<(
diff --git a/azalea-client/src/plugins/loading.rs b/azalea-client/src/plugins/loading.rs
index 217d6f75..b195868b 100644
--- a/azalea-client/src/plugins/loading.rs
+++ b/azalea-client/src/plugins/loading.rs
@@ -14,8 +14,8 @@ impl Plugin for PlayerLoadedPlugin {
GameTick,
player_loaded_packet
.after(PhysicsSet)
- .after(MiningSet)
- .after(crate::movement::send_position),
+ .before(MiningSet)
+ .before(crate::movement::send_position),
);
}
}
@@ -36,8 +36,11 @@ pub fn player_loaded_packet(
Entity,
(
With<LocalEntity>,
- With<InLoadedChunk>,
Without<HasClientLoaded>,
+ // the vanilla client waits for the chunk mesh to be "compiled" for the renderer (or
+ // some other conditions) before sending PlayerLoaded. see LevelLoadStatusManager.tick
+ // in the decompiled source
+ With<InLoadedChunk>,
),
>,
) {
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index b4649f20..5d43261f 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -6,14 +6,17 @@ use azalea_entity::{
metadata::Sprinting,
};
use azalea_physics::{PhysicsSet, ai_step};
-use azalea_protocol::packets::{
- Packet,
- game::{
- ServerboundPlayerCommand, ServerboundPlayerInput,
- s_move_player_pos::ServerboundMovePlayerPos,
- s_move_player_pos_rot::ServerboundMovePlayerPosRot,
- s_move_player_rot::ServerboundMovePlayerRot,
- s_move_player_status_only::ServerboundMovePlayerStatusOnly,
+use azalea_protocol::{
+ common::movements::MoveFlags,
+ packets::{
+ Packet,
+ game::{
+ ServerboundPlayerCommand, ServerboundPlayerInput,
+ s_move_player_pos::ServerboundMovePlayerPos,
+ s_move_player_pos_rot::ServerboundMovePlayerPosRot,
+ s_move_player_rot::ServerboundMovePlayerRot,
+ s_move_player_status_only::ServerboundMovePlayerStatusOnly,
+ },
},
};
use azalea_world::{MinecraftEntityId, MoveEntityError};
@@ -186,12 +189,16 @@ pub fn send_position(
// if self.is_passenger() {
// TODO: posrot packet for being a passenger
// }
+ let flags = MoveFlags {
+ on_ground: physics.on_ground(),
+ horizontal_collision: physics.horizontal_collision,
+ };
let packet = if sending_position && sending_direction {
Some(
ServerboundMovePlayerPosRot {
pos: **position,
look_direction: *direction,
- on_ground: physics.on_ground(),
+ flags,
}
.into_variant(),
)
@@ -199,7 +206,7 @@ pub fn send_position(
Some(
ServerboundMovePlayerPos {
pos: **position,
- on_ground: physics.on_ground(),
+ flags,
}
.into_variant(),
)
@@ -207,17 +214,12 @@ pub fn send_position(
Some(
ServerboundMovePlayerRot {
look_direction: *direction,
- on_ground: physics.on_ground(),
+ flags,
}
.into_variant(),
)
} else if physics.last_on_ground() != physics.on_ground() {
- Some(
- ServerboundMovePlayerStatusOnly {
- on_ground: physics.on_ground(),
- }
- .into_variant(),
- )
+ Some(ServerboundMovePlayerStatusOnly { flags }.into_variant())
} else {
None
};
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index 1ea4db10..d9940937 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -12,7 +12,10 @@ use azalea_entity::{
indexing::{EntityIdIndex, EntityUuidIndex},
metadata::{Health, apply_metadata},
};
-use azalea_protocol::packets::{ConnectionProtocol, game::*};
+use azalea_protocol::{
+ common::movements::MoveFlags,
+ packets::{ConnectionProtocol, game::*},
+};
use azalea_world::{InstanceContainer, InstanceName, MinecraftEntityId, PartialInstance};
use bevy_ecs::{prelude::*, system::SystemState};
pub use events::*;
@@ -319,15 +322,6 @@ impl GamePacketHandler<'_> {
.entity(self.player)
.insert(LoadedBy(HashSet::from_iter(vec![self.player])));
}
-
- // send the client information that we have set
- debug!(
- "Sending client information because login: {:?}",
- client_information
- );
- commands.trigger(SendPacketEvent::new(self.player,
- azalea_protocol::packets::game::s_client_information::ServerboundClientInformation { client_information: client_information.clone() },
- ));
},
);
}
@@ -443,8 +437,7 @@ impl GamePacketHandler<'_> {
ServerboundMovePlayerPosRot {
pos: **position,
look_direction: *direction,
- // this is always false
- on_ground: false,
+ flags: MoveFlags::default(),
},
));
});