Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

AltLogin code by me c:

MasterOf13FPS

Administrator
Staff member
Administrator
MasterOf13FPS
Joined
Jul 11, 2020
Messages
0
Reaction score
25
Points
0
package net.crack.main.gui;

import java.io.IOException;
import java.net.Proxy;

import org.lwjgl.input.Keyboard;

import com.mojang.authlib.Agent;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;

import net.crack.main.Client;
import net.crack.main.utils.Wrapper;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.Session;

public class GuiAltLogin extends GuiScreen {

private GuiScreen guiScreen;
private GuiTextField login;

public GuiAltLogin(GuiScreen guiScreen) {
this.guiScreen = guiScreen;
}

@Override
public void initGui() {
this.buttonList.add(new GuiButton(9, this.width / 2 - 100, this.height / 4 + 105, "Login"));
this.buttonList.add(new GuiButton(10, this.width / 2 - 100, this.height / 4 + 130, I18n.format("gui.back", new Object[0])));
this.login = new GuiTextField(0, fontRendererObj, width / 2 - 100, height / 4, 200, 20);
this.login.setMaxStringLength(500);
}

@Override
public void updateScreen() {
this.login.updateCursorCounter();
}

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
this.login.textboxKeyTyped(typedChar, keyCode);
if (keyCode == Keyboard.KEY_TAB) {
this.login.setFocused(!this.login.isFocused());
}

if (keyCode == Keyboard.KEY_RETURN) {
if (!this.login.getText().isEmpty()) {
actionPerformed((GuiButton) this.buttonList.get(0));
} else {
status = "�4You have to paste an Alt before!";
}
}
super.keyTyped(typedChar, keyCode);
}

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
this.login.mouseClicked(mouseX, mouseY, mouseButton);
super.mouseClicked(mouseX, mouseY, mouseButton);
}

private String status = "�7Waiting...";

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.login.drawTextBox();
String paste = "�8Paste Alt here:";
if (!this.login.isFocused() && this.login.getText().isEmpty()) {
Wrapper.getInstance().getSmallFont().drawStringWithShadow(paste, this.width / 2 - 98, height / 4 + 4, Client.getInstance().getColor());
}
Wrapper.getInstance().getNormalFont().drawStringWithShadow(status, this.width / 2 - Wrapper.getInstance().getNormalFont().getRealStringWidth(status) / 2, 10, Client.getInstance().getColor());
super.drawScreen(mouseX, mouseY, partialTicks);
}

@Override
protected void actionPerformed(GuiButton button) throws IOException {
switch (button.id) {
case 9:
if (!this.login.getText().isEmpty()) {
String erfolgreich = "�rSuccessfully logged in!";
String nichtakzeptabel = "�4Error: Couldn't login!";

String eingabe = login.getText().trim();
String[] data = eingabe.split(":");
YggdrasilUserAuthentication a = (YggdrasilUserAuthentication) new YggdrasilAuthenticationService(Proxy.NO_PROXY, "").createUserAuthentication(Agent.MINECRAFT);
a.setUsername(data[0]);
try {
a.setPassword(data[1]);
} catch (Exception e) {
status = "�4Error: This isn't an alt!";
}

try {
a.logIn();
mc.session = new Session(a.getSelectedProfile().getName(), a.getSelectedProfile().getId().toString(), a.getAuthenticatedToken(), "mojang");
status = erfolgreich;
} catch (Exception e) {
status = nichtakzeptabel;
}

} else {
status = "�4You have to paste an Alt before!";
}
break;
case 10:
this.mc.displayGuiScreen(guiScreen);
break;
}
}
}
 
Last edited by a moderator:
Du hast die Codetags vergessen min jung und wenn möglich auch HIDE/HRPLY benutzen

//@FantaCoke @Aui bitte mal fixen
 
Und "�" Mit "§" Ersetzen oder "&"
 
this is off a youtube video lmao
 
Edited by Aui: Added Spoiler Tags
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top