diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-02-26 15:07:52 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-26 15:07:52 -0600 |
| commit | cbc6af81fbdee71f4c1c7d62e1b91f8b17ad23bd (patch) | |
| tree | eb9c19c4b5e3489a8ff1fd304c49d051f18c35d9 /azalea/examples | |
| parent | c1588ef66e844c067112ea880a54b4de9ec5a062 (diff) | |
| download | azalea-drasl-cbc6af81fbdee71f4c1c7d62e1b91f8b17ad23bd.tar.xz | |
Add PacketEvent (#75)
* add PacketEvent
* docs and fixes
* Event::Packet works
Diffstat (limited to 'azalea/examples')
| -rw-r--r-- | azalea/examples/testbot.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index 053e29b3..55c440a2 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -9,6 +9,7 @@ use azalea::pathfinder::BlockPosGoal; use azalea::{prelude::*, swarm::prelude::*, BlockPos, GameProfileComponent, WalkDirection}; use azalea::{Account, Client, Event}; use azalea_protocol::packets::game::serverbound_client_command_packet::ServerboundClientCommandPacket; +use azalea_protocol::packets::game::ClientboundGamePacket; use std::time::Duration; #[derive(Default, Clone, Component)] @@ -148,6 +149,12 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result< action: azalea_protocol::packets::game::serverbound_client_command_packet::Action::PerformRespawn, }.get()); } + Event::Packet(packet) => match *packet { + ClientboundGamePacket::Login(_) => { + println!("login packet"); + } + _ => {} + }, _ => {} } |
