aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-04 06:23:19 -1400
committermat <git@matdoes.dev>2025-04-04 06:23:19 -1400
commit1fd02925903cfe59e85977b5c27e49457d99b142 (patch)
tree3289bd31d782512cbc011ac3087ab6c12d539f6b /azalea/examples
parent09d515c8cdd1bae32a5bc387b81360bad79eecf5 (diff)
downloadazalea-drasl-1fd02925903cfe59e85977b5c27e49457d99b142.tar.xz
rename ChatPacket::username and uuid to sender and sender_uuid
Diffstat (limited to 'azalea/examples')
-rw-r--r--azalea/examples/steal.rs2
-rw-r--r--azalea/examples/testbot/commands.rs4
-rw-r--r--azalea/examples/todo/craft_dig_straight_down.rs5
3 files changed, 6 insertions, 5 deletions
diff --git a/azalea/examples/steal.rs b/azalea/examples/steal.rs
index 74501ada..21eea424 100644
--- a/azalea/examples/steal.rs
+++ b/azalea/examples/steal.rs
@@ -26,7 +26,7 @@ struct State {
async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> {
if let Event::Chat(m) = event {
- if m.username() == Some(bot.profile.name.clone()) {
+ if m.sender() == Some(bot.profile.name.clone()) {
return Ok(());
};
if m.content() != "go" {
diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs
index c3cf1b47..4e261e17 100644
--- a/azalea/examples/testbot/commands.rs
+++ b/azalea/examples/testbot/commands.rs
@@ -24,14 +24,14 @@ impl CommandSource {
pub fn reply(&self, message: &str) {
if self.chat.is_whisper() {
self.bot
- .chat(&format!("/w {} {}", self.chat.username().unwrap(), message));
+ .chat(&format!("/w {} {}", self.chat.sender().unwrap(), message));
} else {
self.bot.chat(message);
}
}
pub fn entity(&mut self) -> Option<Entity> {
- let username = self.chat.username()?;
+ let username = self.chat.sender()?;
self.bot.entity_by::<With<Player>, &GameProfileComponent>(
|profile: &&GameProfileComponent| profile.name == username,
)
diff --git a/azalea/examples/todo/craft_dig_straight_down.rs b/azalea/examples/todo/craft_dig_straight_down.rs
index 7b75d2db..4f613adf 100644
--- a/azalea/examples/todo/craft_dig_straight_down.rs
+++ b/azalea/examples/todo/craft_dig_straight_down.rs
@@ -1,7 +1,8 @@
+use std::sync::Arc;
+
use azalea::pathfinder;
use azalea::prelude::*;
use parking_lot::Mutex;
-use std::sync::Arc;
#[derive(Default, Clone, Component)]
struct State {
@@ -23,7 +24,7 @@ async fn main() {
async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> {
match event {
Event::Chat(m) => {
- if m.username() == Some(bot.profile.name) {
+ if m.sender() == Some(bot.profile.name) {
return Ok(());
};
if m.content() == "go" {