From 9642558f8f8d983a7087f15d68be8cf07a85f0c2 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 15 Dec 2021 23:10:55 -0600 Subject: [PATCH] azalea --- Cargo.lock | 84 +++++++++---------- Cargo.toml | 8 +- README.md | 6 +- {minecraft-chat => azalea-chat}/Cargo.toml | 2 +- .../src/base_component.rs | 0 .../src/component.rs | 0 {minecraft-chat => azalea-chat}/src/events.rs | 0 {minecraft-chat => azalea-chat}/src/lib.rs | 0 {minecraft-chat => azalea-chat}/src/style.rs | 0 .../src/text_component.rs | 0 .../src/translatable_component.rs | 0 .../tests/integration_test.rs | 2 +- .../Cargo.toml | 6 +- .../src/connect.rs | 2 +- .../src/crypt.rs | 0 .../src/lib.rs | 2 +- .../src/ping.rs | 2 +- {minecraft-core => azalea-core}/Cargo.toml | 2 +- {minecraft-core => azalea-core}/src/lib.rs | 0 .../src/serializable_uuid.rs | 0 .../Cargo.toml | 4 +- .../src/connect.rs | 0 .../src/lib.rs | 0 .../src/mc_buf.rs | 0 .../src/packets/game/mod.rs | 0 .../handshake/client_intention_packet.rs | 0 .../src/packets/handshake/mod.rs | 0 .../login/clientbound_custom_query_packet.rs | 0 .../packets/login/clientbound_hello_packet.rs | 0 .../src/packets/login/mod.rs | 0 .../packets/login/serverbound_hello_packet.rs | 0 .../src/packets/mod.rs | 0 .../clientbound_status_response_packet.rs | 2 +- .../src/packets/status/mod.rs | 0 .../serverbound_status_request_packet.rs | 0 .../src/read.rs | 0 .../src/resolver.rs | 0 .../src/write.rs | 0 bot/Cargo.toml | 6 +- bot/src/main.rs | 2 +- 40 files changed, 67 insertions(+), 63 deletions(-) rename {minecraft-chat => azalea-chat}/Cargo.toml (90%) rename {minecraft-chat => azalea-chat}/src/base_component.rs (100%) rename {minecraft-chat => azalea-chat}/src/component.rs (100%) rename {minecraft-chat => azalea-chat}/src/events.rs (100%) rename {minecraft-chat => azalea-chat}/src/lib.rs (100%) rename {minecraft-chat => azalea-chat}/src/style.rs (100%) rename {minecraft-chat => azalea-chat}/src/text_component.rs (100%) rename {minecraft-chat => azalea-chat}/src/translatable_component.rs (100%) rename {minecraft-chat => azalea-chat}/tests/integration_test.rs (98%) rename {minecraft-client => azalea-client}/Cargo.toml (66%) rename {minecraft-client => azalea-client}/src/connect.rs (98%) rename {minecraft-client => azalea-client}/src/crypt.rs (100%) rename {minecraft-client => azalea-client}/src/lib.rs (65%) rename {minecraft-client => azalea-client}/src/ping.rs (98%) rename {minecraft-core => azalea-core}/Cargo.toml (87%) rename {minecraft-core => azalea-core}/src/lib.rs (100%) rename {minecraft-core => azalea-core}/src/serializable_uuid.rs (100%) rename {minecraft-protocol => azalea-protocol}/Cargo.toml (86%) rename {minecraft-protocol => azalea-protocol}/src/connect.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/lib.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/mc_buf.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/game/mod.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/handshake/client_intention_packet.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/handshake/mod.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/login/clientbound_custom_query_packet.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/login/clientbound_hello_packet.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/login/mod.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/login/serverbound_hello_packet.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/mod.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/status/clientbound_status_response_packet.rs (97%) rename {minecraft-protocol => azalea-protocol}/src/packets/status/mod.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/packets/status/serverbound_status_request_packet.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/read.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/resolver.rs (100%) rename {minecraft-protocol => azalea-protocol}/src/write.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index f2728389..e999fcc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,6 +30,46 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +[[package]] +name = "azalea-chat" +version = "0.1.0" +dependencies = [ + "lazy_static", + "serde", + "serde_json", +] + +[[package]] +name = "azalea-client" +version = "0.1.0" +dependencies = [ + "azalea-protocol", +] + +[[package]] +name = "azalea-core" +version = "0.1.0" +dependencies = [ + "uuid", +] + +[[package]] +name = "azalea-protocol" +version = "0.1.0" +dependencies = [ + "async-recursion", + "async-trait", + "azalea-chat", + "byteorder", + "bytes", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-util", + "trust-dns-resolver", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -40,8 +80,8 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" name = "bot" version = "0.1.0" dependencies = [ - "minecraft-client", - "minecraft-protocol", + "azalea-client", + "azalea-protocol", "tokio", ] @@ -284,46 +324,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" -[[package]] -name = "minecraft-chat" -version = "0.1.0" -dependencies = [ - "lazy_static", - "serde", - "serde_json", -] - -[[package]] -name = "minecraft-client" -version = "0.1.0" -dependencies = [ - "minecraft-protocol", -] - -[[package]] -name = "minecraft-core" -version = "0.1.0" -dependencies = [ - "uuid", -] - -[[package]] -name = "minecraft-protocol" -version = "0.1.0" -dependencies = [ - "async-recursion", - "async-trait", - "byteorder", - "bytes", - "minecraft-chat", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-util", - "trust-dns-resolver", -] - [[package]] name = "mio" version = "0.7.14" diff --git a/Cargo.toml b/Cargo.toml index a4ad743a..22f3e5a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,8 @@ members = [ "bot", - "minecraft-client", - "minecraft-protocol", - "minecraft-chat", - "minecraft-core", + "azalea-client", + "azalea-protocol", + "azalea-chat", + "azalea-core", ] diff --git a/README.md b/README.md index 06f78a52..539e1fdb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ -# this library doesn't have a name yet idk what to call it +# Azalea + +A Minecraft botting library + +I named this Azalea because it sounds like a cool word and this is a cool library. diff --git a/minecraft-chat/Cargo.toml b/azalea-chat/Cargo.toml similarity index 90% rename from minecraft-chat/Cargo.toml rename to azalea-chat/Cargo.toml index aa803864..7019e5bf 100644 --- a/minecraft-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "minecraft-chat" +name = "azalea-chat" version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/minecraft-chat/src/base_component.rs b/azalea-chat/src/base_component.rs similarity index 100% rename from minecraft-chat/src/base_component.rs rename to azalea-chat/src/base_component.rs diff --git a/minecraft-chat/src/component.rs b/azalea-chat/src/component.rs similarity index 100% rename from minecraft-chat/src/component.rs rename to azalea-chat/src/component.rs diff --git a/minecraft-chat/src/events.rs b/azalea-chat/src/events.rs similarity index 100% rename from minecraft-chat/src/events.rs rename to azalea-chat/src/events.rs diff --git a/minecraft-chat/src/lib.rs b/azalea-chat/src/lib.rs similarity index 100% rename from minecraft-chat/src/lib.rs rename to azalea-chat/src/lib.rs diff --git a/minecraft-chat/src/style.rs b/azalea-chat/src/style.rs similarity index 100% rename from minecraft-chat/src/style.rs rename to azalea-chat/src/style.rs diff --git a/minecraft-chat/src/text_component.rs b/azalea-chat/src/text_component.rs similarity index 100% rename from minecraft-chat/src/text_component.rs rename to azalea-chat/src/text_component.rs diff --git a/minecraft-chat/src/translatable_component.rs b/azalea-chat/src/translatable_component.rs similarity index 100% rename from minecraft-chat/src/translatable_component.rs rename to azalea-chat/src/translatable_component.rs diff --git a/minecraft-chat/tests/integration_test.rs b/azalea-chat/tests/integration_test.rs similarity index 98% rename from minecraft-chat/tests/integration_test.rs rename to azalea-chat/tests/integration_test.rs index aac12875..1278adfa 100644 --- a/minecraft-chat/tests/integration_test.rs +++ b/azalea-chat/tests/integration_test.rs @@ -1,4 +1,4 @@ -use minecraft_chat::{ +use azalea_chat::{ component::Component, style::{Ansi, ChatFormatting, TextColor}, }; diff --git a/minecraft-client/Cargo.toml b/azalea-client/Cargo.toml similarity index 66% rename from minecraft-client/Cargo.toml rename to azalea-client/Cargo.toml index 10a0ecbf..7e22f727 100644 --- a/minecraft-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "minecraft-client" -version = "0.1.0" edition = "2021" +name = "azalea-client" +version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -minecraft-protocol = { path = "../minecraft-protocol" } \ No newline at end of file +azalea-protocol = {path = "../azalea-protocol"} diff --git a/minecraft-client/src/connect.rs b/azalea-client/src/connect.rs similarity index 98% rename from minecraft-client/src/connect.rs rename to azalea-client/src/connect.rs index 5eedbf96..fad5fa92 100644 --- a/minecraft-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -1,5 +1,5 @@ ///! Connect to Minecraft servers. -use minecraft_protocol::{ +use azalea_protocol::{ connect::HandshakeConnection, packets::{ handshake::client_intention_packet::ClientIntentionPacket, diff --git a/minecraft-client/src/crypt.rs b/azalea-client/src/crypt.rs similarity index 100% rename from minecraft-client/src/crypt.rs rename to azalea-client/src/crypt.rs diff --git a/minecraft-client/src/lib.rs b/azalea-client/src/lib.rs similarity index 65% rename from minecraft-client/src/lib.rs rename to azalea-client/src/lib.rs index d4ceebde..8c1bcfe9 100644 --- a/minecraft-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -1,4 +1,4 @@ -//! Significantly abstract minecraft-protocol so it's actually useable for bots. +//! Significantly abstract azalea-protocol so it's actually useable for bots. pub mod connect; pub mod ping; diff --git a/minecraft-client/src/ping.rs b/azalea-client/src/ping.rs similarity index 98% rename from minecraft-client/src/ping.rs rename to azalea-client/src/ping.rs index ff869d4e..87ccdf66 100644 --- a/minecraft-client/src/ping.rs +++ b/azalea-client/src/ping.rs @@ -1,5 +1,5 @@ ///! Ping Minecraft servers. -use minecraft_protocol::{ +use azalea_protocol::{ connect::HandshakeConnection, packets::{ handshake::client_intention_packet::ClientIntentionPacket, diff --git a/minecraft-core/Cargo.toml b/azalea-core/Cargo.toml similarity index 87% rename from minecraft-core/Cargo.toml rename to azalea-core/Cargo.toml index e36cc03e..1aa59fe9 100644 --- a/minecraft-core/Cargo.toml +++ b/azalea-core/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "minecraft-core" +name = "azalea-core" version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/minecraft-core/src/lib.rs b/azalea-core/src/lib.rs similarity index 100% rename from minecraft-core/src/lib.rs rename to azalea-core/src/lib.rs diff --git a/minecraft-core/src/serializable_uuid.rs b/azalea-core/src/serializable_uuid.rs similarity index 100% rename from minecraft-core/src/serializable_uuid.rs rename to azalea-core/src/serializable_uuid.rs diff --git a/minecraft-protocol/Cargo.toml b/azalea-protocol/Cargo.toml similarity index 86% rename from minecraft-protocol/Cargo.toml rename to azalea-protocol/Cargo.toml index 3cbf663b..2b8a97f2 100644 --- a/minecraft-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "minecraft-protocol" +name = "azalea-protocol" version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -8,9 +8,9 @@ version = "0.1.0" [dependencies] async-recursion = "^0.3.2" async-trait = "0.1.51" +azalea-chat = {path = "../azalea-chat"} byteorder = "^1.4.3" bytes = "^1.1.0" -minecraft-chat = {path = "../minecraft-chat"} serde = {version = "1.0.130", features = ["serde_derive"]} serde_json = "^1.0.72" thiserror = "^1.0.30" diff --git a/minecraft-protocol/src/connect.rs b/azalea-protocol/src/connect.rs similarity index 100% rename from minecraft-protocol/src/connect.rs rename to azalea-protocol/src/connect.rs diff --git a/minecraft-protocol/src/lib.rs b/azalea-protocol/src/lib.rs similarity index 100% rename from minecraft-protocol/src/lib.rs rename to azalea-protocol/src/lib.rs diff --git a/minecraft-protocol/src/mc_buf.rs b/azalea-protocol/src/mc_buf.rs similarity index 100% rename from minecraft-protocol/src/mc_buf.rs rename to azalea-protocol/src/mc_buf.rs diff --git a/minecraft-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs similarity index 100% rename from minecraft-protocol/src/packets/game/mod.rs rename to azalea-protocol/src/packets/game/mod.rs diff --git a/minecraft-protocol/src/packets/handshake/client_intention_packet.rs b/azalea-protocol/src/packets/handshake/client_intention_packet.rs similarity index 100% rename from minecraft-protocol/src/packets/handshake/client_intention_packet.rs rename to azalea-protocol/src/packets/handshake/client_intention_packet.rs diff --git a/minecraft-protocol/src/packets/handshake/mod.rs b/azalea-protocol/src/packets/handshake/mod.rs similarity index 100% rename from minecraft-protocol/src/packets/handshake/mod.rs rename to azalea-protocol/src/packets/handshake/mod.rs diff --git a/minecraft-protocol/src/packets/login/clientbound_custom_query_packet.rs b/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs similarity index 100% rename from minecraft-protocol/src/packets/login/clientbound_custom_query_packet.rs rename to azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs diff --git a/minecraft-protocol/src/packets/login/clientbound_hello_packet.rs b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs similarity index 100% rename from minecraft-protocol/src/packets/login/clientbound_hello_packet.rs rename to azalea-protocol/src/packets/login/clientbound_hello_packet.rs diff --git a/minecraft-protocol/src/packets/login/mod.rs b/azalea-protocol/src/packets/login/mod.rs similarity index 100% rename from minecraft-protocol/src/packets/login/mod.rs rename to azalea-protocol/src/packets/login/mod.rs diff --git a/minecraft-protocol/src/packets/login/serverbound_hello_packet.rs b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs similarity index 100% rename from minecraft-protocol/src/packets/login/serverbound_hello_packet.rs rename to azalea-protocol/src/packets/login/serverbound_hello_packet.rs diff --git a/minecraft-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs similarity index 100% rename from minecraft-protocol/src/packets/mod.rs rename to azalea-protocol/src/packets/mod.rs diff --git a/minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs b/azalea-protocol/src/packets/status/clientbound_status_response_packet.rs similarity index 97% rename from minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs rename to azalea-protocol/src/packets/status/clientbound_status_response_packet.rs index 920e3484..1d8a3aa4 100644 --- a/minecraft-protocol/src/packets/status/clientbound_status_response_packet.rs +++ b/azalea-protocol/src/packets/status/clientbound_status_response_packet.rs @@ -1,4 +1,4 @@ -use minecraft_chat::component::Component; +use azalea_chat::component::Component; use serde::Deserialize; use serde_json::Value; use tokio::io::BufReader; diff --git a/minecraft-protocol/src/packets/status/mod.rs b/azalea-protocol/src/packets/status/mod.rs similarity index 100% rename from minecraft-protocol/src/packets/status/mod.rs rename to azalea-protocol/src/packets/status/mod.rs diff --git a/minecraft-protocol/src/packets/status/serverbound_status_request_packet.rs b/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs similarity index 100% rename from minecraft-protocol/src/packets/status/serverbound_status_request_packet.rs rename to azalea-protocol/src/packets/status/serverbound_status_request_packet.rs diff --git a/minecraft-protocol/src/read.rs b/azalea-protocol/src/read.rs similarity index 100% rename from minecraft-protocol/src/read.rs rename to azalea-protocol/src/read.rs diff --git a/minecraft-protocol/src/resolver.rs b/azalea-protocol/src/resolver.rs similarity index 100% rename from minecraft-protocol/src/resolver.rs rename to azalea-protocol/src/resolver.rs diff --git a/minecraft-protocol/src/write.rs b/azalea-protocol/src/write.rs similarity index 100% rename from minecraft-protocol/src/write.rs rename to azalea-protocol/src/write.rs diff --git a/bot/Cargo.toml b/bot/Cargo.toml index f1c89a99..fd6ad067 100644 --- a/bot/Cargo.toml +++ b/bot/Cargo.toml @@ -1,11 +1,11 @@ [package] +edition = "2021" name = "bot" version = "0.1.0" -edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -minecraft-client = { path = "../minecraft-client" } -minecraft-protocol = { path = "../minecraft-protocol" } +azalea-client = {path = "../azalea-client"} +azalea-protocol = {path = "../azalea-protocol"} tokio = "^1.14.0" diff --git a/bot/src/main.rs b/bot/src/main.rs index 19959ce5..9cfd7f9a 100644 --- a/bot/src/main.rs +++ b/bot/src/main.rs @@ -1,4 +1,4 @@ -use minecraft_client::connect::join_server; +use azalea_client::connect::join_server; use tokio::runtime::Runtime; async fn bot() {