aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-01-06 18:16:11 -0600
committermat <git@matdoes.dev>2024-01-06 18:16:11 -0600
commit5ea127114582e3320381d09e880f6a433ccb8710 (patch)
tree0a6f56ecf94260334a11ce81b532226346cb86ba
parent1347f3549282397be6a46b8b7cb76a7900d0690a (diff)
downloadazalea-drasl-5ea127114582e3320381d09e880f6a433ccb8710.tar.xz
add doc comment about d=
-rwxr-xr-xazalea-auth/src/auth.rs9
-rwxr-xr-xazalea-block/src/generated.rs1
-rw-r--r--azalea-inventory/src/slot.rs8
3 files changed, 14 insertions, 4 deletions
diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs
index 67a45aa3..7b5846c4 100755
--- a/azalea-auth/src/auth.rs
+++ b/azalea-auth/src/auth.rs
@@ -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,
@@ -418,9 +421,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"
diff --git a/azalea-block/src/generated.rs b/azalea-block/src/generated.rs
index 97236b4b..5267c9a1 100755
--- a/azalea-block/src/generated.rs
+++ b/azalea-block/src/generated.rs
@@ -5380,4 +5380,3 @@ make_block_states! {
},
}
}
-
diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs
index 814b6c37..c4f8da05 100644
--- a/azalea-inventory/src/slot.rs
+++ b/azalea-inventory/src/slot.rs
@@ -71,6 +71,14 @@ impl ItemSlot {
}
}
}
+
+ /// Convert this slot into an [`ItemSlotData`], if it's present.
+ pub fn as_present(&self) -> Option<&ItemSlotData> {
+ match self {
+ ItemSlot::Empty => None,
+ ItemSlot::Present(i) => Some(i),
+ }
+ }
}
/// An item in an inventory, with a count and NBT. Usually you want [`ItemSlot`]