Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Apr 20, 2024
2 parents 68bb32c + f919fb6 commit 3fb3faf
Show file tree
Hide file tree
Showing 102 changed files with 2,743 additions and 1,661 deletions.
1,212 changes: 604 additions & 608 deletions Cargo.lock

Large diffs are not rendered by default.

Empty file modified Cargo.toml
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
A collection of Rust crates for making Minecraft bots, clients, and tools.

<p align="center">
<img src="https://cdn.matdoes.dev/images/flowering_azalea.webp" alt="Azalea" height="200">
<img src="https://github.com/azalea-rs/azalea/assets/27899617/b98a42df-5cf0-4d1f-ae7c-ecca333e3cab" alt="Azalea" height="200">
</p>


<!-- The line below is automatically read and updated by the migrate script, so don't change it manually. -->

_Currently supported Minecraft version: `1.20.4`._
Expand Down
24 changes: 12 additions & 12 deletions azalea-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ edition = "2021"
license = "MIT"
name = "azalea-auth"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-auth"
version = "0.9.0"
version = "0.9.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
azalea-buf = { path = "../azalea-buf", version = "0.9.0" }
azalea-crypto = { path = "../azalea-crypto", version = "0.9.0" }
base64 = "0.21.5"
chrono = { version = "0.4.31", default-features = false, features = ["serde"] }
base64 = "0.22.0"
chrono = { version = "0.4.38", default-features = false, features = ["serde"] }
tracing = "0.1.40"
num-bigint = "0.4.4"
once_cell = "1.18.0"
reqwest = { version = "0.11.22", default-features = false, features = [
once_cell = "1.19.0"
reqwest = { version = "0.12.4", default-features = false, features = [
"json",
"rustls-tls",
] }
rsa = "0.9.6"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
thiserror = "1.0.50"
tokio = { version = "1.34.0", features = ["fs"] }
uuid = { version = "1.6.1", features = ["serde", "v3"] }
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
thiserror = "1.0.58"
tokio = { version = "1.37.0", features = ["fs"] }
uuid = { version = "1.8.0", features = ["serde", "v3"] }
md-5 = "0.10.6"

[dev-dependencies]
env_logger = "0.10.1"
tokio = { version = "1.34.0", features = ["full"] }
env_logger = "0.11.3"
tokio = { version = "1.37.0", features = ["full"] }
12 changes: 8 additions & 4 deletions azalea-auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
///
/// If you don't have a Microsoft auth token, you can get it from
/// [`get_ms_link_code`] and then [`get_ms_auth_token`].
///
/// If you got the MSA token from your own app (as opposed to the default
/// Nintendo Switch one), you may have to prepend "d=" to the token.
pub async fn get_minecraft_token(
client: &reqwest::Client,
msa: &str,
Expand Down Expand Up @@ -235,6 +238,7 @@ pub struct MinecraftAuthResponse {
pub struct GameOwnershipResponse {
pub items: Vec<GameOwnershipItem>,
pub signature: String,
#[serde(rename = "keyId")]
pub key_id: String,
}

Expand Down Expand Up @@ -418,9 +422,9 @@ async fn auth_with_xbox_live(
"Properties": {
"AuthMethod": "RPS",
"SiteName": "user.auth.xboxlive.com",
// i thought this was supposed to be d={} but it doesn't work for
// me when i add it ??????
"RpsTicket": format!("{access_token}")
// this value should have "d=" prepended if you're using your own app (as opposed to
// the default nintendo switch one)
"RpsTicket": access_token
},
"RelyingParty": "http://auth.xboxlive.com",
"TokenType": "JWT"
Expand Down Expand Up @@ -522,7 +526,7 @@ pub enum CheckOwnershipError {
Http(#[from] reqwest::Error),
}

async fn check_ownership(
pub async fn check_ownership(
client: &reqwest::Client,
minecraft_access_token: &str,
) -> Result<bool, CheckOwnershipError> {
Expand Down
2 changes: 1 addition & 1 deletion azalea-block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "MIT"
name = "azalea-block"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block"
version = "0.9.0"
version = "0.9.1"

[lib]

Expand Down
8 changes: 4 additions & 4 deletions azalea-block/azalea-block-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ edition = "2021"
license = "MIT"
name = "azalea-block-macros"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block/azalea-block-macros"
version = "0.9.0"
version = "0.9.1"

[lib]
proc-macro = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
proc-macro2 = "1.0.70"
quote = "1.0.33"
syn = "2.0.39"
proc-macro2 = "1.0.81"
quote = "1.0.36"
syn = "2.0.60"
2 changes: 1 addition & 1 deletion azalea-block/azalea-block-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use quote::quote;
use std::collections::HashMap;
use std::fmt::Write;
use syn::{
self, braced,
braced,
ext::IdentExt,
parenthesized,
parse::{Parse, ParseStream, Result},
Expand Down
1 change: 0 additions & 1 deletion azalea-block/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5380,4 +5380,3 @@ make_block_states! {
},
}
}

3 changes: 3 additions & 0 deletions azalea-block/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![doc = include_str!("../README.md")]
#![feature(trait_upcasting)]

mod behavior;
mod generated;
Expand Down Expand Up @@ -58,6 +59,8 @@ impl BlockState {
state_id <= Self::max_state()
}

/// Returns true if the block is air. This only checks for normal air, not
/// other types like cave air.
#[inline]
pub fn is_air(&self) -> bool {
self == &Self::AIR
Expand Down
2 changes: 1 addition & 1 deletion azalea-brigadier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "MIT"
name = "azalea-brigadier"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-brigadier"
version = "0.9.0"
version = "0.9.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 2 additions & 2 deletions azalea-brigadier/src/context/command_context_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'a, S> CommandContextBuilder<'a, S> {
}

pub fn with_command(&mut self, command: &Command<S>) -> &Self {
self.command = command.clone();
self.command.clone_from(command);
self
}
pub fn with_child(&mut self, child: Rc<CommandContextBuilder<'a, S>>) -> &Self {
Expand All @@ -80,7 +80,7 @@ impl<'a, S> CommandContextBuilder<'a, S> {
range,
});
self.range = StringRange::encompassing(&self.range, &range);
self.modifier = node.read().modifier.clone();
self.modifier.clone_from(&node.read().modifier);
self.forks = node.read().forks;
self
}
Expand Down
8 changes: 4 additions & 4 deletions azalea-buf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ edition = "2021"
license = "MIT"
name = "azalea-buf"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-buf"
version = "0.9.0"
version = "0.9.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
simdnbt = { version = "0.4", git = "https://github.com/azalea-rs/simdnbt" }
azalea-buf-macros = { path = "./azalea-buf-macros", version = "0.9.0" }
byteorder = "^1.5.0"
tracing = "0.1.40"
serde_json = { version = "^1.0", optional = true }
thiserror = "1.0.50"
uuid = "^1.6.1"
simdnbt = "0.3"
thiserror = "1.0.58"
uuid = "^1.8.0"

[features]
serde_json = ["dep:serde_json"]
8 changes: 4 additions & 4 deletions azalea-buf/azalea-buf-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ edition = "2021"
license = "MIT"
name = "azalea-buf-macros"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-buf"
version = "0.9.0"
version = "0.9.1"

[lib]
proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
proc-macro2 = "^1.0.70"
quote = "^1.0.33"
syn = { version = "^2.0.39", features = ["extra-traits"] }
proc-macro2 = "^1.0.81"
quote = "^1.0.36"
syn = { version = "^2.0.60", features = ["extra-traits"] }
2 changes: 1 addition & 1 deletion azalea-buf/azalea-buf-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod write;

use proc_macro::TokenStream;
use quote::quote;
use syn::{self, parse_macro_input, DeriveInput};
use syn::{parse_macro_input, DeriveInput};

#[proc_macro_derive(McBufReadable, attributes(var))]
pub fn derive_mcbufreadable(input: TokenStream) -> TokenStream {
Expand Down
2 changes: 1 addition & 1 deletion azalea-buf/azalea-buf-macros/src/read.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use quote::{quote, ToTokens};
use syn::{self, punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident};
use syn::{punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident};

fn read_named_fields(
named: &Punctuated<Field, Comma>,
Expand Down
2 changes: 1 addition & 1 deletion azalea-buf/azalea-buf-macros/src/write.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use proc_macro2::Span;
use quote::{quote, ToTokens};
use syn::{self, punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident};
use syn::{punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident};

fn write_named_fields(
named: &Punctuated<Field, Comma>,
Expand Down
4 changes: 2 additions & 2 deletions azalea-buf/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl McBufVarWritable for i32 {
}
while value != 0 {
buffer[0] = (value & 0b0111_1111) as u8;
value = (value >> 7) & (i32::max_value() >> 6);
value = (value >> 7) & (i32::MAX >> 6);
if value != 0 {
buffer[0] |= 0b1000_0000;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ impl McBufVarWritable for i64 {
}
while value != 0 {
buffer[0] = (value & 0b0111_1111) as u8;
value = (value >> 7) & (i64::max_value() >> 6);
value = (value >> 7) & (i64::MAX >> 6);
if value != 0 {
buffer[0] |= 0b1000_0000;
}
Expand Down
8 changes: 4 additions & 4 deletions azalea-chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "MIT"
name = "azalea-chat"
repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-chat"
version = "0.9.0"
version = "0.9.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -19,9 +19,9 @@ azalea-buf = { path = "../azalea-buf", features = [
"serde_json",
], version = "0.9.0", optional = true }
azalea-language = { path = "../azalea-language", version = "0.9.0" }
simdnbt = { version = "0.3", optional = true }
simdnbt = { version = "0.4", optional = true, git = "https://github.com/azalea-rs/simdnbt" }
tracing = "0.1.40"
once_cell = "1.18.0"
once_cell = "1.19.0"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0.108"
serde_json = "^1.0.116"
azalea-registry = { path = "../azalea-registry", version = "0.9.0", optional = true }
Loading

0 comments on commit 3fb3faf

Please sign in to comment.