aboutsummaryrefslogtreecommitdiff
path: root/azalea-client
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-10-07 06:01:19 +0400
committermat <git@matdoes.dev>2025-10-07 06:01:19 +0400
commit1cf6d92f1a8be954f6885704c31f317b99b05972 (patch)
treeab241a7b6fda815e777b914a8a9a153d23e81f06 /azalea-client
parent06807ec3ea7df6e83eed51b38f9d5e3bea9e7045 (diff)
downloadazalea-drasl-1cf6d92f1a8be954f6885704c31f317b99b05972.tar.xz
update ResolvableProfile data component to 1.21.9
Diffstat (limited to 'azalea-client')
-rw-r--r--azalea-client/src/client.rs16
-rw-r--r--azalea-client/src/plugins/packet/config/events.rs4
-rw-r--r--azalea-client/tests/mine_block_rollback.rs1
-rw-r--r--azalea-client/tests/mine_block_timing.rs1
-rw-r--r--azalea-client/tests/mine_block_without_rollback.rs1
-rw-r--r--azalea-client/tests/packet_order_set_carried_item.rs3
6 files changed, 16 insertions, 10 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index bb827838..cf07f8b2 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -261,12 +261,13 @@ impl Client {
/// return it.
///
///
- /// If the component can't be cloned, try [`Self::map_component`] instead.
- /// If it isn't guaranteed to be present, use [`Self::get_component`] or
- /// [`Self::map_get_component`].
+ /// If the component can't be cloned, try [`Self::query_self`] instead.
+ /// If it isn't guaranteed to be present, you can use
+ /// [`Self::get_component`] or [`Self::query_self`].
///
- /// You may also use [`Self::ecs`] and [`Self::query`] directly if you need
- /// more control over when the ECS is locked.
+ ///
+ /// You may also use [`Self::ecs`] directly if you need more control over
+ /// when the ECS is locked.
///
/// # Panics
///
@@ -285,9 +286,10 @@ impl Client {
/// Get a component from this client, or `None` if it doesn't exist.
///
- /// If the component can't be cloned, try [`Self::map_component`] instead.
+ /// If the component can't be cloned, consider using [`Self::query_self`]
+ /// with `Option<&T>` instead.
///
- /// You may also have to use [`Self::with_query`] directly.
+ /// You may also have to use [`Self::query_self`] directly.
pub fn get_component<T: Component + Clone>(&self) -> Option<T> {
self.query_self::<Option<&T>, _>(|t| t.cloned())
}
diff --git a/azalea-client/src/plugins/packet/config/events.rs b/azalea-client/src/plugins/packet/config/events.rs
index be5cfdb1..92df8d74 100644
--- a/azalea-client/src/plugins/packet/config/events.rs
+++ b/azalea-client/src/plugins/packet/config/events.rs
@@ -54,10 +54,10 @@ pub fn handle_outgoing_packets_observer(
/// A Bevy trigger that's sent when our client receives a [`ClientboundPing`]
/// packet in the config state.
///
-/// Also see [`PingEvent`].
+/// Also see [`GamePingEvent`].
///
/// [`ClientboundPing`]: azalea_protocol::packets::config::ClientboundPing
-/// [`PingEvent`]: crate::packet::game::PingEvent
+/// [`GamePingEvent`]: crate::packet::game::GamePingEvent
#[derive(Event, Debug, Clone)]
pub struct ConfigPingEvent {
pub entity: Entity,
diff --git a/azalea-client/tests/mine_block_rollback.rs b/azalea-client/tests/mine_block_rollback.rs
index 67a66169..44ad629f 100644
--- a/azalea-client/tests/mine_block_rollback.rs
+++ b/azalea-client/tests/mine_block_rollback.rs
@@ -30,6 +30,7 @@ fn test_mine_block_rollback() {
simulation.write_message(StartMiningBlockEvent {
entity: simulation.entity,
position: pos,
+ force: true,
});
simulation.tick();
assert_eq!(simulation.get_block_state(pos), Some(Block::Air.into()));
diff --git a/azalea-client/tests/mine_block_timing.rs b/azalea-client/tests/mine_block_timing.rs
index 1cbd2f61..6548b28a 100644
--- a/azalea-client/tests/mine_block_timing.rs
+++ b/azalea-client/tests/mine_block_timing.rs
@@ -57,6 +57,7 @@ fn test_mine_block_timing() {
simulation.write_message(StartMiningBlockEvent {
entity: simulation.entity,
position: pos,
+ force: false,
});
sent_packets.clear();
simulation.tick();
diff --git a/azalea-client/tests/mine_block_without_rollback.rs b/azalea-client/tests/mine_block_without_rollback.rs
index 16a371e5..a5a437a0 100644
--- a/azalea-client/tests/mine_block_without_rollback.rs
+++ b/azalea-client/tests/mine_block_without_rollback.rs
@@ -29,6 +29,7 @@ fn test_mine_block_without_rollback() {
simulation.write_message(StartMiningBlockEvent {
entity: simulation.entity,
position: pos,
+ force: true,
});
simulation.tick();
assert_eq!(simulation.get_block_state(pos), Some(Block::Air.into()));
diff --git a/azalea-client/tests/packet_order_set_carried_item.rs b/azalea-client/tests/packet_order_set_carried_item.rs
index 0506ad8e..a357dec0 100644
--- a/azalea-client/tests/packet_order_set_carried_item.rs
+++ b/azalea-client/tests/packet_order_set_carried_item.rs
@@ -55,13 +55,14 @@ fn test_packet_order_set_carried_item() {
simulation.tick();
simulation.tick();
- simulation.write_message(SetSelectedHotbarSlotEvent {
+ simulation.trigger(SetSelectedHotbarSlotEvent {
entity: simulation.entity,
slot: 1,
});
simulation.write_message(StartMiningBlockEvent {
entity: simulation.entity,
position: pos,
+ force: false,
});
sent_packets.clear();