1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

Merge branch 'main' into options

This commit is contained in:
mat 2022-10-20 22:16:52 -05:00
commit 8d0322cbe7
4 changed files with 9 additions and 9 deletions

View file

@ -69,7 +69,8 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
let profile: ProfileResponse; let profile: ProfileResponse;
let minecraft_access_token: String; let minecraft_access_token: String;
if let Some(account) = &cached_account && !account.mca.is_expired() { if cached_account.is_some() && !cached_account.as_ref().unwrap().mca.is_expired() {
let account = cached_account.as_ref().unwrap();
// the minecraft auth data is cached and not expired, so we can just // the minecraft auth data is cached and not expired, so we can just
// use that instead of doing auth all over again :) // use that instead of doing auth all over again :)
profile = account.profile.clone(); profile = account.profile.clone();
@ -102,7 +103,7 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
// Minecraft auth // Minecraft auth
let mca = auth_with_minecraft(&client, &xbl_auth.data.user_hash, &xsts_token).await?; let mca = auth_with_minecraft(&client, &xbl_auth.data.user_hash, &xsts_token).await?;
minecraft_access_token = mca minecraft_access_token = mca
.get() .get()
.expect("Minecraft auth shouldn't have expired yet") .expect("Minecraft auth shouldn't have expired yet")
.access_token .access_token
@ -129,7 +130,8 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
profile: profile.clone(), profile: profile.clone(),
}, },
) )
.await { .await
{
log::error!("{}", e); log::error!("{}", e);
} }
} }

View file

@ -1,5 +1,3 @@
#![feature(let_chains)]
mod auth; mod auth;
mod cache; mod cache;
pub mod game_profile; pub mod game_profile;

View file

@ -171,9 +171,10 @@ impl Shapes {
); );
let var8 = BitSetDiscreteVoxelShape::join(&a.shape(), &b.shape(), &var5, &var6, &var7, op); let var8 = BitSetDiscreteVoxelShape::join(&a.shape(), &b.shape(), &var5, &var6, &var7, op);
// if var5.is_discrete_cube_merger() // if var5.is_discrete_cube_merger()
if let IndexMerger::DiscreteCube { .. } = var5
&& let IndexMerger::DiscreteCube { .. } = var6 if matches!(var5, IndexMerger::DiscreteCube { .. })
&& let IndexMerger::DiscreteCube { .. } = var7 && matches!(var6, IndexMerger::DiscreteCube { .. })
&& matches!(var7, IndexMerger::DiscreteCube { .. })
{ {
VoxelShape::Cube(CubeVoxelShape::new(DiscreteVoxelShape::BitSet(var8))) VoxelShape::Cube(CubeVoxelShape::new(DiscreteVoxelShape::BitSet(var8)))
} else { } else {

View file

@ -1,5 +1,4 @@
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(let_chains)]
pub mod collision; pub mod collision;