From 7d1996306c7cdd8d6ed02a29984f6651884b4740 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Mon, 13 Apr 2026 16:48:38 -0400 Subject: [PATCH] feat: add proper nix flake --- .envrc | 3 +- .github/dependabot.yaml | 17 ++++++++ Cargo.lock | 75 +++++++++++++++++++------------- Cargo.toml | 5 +-- README.md | 8 +++- default.nix | 24 +++++++++++ devenv.lock | 86 ------------------------------------- devenv.nix | 19 -------- devenv.yaml | 8 ---- flake.lock | 82 +++++++++++++++++++++++++++++++++++ flake.nix | 66 ++++++++++++++++++++++++++++ src/commands.rs | 2 +- src/hacks/anti_knockback.rs | 19 ++++++++ src/hacks/mod.rs | 28 ++++++++++++ src/lua/client/state.rs | 3 +- src/main.rs | 6 ++- 16 files changed, 296 insertions(+), 155 deletions(-) create mode 100644 .github/dependabot.yaml create mode 100644 default.nix delete mode 100644 devenv.lock delete mode 100644 devenv.nix delete mode 100644 devenv.yaml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 src/hacks/anti_knockback.rs create mode 100644 src/hacks/mod.rs diff --git a/.envrc b/.envrc index 2efe544..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1 @@ -eval "$(devenv direnvrc)" -use devenv +use flake diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..88ca794 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,17 @@ +version: 2 + +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "monthly" + + - package-ecosystem: "nix" + directory: "/" + schedule: + interval: "monthly" + + - package-ecosystem: "github-actions" + directory: ".github/workflows" + schedule: + interval: "monthly" diff --git a/Cargo.lock b/Cargo.lock index f925d3c..f569c1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -375,7 +375,8 @@ dependencies = [ [[package]] name = "azalea" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4499cd2a5bbf1ead434e457fd40fc6f3a3597c577564c12f4c21fd110b07cdaf" dependencies = [ "azalea-auth", "azalea-block", @@ -412,7 +413,8 @@ dependencies = [ [[package]] name = "azalea-auth" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74117dc3c3805946ac16cdd2f48fcecd7aa7e950c7da86e681e5ad921eb8885" dependencies = [ "azalea-buf", "azalea-crypto", @@ -432,7 +434,8 @@ dependencies = [ [[package]] name = "azalea-block" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea45cc5ae686461c81716f08bdee08857be2ffa0eb6562c213c35c67aa78db6c" dependencies = [ "azalea-block-macros", "azalea-buf", @@ -442,7 +445,8 @@ dependencies = [ [[package]] name = "azalea-block-macros" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdcc882d1a9b05af79b1bbd592d920e3a7ec252ac403877105bce5a2fdb21e1e" dependencies = [ "proc-macro2", "quote", @@ -452,7 +456,8 @@ dependencies = [ [[package]] name = "azalea-brigadier" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5a6d6986eccbf3902dd72432d56244dc5debca6ccbb1f47393c4d9277b044c5" dependencies = [ "azalea-buf", "azalea-chat", @@ -462,7 +467,8 @@ dependencies = [ [[package]] name = "azalea-buf" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8fb450761479a164cd94fbf7353c758f154a03d337ffaff8166a42e6937ff0" dependencies = [ "azalea-buf-macros", "byteorder", @@ -477,7 +483,8 @@ dependencies = [ [[package]] name = "azalea-buf-macros" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bc6a8dec6782886d06d1adf4a304d3babe7c61f28c407a10610dbac8db1d00" dependencies = [ "proc-macro2", "quote", @@ -487,7 +494,8 @@ dependencies = [ [[package]] name = "azalea-chat" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "665a5c4cd3488722302f69711027d29010d2e5b9f92d744f46605271afe2cf56" dependencies = [ "azalea-buf", "azalea-language", @@ -501,7 +509,8 @@ dependencies = [ [[package]] name = "azalea-client" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1b6d6f2298959bc66bbf7744ba880ac45c84f78ed383e2360ce085b73a73835" dependencies = [ "async-compat", "azalea-auth", @@ -539,7 +548,8 @@ dependencies = [ [[package]] name = "azalea-core" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3c7e9ec40c983b9a5e17cc75cb744896e4cce279ef355da1750c11632d37a0" dependencies = [ "azalea-buf", "azalea-chat", @@ -560,7 +570,8 @@ dependencies = [ [[package]] name = "azalea-crypto" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0ec0995af57e34a130e61869bb865e092d838d98d601fab64b9291d837adf" dependencies = [ "aes", "azalea-buf", @@ -579,7 +590,8 @@ dependencies = [ [[package]] name = "azalea-entity" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac94303362f7576efe063f8db36552f97258e729b3e4bd32a864ec797dc393f" dependencies = [ "azalea-block", "azalea-buf", @@ -599,18 +611,11 @@ dependencies = [ "uuid", ] -[[package]] -name = "azalea-hax" -version = "0.1.0" -source = "git+https://github.com/azalea-rs/azalea-hax#ef06856f1e6c45cab614ac78d2224a8228d9c426" -dependencies = [ - "azalea", -] - [[package]] name = "azalea-inventory" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f15103d879c9967c37fd13361d08db062dc9529a5593b14ef8301f322d42cd3e" dependencies = [ "azalea-auth", "azalea-buf", @@ -628,7 +633,8 @@ dependencies = [ [[package]] name = "azalea-inventory-macros" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94afbf2cb10a6cfc26a723430b42d0a1933291f176f10081c69f21651e56052d" dependencies = [ "proc-macro2", "quote", @@ -638,7 +644,8 @@ dependencies = [ [[package]] name = "azalea-language" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e58005bd5a7bdc0bed973640ae281aecd09fdbaa7312b959fc3f6f2232d3a64" dependencies = [ "compact_str", "serde_json", @@ -647,7 +654,8 @@ dependencies = [ [[package]] name = "azalea-physics" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5963fd337c81663ec89745f1baf7b97e823bf820c76c35f26e14a70233787923" dependencies = [ "azalea-block", "azalea-core", @@ -664,7 +672,8 @@ dependencies = [ [[package]] name = "azalea-protocol" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e2203a1d672290513a9c62d4753f1004a69a6767aebb788b06b02779071156" dependencies = [ "azalea-auth", "azalea-block", @@ -699,7 +708,8 @@ dependencies = [ [[package]] name = "azalea-protocol-macros" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab6a0f484a4cb105cd178f0cf54755f281625cda1beaf84d65e696af3383fd15" dependencies = [ "proc-macro2", "quote", @@ -709,7 +719,8 @@ dependencies = [ [[package]] name = "azalea-registry" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3960fd7f1dcd6ea6941fcb5e8a756ff0c8e13f13fa989bc1cde7cfb4563bb35" dependencies = [ "azalea-buf", "azalea-registry-macros", @@ -720,7 +731,8 @@ dependencies = [ [[package]] name = "azalea-registry-macros" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a8c09e57b12a674726eb5570b88828756c56fab90ce6f473a0a4a0a02bf18ea" dependencies = [ "quote", "syn 2.0.117", @@ -729,7 +741,8 @@ dependencies = [ [[package]] name = "azalea-world" version = "0.16.0+mc26.1" -source = "git+https://github.com/azalea-rs/azalea#ddef37118448b639ff56b86ae339e8913cb4ed11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59258b4001f420e0fb7fc418566b9fed25bac171e8fe6ebbee93d588118370a2" dependencies = [ "azalea-block", "azalea-buf", @@ -1082,7 +1095,8 @@ dependencies = [ [[package]] name = "built" version = "0.8.0" -source = "git+https://github.com/lukaslueg/built#7cebe3e8d802502f55d2cf799abf1e5c983fb7a9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" dependencies = [ "git2", ] @@ -1969,7 +1983,6 @@ version = "0.2.0" dependencies = [ "anyhow", "azalea", - "azalea-hax", "bevy_app", "bevy_ecs", "bevy_log", diff --git a/Cargo.toml b/Cargo.toml index f0ec27a..53a1fcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,12 +16,11 @@ lto = true strip = true [build-dependencies] -built = { git = "https://github.com/lukaslueg/built", features = ["git2"] } +built = { version = "0", features = ["git2"] } [dependencies] anyhow = "1" -azalea = { git = "https://github.com/azalea-rs/azalea" } -azalea-hax = { git = "https://github.com/azalea-rs/azalea-hax" } +azalea = "0" bevy_app = "0" bevy_ecs = "0" bevy_log = "0" diff --git a/README.md b/README.md index 95fe800..d63734b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,13 @@ A Minecraft bot with Lua scripting support, written in Rust with [azalea](https: $ git clone https://github.com/ErrorNoInternet/ErrorNoWatcher $ cd ErrorNoWatcher $ cargo build --release -$ # ./target/release/errornowatcher +$ ./target/release/errornowatcher +``` + +#### Nix + +```sh +nix run github:ErrorNoInternet/ErrorNoWatcher ``` Make sure the `Server` and `Username` globals are defined in `main.lua` before starting the bot. diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..3f79c42 --- /dev/null +++ b/default.nix @@ -0,0 +1,24 @@ +{ + lib, + pkgs, + rust, + self, +}: +pkgs.rustPlatform.buildRustPackage { + pname = "errornowatcher"; + version = self.shortRev or self.dirtyShortRev; + + cargoLock.lockFile = ./Cargo.lock; + src = lib.cleanSource ./.; + + nativeBuildInputs = with pkgs; [ + rust + + mold + pkg-config + ]; + + buildInputs = with pkgs; [ + luajit + ]; +} diff --git a/devenv.lock b/devenv.lock deleted file mode 100644 index 2c0c02f..0000000 --- a/devenv.lock +++ /dev/null @@ -1,86 +0,0 @@ -{ - "nodes": { - "devenv": { - "locked": { - "dir": "src/modules", - "lastModified": 1775928269, - "narHash": "sha256-kolsui5s7citDkwz2RL4Au8/BUdH9/TYbfMthLrarrc=", - "owner": "cachix", - "repo": "devenv", - "rev": "b908ac3d4b59f28cb32e7294c621b1c7325002c7", - "type": "github" - }, - "original": { - "dir": "src/modules", - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "nixpkgs": { - "inputs": { - "nixpkgs-src": "nixpkgs-src" - }, - "locked": { - "lastModified": 1774287239, - "narHash": "sha256-W3krsWcDwYuA3gPWsFA24YAXxOFUL6iIlT6IknAoNSE=", - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "fa7125ea7f1ae5430010a6e071f68375a39bd24c", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "nixpkgs-src": { - "flake": false, - "locked": { - "lastModified": 1773840656, - "narHash": "sha256-9tpvMGFteZnd3gRQZFlRCohVpqooygFuy9yjuyRL2C0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9cf7092bdd603554bd8b63c216e8943cf9b12512", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1775877051, - "narHash": "sha256-wpSQm2PD/w4uRo2wb8utk0b5hOBkkg/CZ1xICY+qB7M=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "08b4f3633471874c8894632ade1b78d75dbda002", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} \ No newline at end of file diff --git a/devenv.nix b/devenv.nix deleted file mode 100644 index bc7e4cf..0000000 --- a/devenv.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - ... -}: - -{ - packages = with pkgs; [ - git - jujutsu - - luajit - openssl - ]; - - languages.rust = { - enable = true; - channel = "nightly"; - }; -} diff --git a/devenv.yaml b/devenv.yaml deleted file mode 100644 index 37e8589..0000000 --- a/devenv.yaml +++ /dev/null @@ -1,8 +0,0 @@ -inputs: - nixpkgs: - url: github:cachix/devenv-nixpkgs/rolling - rust-overlay: - url: github:oxalica/rust-overlay - inputs: - nixpkgs: - follows: nixpkgs diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f5c7db1 --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1774709303, + "narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8110df5ad7abf5d4c0f6fb0f8f978390e77f9685", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775013181, + "narHash": "sha256-zPrt6oNM1r/RO5bWYaZ3hthfG9vzkr6kQdoqDd5x4Qw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "e8046c1d9ccadd497c2344d8fa49dab62f22f7be", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b235afe --- /dev/null +++ b/flake.nix @@ -0,0 +1,66 @@ +{ + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + flake-parts, + nixpkgs, + rust-overlay, + self, + ... + }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "aarch64-linux" + "x86_64-linux" + ]; + + perSystem = + { + pkgs, + self', + system, + ... + }: + let + rust = pkgs.rust-bin.nightly.latest.default.override { + extensions = [ + "rust-src" + "rust-analyzer-preview" + ]; + }; + in + { + _module.args.pkgs = import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + }; + + devShells.default = pkgs.mkShell { + name = "errornowatcher"; + + inputsFrom = [ self'.packages.default ]; + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ pkgs.taplo ]; + + RUST_BACKTRACE = 1; + }; + + packages = rec { + default = errornowatcher; + errornowatcher = pkgs.callPackage ./. { inherit rust self; }; + }; + }; + }; + + description = "A Minecraft bot with Lua scripting support"; +} diff --git a/src/commands.rs b/src/commands.rs index c3fa330..ea7626d 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,4 +1,4 @@ -use azalea::{brigadier::prelude::*, client_chat::ChatPacket, prelude::*}; +use azalea::{brigadier::prelude::*, chat::ChatPacket, prelude::*}; use futures::lock::Mutex; use mlua::{Error, Result, Table, UserDataRef}; use ncr::{ diff --git a/src/hacks/anti_knockback.rs b/src/hacks/anti_knockback.rs new file mode 100644 index 0000000..1164279 --- /dev/null +++ b/src/hacks/anti_knockback.rs @@ -0,0 +1,19 @@ +use azalea::{ + entity::Physics, + movement::{KnockbackEvent, handle_knockback}, + prelude::*, +}; +use bevy_ecs::{observer::On, query::With, system::Query}; + +#[derive(Component)] +pub struct AntiKnockback; + +pub fn anti_knockback( + knockback: On, + entity_query: Query<(), With>, + handle_knockback_query: Query<&mut Physics>, +) { + if entity_query.get(knockback.entity).is_err() { + handle_knockback(knockback, handle_knockback_query); + } +} diff --git a/src/hacks/mod.rs b/src/hacks/mod.rs new file mode 100644 index 0000000..8229c69 --- /dev/null +++ b/src/hacks/mod.rs @@ -0,0 +1,28 @@ +pub mod anti_knockback; + +use azalea::movement::KnockbackEvent; +use bevy_app::{App, Plugin, PostStartup}; +use bevy_ecs::world::World; + +pub struct HacksPlugin; + +impl Plugin for HacksPlugin { + fn build(&self, app: &mut App) { + app.add_systems(PostStartup, init_hacks); + } +} + +fn init_hacks(ecs: &mut World) { + let observers = ecs + .observers() + .try_get_observers(ecs.event_key::().unwrap()); + let mut to_despawn = Vec::new(); + for (observer_entity, _) in observers.unwrap().global_observers() { + to_despawn.push(*observer_entity); + } + for observer_entity in to_despawn { + ecs.despawn(observer_entity); + } + + ecs.add_observer(anti_knockback::anti_knockback); +} diff --git a/src/lua/client/state.rs b/src/lua/client/state.rs index 3d95f69..c576696 100644 --- a/src/lua/client/state.rs +++ b/src/lua/client/state.rs @@ -2,11 +2,10 @@ use azalea::{ ClientInformation, entity::metadata::AirSupply, pathfinder::debug::PathfinderDebugParticles, protocol::common::client_information::ModelCustomization, }; -use azalea_hax::AntiKnockback; use mlua::{Error, Lua, Result, Table, UserDataRef}; use super::Client; -use crate::unpack; +use crate::{hacks::anti_knockback::AntiKnockback, unpack}; pub fn air_supply(_lua: &Lua, client: &Client) -> Result { Ok(client.component::().0) diff --git a/src/main.rs b/src/main.rs index 0a6b213..eb0d222 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ mod arguments; mod build_info; mod commands; mod events; +mod hacks; mod http; mod lua; mod particle; @@ -27,7 +28,6 @@ use arguments::Arguments; use azalea::{ DefaultPlugins, bot::DefaultBotPlugins, brigadier::prelude::CommandDispatcher, prelude::*, }; -use azalea_hax::HaxPlugin; use bevy_app::PluginGroup; use bevy_log::{ LogPlugin, @@ -45,6 +45,8 @@ use { replay::{plugin::RecordPlugin, recorder::Recorder}, }; +use crate::hacks::HacksPlugin; + #[cfg(feature = "mimalloc")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; @@ -114,7 +116,7 @@ async fn main() -> Result<()> { let builder = ClientBuilder::new_without_plugins() .add_plugins(default_plugins) .add_plugins(DefaultBotPlugins) - .add_plugins(HaxPlugin); + .add_plugins(HacksPlugin); #[cfg(feature = "replay")] let builder = builder.add_plugins(RecordPlugin {