aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azalea-brigadier/src/command_dispatcher.rs6
-rw-r--r--azalea-client/src/plugins/tick_broadcast.rs6
-rw-r--r--azalea/src/pathfinder/mod.rs2
3 files changed, 9 insertions, 5 deletions
diff --git a/azalea-brigadier/src/command_dispatcher.rs b/azalea-brigadier/src/command_dispatcher.rs
index eaf4a5e0..a5afe0da 100644
--- a/azalea-brigadier/src/command_dispatcher.rs
+++ b/azalea-brigadier/src/command_dispatcher.rs
@@ -1,7 +1,7 @@
use std::{
cmp::Ordering,
collections::{HashMap, HashSet},
- mem,
+ mem, ptr,
rc::Rc,
sync::Arc,
};
@@ -349,7 +349,7 @@ impl<S> CommandDispatcher<S> {
}
match &node.redirect {
Some(redirect) => {
- let redirect = if redirect.data_ptr() == self.root.data_ptr() {
+ let redirect = if ptr::eq(redirect.data_ptr(), self.root.data_ptr()) {
"...".to_string()
} else {
format!("-> {}", redirect.read().usage_text())
@@ -427,7 +427,7 @@ impl<S> CommandDispatcher<S> {
}
if let Some(redirect) = &node.redirect {
- let redirect = if redirect.data_ptr() == self.root.data_ptr() {
+ let redirect = if ptr::eq(redirect.data_ptr(), self.root.data_ptr()) {
"...".to_string()
} else {
format!("-> {}", redirect.read().usage_text())
diff --git a/azalea-client/src/plugins/tick_broadcast.rs b/azalea-client/src/plugins/tick_broadcast.rs
index 161413d8..424e1bf3 100644
--- a/azalea-client/src/plugins/tick_broadcast.rs
+++ b/azalea-client/src/plugins/tick_broadcast.rs
@@ -10,7 +10,7 @@ use tokio::sync::broadcast;
/// This is useful for running code every schedule from async user code.
///
/// ```
-/// use azalea_client::TickBroadcast;
+/// use azalea_client::tick_broadcast::TickBroadcast;
/// # async fn example(client: azalea_client::Client) {
/// let mut receiver = {
/// let ecs = client.ecs.lock();
@@ -24,6 +24,10 @@ use tokio::sync::broadcast;
/// ```
#[derive(Resource, Deref)]
pub struct TickBroadcast(broadcast::Sender<()>);
+/// A resource that contains a [`broadcast::Sender`] that will be sent every
+/// Azalea ECS Update.
+///
+/// Also see [`TickBroadcast`].
#[derive(Resource, Deref)]
pub struct UpdateBroadcast(broadcast::Sender<()>);
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 81ac5337..bd61c4eb 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -195,7 +195,7 @@ impl PathfinderClientExt for azalea_client::Client {
/// ```
/// # use azalea::prelude::*;
/// # use azalea::{BlockPos, pathfinder::goals::BlockPosGoal};
- /// # fn example(bot: &Client) {
+ /// # async fn example(bot: &Client) {
/// bot.goto(BlockPosGoal(BlockPos::new(0, 70, 0))).await;
/// # }
/// ```