aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-02-12 17:49:09 -0600
committerGitHub <noreply@github.com>2023-02-12 17:49:09 -0600
commit5d53d063c3c724cc33d2049fd67a058695edfe48 (patch)
treea7d350a1670488af6c1c066a8664ff4fd6667559 /azalea/src
parent962cb576b348e7f7b789d7db8420e8f9439b5705 (diff)
downloadazalea-drasl-5d53d063c3c724cc33d2049fd67a058695edfe48.tar.xz
Better chat events (#67)
* Better chat events * add a comment explaining why SendChatKindEvent is only one event
Diffstat (limited to 'azalea/src')
-rw-r--r--azalea/src/lib.rs2
-rw-r--r--azalea/src/swarm/chat.rs2
-rw-r--r--azalea/src/swarm/mod.rs6
3 files changed, 5 insertions, 5 deletions
diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs
index a34ea179..4e21fbbd 100644
--- a/azalea/src/lib.rs
+++ b/azalea/src/lib.rs
@@ -135,7 +135,7 @@ where
let resolved_address = resolver::resolve_address(&address).await?;
// An event that causes the schedule to run. This is only used internally.
- let (run_schedule_sender, run_schedule_receiver) = mpsc::channel(1);
+ let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel();
let ecs_lock = start_ecs(self.app, run_schedule_receiver, run_schedule_sender.clone());
let (bot, mut rx) = Client::start_client(
diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs
index 8a00c34d..18c27cd6 100644
--- a/azalea/src/swarm/chat.rs
+++ b/azalea/src/swarm/chat.rs
@@ -13,7 +13,7 @@
// in Swarm that's set to the smallest index of all the bots, and we remove all
// messages from the queue that are before that index.
-use azalea_client::{packet_handling::ChatReceivedEvent, ChatPacket};
+use azalea_client::chat::{ChatPacket, ChatReceivedEvent};
use azalea_ecs::{
app::{App, Plugin},
component::Component,
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs
index dcf412e2..d6932807 100644
--- a/azalea/src/swarm/mod.rs
+++ b/azalea/src/swarm/mod.rs
@@ -5,7 +5,7 @@ mod events;
pub mod prelude;
use crate::{bot::DefaultBotPlugins, HandleFn};
-use azalea_client::{init_ecs_app, start_ecs, Account, ChatPacket, Client, Event, JoinError};
+use azalea_client::{chat::ChatPacket, init_ecs_app, start_ecs, Account, Client, Event, JoinError};
use azalea_ecs::{
app::{App, Plugin, PluginGroup, PluginGroupBuilder},
component::Component,
@@ -47,7 +47,7 @@ pub struct Swarm {
bots_tx: mpsc::UnboundedSender<(Option<Event>, Client)>,
swarm_tx: mpsc::UnboundedSender<SwarmEvent>,
- run_schedule_sender: mpsc::Sender<()>,
+ run_schedule_sender: mpsc::UnboundedSender<()>,
}
/// Create a new [`Swarm`].
@@ -253,7 +253,7 @@ where
let (bots_tx, mut bots_rx) = mpsc::unbounded_channel();
let (swarm_tx, mut swarm_rx) = mpsc::unbounded_channel();
- let (run_schedule_sender, run_schedule_receiver) = mpsc::channel(1);
+ let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel();
let ecs_lock = start_ecs(self.app, run_schedule_receiver, run_schedule_sender.clone());
let swarm = Swarm {