Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
Added AutoEat and AutoTotem
Browse files Browse the repository at this point in the history
  • Loading branch information
AS1100K committed Aug 7, 2024
1 parent 6a57c22 commit cc99aea
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aether-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added `InWorld`, and `ExecutingTask` Component [#22](https://github.com/AS1100K/aether/pull/22)
- Added `PearlLoad` Event [#22](https://github.com/AS1100K/aether/pull/22)
- Added Auto Eat
- Added Auto Totem

### Changed
- Migrated from Tokio to Bevy ECS [#22](https://github.com/AS1100K/aether/pull/22)
Expand Down
1 change: 1 addition & 0 deletions aether-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bevy_ecs = "0.13.2"
azalea = { package = "multi-azalea", path = "../multi-azalea" }
azalea-task-manager = { path = "../plugins/task-manager", features = ["anti-afk"] }
azalea-anti-afk = { path = "../plugins/anti-afk" }
azalea-utility = { path = "../plugins/utility" }
# TODO: Migrate to bevy_discord
#azalea-discord = { git = "https://github.com/as1100k/aether", tag = "azalea-discord@v0.1.0", features = ["chat-bridge", "log-bridge"] }
serde = { version = "1.0.203", features = ["derive"] }
Expand Down
10 changes: 10 additions & 0 deletions aether-core/src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use azalea::entity::LocalEntity;
use azalea::prelude::GameTick;
use azalea_anti_afk::config::AntiAFKConfig;
use azalea_anti_afk::AntiAFK;
use azalea_utility::auto_eat::{StartAutoEat, StopAutoEat};
use azalea_utility::auto_totem::AutoTotem;
use bevy_ecs::prelude::*;

use crate::command::AetherCommand;
Expand All @@ -30,6 +32,8 @@ fn handle_chat(
mut commands: Commands,
mut send_chat_event: EventWriter<SendChatEvent>,
mut load_pearl: EventWriter<LoadPearl>,
mut start_auto_eat: EventWriter<StartAutoEat>,
mut stop_auto_eat: EventWriter<StopAutoEat>
) {
for ChatReceivedEvent { entity, packet } in events.read() {
for (state, in_world) in query.iter() {
Expand Down Expand Up @@ -81,9 +85,15 @@ fn handle_chat(
central_afk_location: None,
},
});
commands.entity(*entity).insert(AutoTotem);
start_auto_eat.send(StartAutoEat {
use_inventory: true
});
} else if content == "You have lost connection to the server" {
commands.entity(*entity).remove::<InWorld>();
commands.entity(*entity).remove::<AntiAFK>();
commands.entity(*entity).remove::<AutoTotem>();
stop_auto_eat.send(StopAutoEat);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions aether-core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use azalea_anti_afk::AntiAFKPlugin;
// use azalea_discord::chat_bridge::DiscordChatBridgePlugin;
// use azalea_discord::DiscordPlugin;
use azalea_task_manager::TaskManagerPlugin;
use azalea_utility::UtilityPlugin;
use plugins::AetherDefaultPlugins;
use tracing::info;
// use azalea_discord::log_bridge::{DiscordLogBridge, Level};
Expand All @@ -38,6 +39,7 @@ async fn main() {
.add_plugins(ConfigResourcePlugin)
.add_plugins(AntiAFKPlugin)
.add_plugins(TaskManagerPlugin)
.add_plugins(UtilityPlugin)
.add_plugins(AetherDefaultPlugins)
// .add_plugins(DiscordPlugin)
// .add_plugins(DiscordChatBridgePlugin)
Expand Down

0 comments on commit cc99aea

Please sign in to comment.