Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.callofcaos.lorien.altmanager;
- import java.io.IOException;
- import java.util.List;
- import java.util.Random;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiTextField;
- import net.minecraft.util.Session;
- import org.lwjgl.input.Keyboard;
- import me.callofcaos.lorien.utils.LorienUtils;
- import me.callofcaos.lorien.utils.Values;
- public class GuiDirectLogin
- extends GuiScreen
- {
- public GuiScreen parent;
- public GuiTextField usernameBox;
- public GuiTextField passwordBox;
- public GuiTextField sessionBox;
- public GuiDirectLogin(GuiScreen paramScreen)
- {
- this.parent = paramScreen;
- }
- public void initGui()
- {
- Keyboard.enableRepeatEvents(true);
- this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96 + 12, "Login"));
- this.buttonList.add(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 96 + 36, "Relog"));
- this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 96 + 70, "Random Alt"));
- this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96 + 106, "Back"));
- this.usernameBox = new GuiTextField(3, this.mc.fontRendererObj, this.width / 2 - 100, 51, 200, 20);
- this.passwordBox = new GuiTextField(4, this.mc.fontRendererObj, this.width / 2 - 100, 91, 200, 20);
- }
- public void onGuiClosed()
- {
- Keyboard.enableRepeatEvents(false);
- }
- public void updateScreen()
- {
- this.usernameBox.updateCursorCounter();
- this.passwordBox.updateCursorCounter();
- }
- public void mouseClicked(int x, int y, int b)
- {
- this.usernameBox.mouseClicked(x, y, b);
- this.passwordBox.mouseClicked(x, y, b);
- try
- {
- super.mouseClicked(x, y, b);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
- public static String lastusername = "";
- public static String lastpassword = "";
- protected void actionPerformed(GuiButton par1GuiButton)
- {
- if (par1GuiButton.id == 1)
- {
- if (this.usernameBox.getText().length() > 0) {
- new Thread()
- {
- public void run()
- {
- GuiDirectLogin.lastusername = GuiDirectLogin.this.usernameBox.getText();
- GuiDirectLogin.lastpassword = GuiDirectLogin.this.passwordBox.getText();
- Values.premium = LorienUtils.login(GuiDirectLogin.this.usernameBox.getText(), GuiDirectLogin.this.passwordBox.getText());
- }
- }.start();
- }
- }
- else if (par1GuiButton.id == 2)
- {
- Minecraft.getMinecraft().displayGuiScreen(this.parent);
- }
- else if (par1GuiButton.id == 3)
- {
- new Thread()
- {
- public void run()
- {
- Values.premium = LorienUtils.login(GuiDirectLogin.lastusername, GuiDirectLogin.lastpassword);
- }
- }.start();
- }
- else if (par1GuiButton.id == 4)
- {
- final Random r = new Random();
- }
- }
- public void keyTyped(char ch, int key)
- {
- if (key == 1) {
- Minecraft.getMinecraft().displayGuiScreen(this.parent);
- }
- this.usernameBox.textboxKeyTyped(ch, key);
- this.passwordBox.textboxKeyTyped(ch, key);
- if (key == 15) {
- if (this.usernameBox.isFocused())
- {
- this.usernameBox.setFocused(false);
- this.passwordBox.setFocused(true);
- }
- else
- {
- this.usernameBox.setFocused(true);
- this.passwordBox.setFocused(false);
- }
- }
- if (key == 28) {
- actionPerformed((GuiButton)this.buttonList.get(0));
- }
- if (key == 13) {
- actionPerformed((GuiButton)this.buttonList.get(0));
- }
- ((GuiButton)this.buttonList.get(0)).enabled = (this.usernameBox.getText().length() > 3);
- }
- public void drawScreen(int x, int y, float f)
- {
- drawDefaultBackground();
- drawString(this.mc.fontRendererObj, "Username", this.width / 2 - 100, 38, 10526880);
- drawString(this.mc.fontRendererObj, "§4*", this.width / 2 - 106, 38, 10526880);
- drawString(this.mc.fontRendererObj, "Password", this.width / 2 - 100, 79, 10526880);
- if (Values.premium) {
- this.mc.fontRendererObj.drawString("Username: §7" + this.mc.session.getUsername(), 3, 3, 16777215);
- } else {
- this.mc.fontRendererObj.drawString("Cracked as: §7" + this.mc.session.getUsername(), 3, 3, 16777215);
- }
- try
- {
- this.usernameBox.drawTextBox();
- this.passwordBox.drawTextBox();
- }
- catch (Exception err)
- {
- err.printStackTrace();
- }
- super.drawScreen(x, y, f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement