Deleted useless code.

This commit is contained in:
FlorianMichael 2023-10-02 00:19:36 +02:00
parent f88407f0bd
commit 8c7ece3004
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 4 additions and 11 deletions

View File

@ -1,13 +1,12 @@
package de.florianmichael.viafabricplus.definition.authlib;
import com.mojang.authlib.yggdrasil.response.KeyPairResponse;
import java.nio.ByteBuffer;
/*
This library is part of the AuthLib, we are overwriting this class to add a new field.
*/
public record KeyPairResponseBypass(KeyPair keyPair, ByteBuffer publicKeySignatureV2, ByteBuffer publicKeySignature /* own field */, String expiresAt, String refreshedAfter) {
public record KeyPair(String privateKey, String publicKey) {
}
public record KeyPairResponseBypass(KeyPairResponse.KeyPair keyPair, ByteBuffer publicKeySignatureV2, ByteBuffer publicKeySignature /* own field */, String expiresAt, String refreshedAfter) {
}

View File

@ -47,13 +47,7 @@ public class MixinYggdrasilUserApiService {
final var response = minecraftClient.post(routeKeyPair, KeyPairResponseBypass.class);
if (response == null) return;
final var keyPair = response.keyPair();
final var returnValue = new KeyPairResponse(
keyPair == null ? null : new KeyPairResponse.KeyPair(keyPair.privateKey(), keyPair.publicKey()),
response.publicKeySignatureV2(),
response.expiresAt(),
response.refreshedAfter()
);
final var returnValue = new KeyPairResponse(response.keyPair(), response.publicKeySignatureV2(), response.expiresAt(), response.refreshedAfter());
((IKeyPairResponse) (Object) returnValue).viafabricplus_setLegacyPublicKeySignature(response.publicKeySignature());
cir.setReturnValue(returnValue);