aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
authorLuuk van Oijen <lazyluuk.channel@gmail.com>2023-08-22 05:50:21 +0200
committerGitHub <noreply@github.com>2023-08-21 22:50:21 -0500
commita81c4c060b9a32d1dccf451158750fac52349acc (patch)
treefc0760495c1197b0e6ef1c743ebcc0f2edb766ae /azalea/src
parent1b6e0244606cf7917e68918d32928550aabf85b0 (diff)
downloadazalea-drasl-a81c4c060b9a32d1dccf451158750fac52349acc.tar.xz
Food/saturation component support (#97)
* modified for food stuff * moved food/saturation to a separate file * hunger component * simplify some logic --------- Co-authored-by: mat <git@matdoes.dev>
Diffstat (limited to 'azalea/src')
-rw-r--r--azalea/src/swarm/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs
index f84905ec..05f39388 100644
--- a/azalea/src/swarm/mod.rs
+++ b/azalea/src/swarm/mod.rs
@@ -159,13 +159,13 @@ where
pub fn set_handler<S, Fut>(self, handler: HandleFn<S, Fut>) -> SwarmBuilder<S, SS>
where
Fut: Future<Output = Result<(), anyhow::Error>> + Send + 'static,
- S: Send + Sync + Clone + Component + 'static,
+ S: Send + Sync + Clone + Component + Default + 'static,
{
SwarmBuilder {
handler: Some(Box::new(move |bot, event, state: S| {
Box::pin(handler(bot, event, state))
})),
- states: Vec::new(),
+ states: vec![S::default(); self.accounts.len()],
app: self.app,
..self
}