diff options
| author | mat <git@matdoes.dev> | 2024-01-06 18:16:11 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-01-06 18:16:11 -0600 |
| commit | 5ea127114582e3320381d09e880f6a433ccb8710 (patch) | |
| tree | 0a6f56ecf94260334a11ce81b532226346cb86ba | |
| parent | 1347f3549282397be6a46b8b7cb76a7900d0690a (diff) | |
| download | azalea-drasl-5ea127114582e3320381d09e880f6a433ccb8710.tar.xz | |
add doc comment about d=
| -rwxr-xr-x | azalea-auth/src/auth.rs | 9 | ||||
| -rwxr-xr-x | azalea-block/src/generated.rs | 1 | ||||
| -rw-r--r-- | azalea-inventory/src/slot.rs | 8 |
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`] |
