aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-09-14 18:17:32 -0500
committermat <git@matdoes.dev>2023-09-14 18:17:32 -0500
commit6a37971420e1fcf2d48d68281d99e0d464297687 (patch)
treebe37f2db52c2899f5d5b965798b8c7fa30443fd6
parent3621acab758c8bd00ee08feee307a02512f234c8 (diff)
downloadazalea-drasl-6a37971420e1fcf2d48d68281d99e0d464297687.tar.xz
add ResourcePackEvent event
-rw-r--r--azalea-client/src/packet_handling.rs3
-rwxr-xr-xazalea-protocol/src/write.rs2
-rwxr-xr-xazalea/README.md2
-rw-r--r--azalea/examples/testbot.rs4
-rw-r--r--azalea/examples/todo/craft_dig_straight_down.rs2
5 files changed, 7 insertions, 6 deletions
diff --git a/azalea-client/src/packet_handling.rs b/azalea-client/src/packet_handling.rs
index cccd6153..ca96d728 100644
--- a/azalea-client/src/packet_handling.rs
+++ b/azalea-client/src/packet_handling.rs
@@ -98,7 +98,8 @@ impl Plugin for PacketHandlerPlugin {
.add_event::<UpdatePlayerEvent>()
.add_event::<ChatReceivedEvent>()
.add_event::<DeathEvent>()
- .add_event::<KeepAliveEvent>();
+ .add_event::<KeepAliveEvent>()
+ .add_event::<ResourcePackEvent>();
}
}
diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs
index 1d66eba1..9e2e042b 100755
--- a/azalea-protocol/src/write.rs
+++ b/azalea-protocol/src/write.rs
@@ -88,7 +88,7 @@ where
P: ProtocolPacket + Debug,
W: AsyncWrite + Unpin + Send,
{
- trace!("Sending packet: {:?}", packet,);
+ trace!("Sending packet: {packet:?}");
let mut buf = packet_encoder(packet).unwrap();
if let Some(threshold) = compression_threshold {
buf = compression_encoder(&buf, threshold).await.unwrap();
diff --git a/azalea/README.md b/azalea/README.md
index 945913d8..69a6f26a 100755
--- a/azalea/README.md
+++ b/azalea/README.md
@@ -52,7 +52,7 @@ async fn main() {
.set_handler(handle)
.start(account.clone(), "localhost")
.await;
- eprintln!("{:?}", e);
+ eprintln!("{e:?}");
}
}
diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs
index 630ddf00..8e6f5b98 100644
--- a/azalea/examples/testbot.rs
+++ b/azalea/examples/testbot.rs
@@ -221,12 +221,12 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
};
bot.look_at(target_pos.center());
let container = bot.open_container(target_pos).await;
- println!("container: {:?}", container);
+ println!("container: {container:?}");
if let Some(container) = container {
if let Some(contents) = container.contents() {
for item in contents {
if let ItemSlot::Present(item) = item {
- println!("item: {:?}", item);
+ println!("item: {item:?}");
}
}
} else {
diff --git a/azalea/examples/todo/craft_dig_straight_down.rs b/azalea/examples/todo/craft_dig_straight_down.rs
index 116cbcc2..6672eaa4 100644
--- a/azalea/examples/todo/craft_dig_straight_down.rs
+++ b/azalea/examples/todo/craft_dig_straight_down.rs
@@ -63,7 +63,7 @@ async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> {
.dig(azalea::entity::feet_pos(bot.entity()).down(1))
.await
{
- println!("{:?}", e);
+ println!("{e:?}");
break;
}
}