mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
add ResourcePackEvent event
This commit is contained in:
parent
3621acab75
commit
6a37971420
5 changed files with 7 additions and 6 deletions
|
@ -98,7 +98,8 @@ impl Plugin for PacketHandlerPlugin {
|
||||||
.add_event::<UpdatePlayerEvent>()
|
.add_event::<UpdatePlayerEvent>()
|
||||||
.add_event::<ChatReceivedEvent>()
|
.add_event::<ChatReceivedEvent>()
|
||||||
.add_event::<DeathEvent>()
|
.add_event::<DeathEvent>()
|
||||||
.add_event::<KeepAliveEvent>();
|
.add_event::<KeepAliveEvent>()
|
||||||
|
.add_event::<ResourcePackEvent>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ where
|
||||||
P: ProtocolPacket + Debug,
|
P: ProtocolPacket + Debug,
|
||||||
W: AsyncWrite + Unpin + Send,
|
W: AsyncWrite + Unpin + Send,
|
||||||
{
|
{
|
||||||
trace!("Sending packet: {:?}", packet,);
|
trace!("Sending packet: {packet:?}");
|
||||||
let mut buf = packet_encoder(packet).unwrap();
|
let mut buf = packet_encoder(packet).unwrap();
|
||||||
if let Some(threshold) = compression_threshold {
|
if let Some(threshold) = compression_threshold {
|
||||||
buf = compression_encoder(&buf, threshold).await.unwrap();
|
buf = compression_encoder(&buf, threshold).await.unwrap();
|
||||||
|
|
|
@ -52,7 +52,7 @@ async fn main() {
|
||||||
.set_handler(handle)
|
.set_handler(handle)
|
||||||
.start(account.clone(), "localhost")
|
.start(account.clone(), "localhost")
|
||||||
.await;
|
.await;
|
||||||
eprintln!("{:?}", e);
|
eprintln!("{e:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,12 +221,12 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
|
||||||
};
|
};
|
||||||
bot.look_at(target_pos.center());
|
bot.look_at(target_pos.center());
|
||||||
let container = bot.open_container(target_pos).await;
|
let container = bot.open_container(target_pos).await;
|
||||||
println!("container: {:?}", container);
|
println!("container: {container:?}");
|
||||||
if let Some(container) = container {
|
if let Some(container) = container {
|
||||||
if let Some(contents) = container.contents() {
|
if let Some(contents) = container.contents() {
|
||||||
for item in contents {
|
for item in contents {
|
||||||
if let ItemSlot::Present(item) = item {
|
if let ItemSlot::Present(item) = item {
|
||||||
println!("item: {:?}", item);
|
println!("item: {item:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -63,7 +63,7 @@ async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> {
|
||||||
.dig(azalea::entity::feet_pos(bot.entity()).down(1))
|
.dig(azalea::entity::feet_pos(bot.entity()).down(1))
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
println!("{:?}", e);
|
println!("{e:?}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue