removed debug, fixed MFA impl in ClassiCube

This commit is contained in:
FlorianMichael 2023-03-26 04:57:05 +02:00
parent 2acf382942
commit a104c92a7c
4 changed files with 6 additions and 7 deletions

View File

@ -54,13 +54,14 @@ public class ViaFabricPlus {
// Classic Stuff
CustomClassicProtocolExtensions.create();
ClassicItemSelectionScreen.create();
ChatLengthCalculation.create();
ClassicProtocolCommands.create();
ClassiCubeAccountHandler.create();
// Bedrock Stuff
BedrockAccountHandler.create();
// Protocol Translator
ChatLengthCalculation.create();
new ProtocolHack();
FinishMinecraftLoadCallback.EVENT.register(() -> {

View File

@ -63,7 +63,7 @@ public class ClassiCubeAccount {
processHandler.handleException(throwable1);
return;
}
if (initialTokenResponse.mfaRequired()) {
if (loginResponse.mfaRequired()) {
processHandler.handleMfa(this);
return;
}

View File

@ -29,10 +29,7 @@ public class ViaFabricPlusClassicMPPassProvider extends ClassicMPPassProvider {
@Override
public String getMpPass(UserConnection user) {
if (classiCubeMPPass != null) {
System.out.println(classiCubeMPPass);
return classiCubeMPPass;
}
if (classiCubeMPPass != null) return classiCubeMPPass;
if (MPPassSettings.INSTANCE.useBetaCraftAuthentication.getValue()) {
final HandshakeStorage handshakeStorage = user.get(HandshakeStorage.class);

View File

@ -59,6 +59,7 @@ public class ClassiCubeMFAScreen extends Screen {
mfaField.setPlaceholder(Text.literal("MFA"));
this.addDrawableChild(ButtonWidget.builder(Text.literal("Login"), button -> {
status = Text.translatable("classicube.viafabricplus.loading");
ClassiCubeAccountHandler.INSTANCE.getAccount().login(new ILoginProcessHandler() {
@Override
public void handleMfa(ClassiCubeAccount account) {
@ -94,7 +95,7 @@ public class ClassiCubeMFAScreen extends Screen {
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.renderBackground(matrices);
drawCenteredTextWithShadow(matrices, this.textRenderer, this.title, this.width / 2, 70, 16777215);
drawCenteredTextWithShadow(matrices, this.textRenderer, this.status, this.width / 2, 70 + textRenderer.fontHeight, 16777215);
drawCenteredTextWithShadow(matrices, this.textRenderer, this.status, this.width / 2, 1, 16777215);
super.render(matrices, mouseX, mouseY, delta);
}
}