fix: add HaxPlugin for proper AntiKnockback
This commit is contained in:
parent
3e672c4d1a
commit
823a63e93d
16
src/main.rs
16
src/main.rs
@ -14,6 +14,7 @@ use arguments::Arguments;
|
|||||||
use azalea::{
|
use azalea::{
|
||||||
DefaultBotPlugins, DefaultPlugins, brigadier::prelude::CommandDispatcher, prelude::*,
|
DefaultBotPlugins, DefaultPlugins, brigadier::prelude::CommandDispatcher, prelude::*,
|
||||||
};
|
};
|
||||||
|
use azalea_hax::HaxPlugin;
|
||||||
use bevy_app::PluginGroup;
|
use bevy_app::PluginGroup;
|
||||||
use bevy_log::{
|
use bevy_log::{
|
||||||
LogPlugin,
|
LogPlugin,
|
||||||
@ -113,8 +114,14 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
};
|
};
|
||||||
|
let account = if username.contains('@') {
|
||||||
|
Account::microsoft(&username).await?
|
||||||
|
} else {
|
||||||
|
Account::offline(&username)
|
||||||
|
};
|
||||||
let Err(error) = ClientBuilder::new_without_plugins()
|
let Err(error) = ClientBuilder::new_without_plugins()
|
||||||
.add_plugins(DefaultBotPlugins)
|
.add_plugins(DefaultBotPlugins)
|
||||||
|
.add_plugins(HaxPlugin)
|
||||||
.add_plugins(default_plugins)
|
.add_plugins(default_plugins)
|
||||||
.add_plugins(record_plugin)
|
.add_plugins(record_plugin)
|
||||||
.set_handler(events::handle_event)
|
.set_handler(events::handle_event)
|
||||||
@ -123,14 +130,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
event_listeners,
|
event_listeners,
|
||||||
commands: Arc::new(commands),
|
commands: Arc::new(commands),
|
||||||
})
|
})
|
||||||
.start(
|
.start(account, server)
|
||||||
if username.contains('@') {
|
|
||||||
Account::microsoft(&username).await?
|
|
||||||
} else {
|
|
||||||
Account::offline(&username)
|
|
||||||
},
|
|
||||||
server,
|
|
||||||
)
|
|
||||||
.await;
|
.await;
|
||||||
eprintln!("{error}");
|
eprintln!("{error}");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user