Advertisement
Guest User

GuiMainMenu

a guest
Apr 4th, 2020
1,569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 24.83 KB | None | 0 0
  1. package net.minecraft.client.gui;
  2.  
  3. import cpw.mods.fml.client.GuiModList;
  4. import cpw.mods.fml.common.FMLCommonHandler;
  5. import cpw.mods.fml.relauncher.Side;
  6. import cpw.mods.fml.relauncher.SideOnly;
  7. import java.io.BufferedReader;
  8. import java.io.IOException;
  9. import java.io.InputStreamReader;
  10. import java.net.URI;
  11. import java.util.ArrayList;
  12. import java.util.Calendar;
  13. import java.util.Date;
  14. import java.util.List;
  15. import java.util.Random;
  16. import net.minecraft.client.Minecraft;
  17. import net.minecraft.client.renderer.OpenGlHelper;
  18. import net.minecraft.client.renderer.Tessellator;
  19. import net.minecraft.client.renderer.texture.DynamicTexture;
  20. import net.minecraft.client.resources.I18n;
  21. import net.minecraft.realms.RealmsBridge;
  22. import net.minecraft.util.EnumChatFormatting;
  23. import net.minecraft.util.MathHelper;
  24. import net.minecraft.util.ResourceLocation;
  25. import net.minecraft.world.demo.DemoWorldServer;
  26. import net.minecraft.world.storage.ISaveFormat;
  27. import net.minecraft.world.storage.WorldInfo;
  28. import net.minecraftforge.client.ForgeHooksClient;
  29. import org.apache.commons.io.Charsets;
  30. import org.apache.logging.log4j.LogManager;
  31. import org.apache.logging.log4j.Logger;
  32. import org.lwjgl.Sys;
  33. import org.lwjgl.opengl.GL11;
  34. import org.lwjgl.opengl.GLContext;
  35. import org.lwjgl.util.glu.Project;
  36.  
  37. import com.google.common.base.Strings;
  38. import com.google.common.collect.Lists;
  39.  
  40. @SideOnly(Side.CLIENT)
  41. public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback
  42. {
  43.     private static final Logger logger = LogManager.getLogger();
  44.     /** The RNG used by the Main Menu Screen. */
  45.     private static final Random rand = new Random();
  46.     /** Counts the number of screen updates. */
  47.     private float updateCounter;
  48.     /** The splash message. */
  49.     private String splashText;
  50.     private GuiButton buttonResetDemo;
  51.     /** Timer used to rotate the panorama, increases every tick. */
  52.     private int panoramaTimer;
  53.     /** Texture allocated for the current viewport of the main menu's panorama background. */
  54.     private DynamicTexture viewportTexture;
  55.     private final Object field_104025_t = new Object();
  56.     private String field_92025_p;
  57.     private String field_146972_A;
  58.     private String field_104024_v;
  59.     private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt");
  60.     private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/logo.png");
  61.     private static final ResourceLocation background = new ResourceLocation("textures/gui/title/background/background.jpg");
  62.     /** An array of all the paths to the panorama pictures. */
  63.     private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")};
  64.     public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information.";
  65.     private int field_92024_r;
  66.     private int field_92023_s;
  67.     private int field_92022_t;
  68.     private int field_92021_u;
  69.     private int field_92020_v;
  70.     private int field_92019_w;
  71.     private ResourceLocation field_110351_G;
  72.     private static final String __OBFID = "CL_00001154";
  73.    
  74.     private static final String DISCORD_URL = "";
  75.     private static final String SITE_URL = "";
  76.     private static final String PROFILE = "HiTech 1.7.10";
  77.  
  78.     public GuiMainMenu()
  79.     {
  80.         this.field_146972_A = field_96138_a;
  81.         this.splashText = "missingno";
  82.         BufferedReader bufferedreader = null;
  83.  
  84.         try
  85.         {
  86.             ArrayList arraylist = new ArrayList();
  87.             bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8));
  88.             String s;
  89.  
  90.             while ((s = bufferedreader.readLine()) != null)
  91.             {
  92.                 s = s.trim();
  93.  
  94.                 if (!s.isEmpty())
  95.                 {
  96.                     arraylist.add(s);
  97.                 }
  98.             }
  99.  
  100.             if (!arraylist.isEmpty())
  101.             {
  102.                 do
  103.                 {
  104.                     this.splashText = (String)arraylist.get(rand.nextInt(arraylist.size()));
  105.                 }
  106.                 while (this.splashText.hashCode() == 125780783);
  107.             }
  108.         }
  109.         catch (IOException ioexception1)
  110.         {
  111.             ;
  112.         }
  113.         finally
  114.         {
  115.             if (bufferedreader != null)
  116.             {
  117.                 try
  118.                 {
  119.                     bufferedreader.close();
  120.                 }
  121.                 catch (IOException ioexception)
  122.                 {
  123.                     ;
  124.                 }
  125.             }
  126.         }
  127.  
  128.         this.updateCounter = rand.nextFloat();
  129.         this.field_92025_p = "";
  130.  
  131.         if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b())
  132.         {
  133.             this.field_92025_p = I18n.format("title.oldgl1", new Object[0]);
  134.             this.field_146972_A = I18n.format("title.oldgl2", new Object[0]);
  135.             this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game";
  136.         }
  137.     }
  138.  
  139.     /**
  140.      * Called from the main game loop to update the screen.
  141.      */
  142.     public void updateScreen()
  143.     {
  144.         ++this.panoramaTimer;
  145.     }
  146.  
  147.     /**
  148.      * Returns true if this GUI should pause the game when it is displayed in single-player
  149.      */
  150.     public boolean doesGuiPauseGame()
  151.     {
  152.         return false;
  153.     }
  154.  
  155.     /**
  156.      * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
  157.      */
  158.     protected void keyTyped(char p_73869_1_, int p_73869_2_) {}
  159.  
  160.     /**
  161.      * Adds the buttons (and other controls) to the screen in question.
  162.      */
  163.     public void initGui()
  164.     {
  165.         this.viewportTexture = new DynamicTexture(256, 256);
  166.         this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture);
  167.         Calendar calendar = Calendar.getInstance();
  168.         calendar.setTime(new Date());
  169.  
  170.         if (calendar.get(2) + 1 == 11 && calendar.get(5) == 9)
  171.         {
  172.             this.splashText = "Happy birthday, ez!";
  173.         }
  174.         else if (calendar.get(2) + 1 == 6 && calendar.get(5) == 1)
  175.         {
  176.             this.splashText = "Happy birthday, Notch!";
  177.         }
  178.         else if (calendar.get(2) + 1 == 12 && calendar.get(5) == 24)
  179.         {
  180.             this.splashText = "Merry X-mas!";
  181.         }
  182.         else if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1)
  183.         {
  184.             this.splashText = "Happy new year!";
  185.         }
  186.         else if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31)
  187.         {
  188.             this.splashText = "OOoooOOOoooo! Spooky!";
  189.         }
  190.  
  191.         boolean flag = true;
  192.         int i = this.height / 4 + 48;
  193.  
  194.         if (this.mc.isDemo())
  195.         {
  196.             this.addDemoButtons(i, 24);
  197.         }
  198.         else
  199.         {
  200.             this.addSingleplayerMultiplayerButtons(i, 24);
  201.         }
  202.  
  203.         this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72, 98, 20, I18n.format("menu.options", new Object[0])));
  204.         this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72, 98, 20, I18n.format("menu.quit", new Object[0])));
  205.         //this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, i + 72 + 12));
  206.         Object object = this.field_104025_t;
  207.  
  208.         synchronized (this.field_104025_t)
  209.         {
  210.             this.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p);
  211.             this.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A);
  212.             int j = Math.max(this.field_92023_s, this.field_92024_r);
  213.             this.field_92022_t = (this.width - j) / 2;
  214.             this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24;
  215.             this.field_92020_v = this.field_92022_t + j;
  216.             this.field_92019_w = this.field_92021_u + 24;
  217.         }
  218.     }
  219.  
  220.     /**
  221.      * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game.
  222.      */
  223.     private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_)
  224.     {
  225.         this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0])));
  226.         this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0])));
  227.         GuiButton realmsButton = new GuiButton(14, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, "Discord");
  228.         GuiButton fmlModButton = new GuiButton(6, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, "\u0421\u0430\u0439\u0442");
  229.         fmlModButton.xPosition = this.width / 2 + 2;
  230.         realmsButton.width = 98;
  231.         fmlModButton.width = 98;
  232.         this.buttonList.add(realmsButton);
  233.         this.buttonList.add(fmlModButton);
  234.     }
  235.  
  236.     /**
  237.      * Adds Demo buttons on Main Menu for players who are playing Demo.
  238.      */
  239.     private void addDemoButtons(int p_73972_1_, int p_73972_2_)
  240.     {
  241.         this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
  242.         this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0])));
  243.         ISaveFormat isaveformat = this.mc.getSaveLoader();
  244.         WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
  245.  
  246.         if (worldinfo == null)
  247.         {
  248.             this.buttonResetDemo.enabled = false;
  249.         }
  250.     }
  251.  
  252.     protected void actionPerformed(GuiButton p_146284_1_)
  253.     {
  254.         if (p_146284_1_.id == 0)
  255.         {
  256.             this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
  257.         }
  258.  
  259.         //if (p_146284_1_.id == 5)
  260.         //{
  261.         //    this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
  262.         //}
  263.  
  264.         if (p_146284_1_.id == 1)
  265.         {
  266.             this.mc.displayGuiScreen(new GuiSelectWorld(this));
  267.         }
  268.  
  269.         if (p_146284_1_.id == 2)
  270.         {
  271.             this.mc.displayGuiScreen(new GuiMultiplayer(this));
  272.         }
  273.  
  274.         if (p_146284_1_.id == 14)
  275.         {
  276.             //this.func_140005_i();
  277.             Sys.openURL(DISCORD_URL);
  278.         }
  279.  
  280.         if (p_146284_1_.id == 4)
  281.         {
  282.             this.mc.shutdown();
  283.         }
  284.  
  285.         if (p_146284_1_.id == 6)
  286.         {
  287.             //this.mc.displayGuiScreen(new GuiModList(this));
  288.             Sys.openURL(SITE_URL);
  289.         }
  290.  
  291.         if (p_146284_1_.id == 11)
  292.         {
  293.             this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
  294.         }
  295.  
  296.         if (p_146284_1_.id == 12)
  297.         {
  298.             ISaveFormat isaveformat = this.mc.getSaveLoader();
  299.             WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
  300.  
  301.             if (worldinfo != null)
  302.             {
  303.                 GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12);
  304.                 this.mc.displayGuiScreen(guiyesno);
  305.             }
  306.         }
  307.     }
  308.  
  309.     private void func_140005_i()
  310.     {
  311.         RealmsBridge realmsbridge = new RealmsBridge();
  312.         realmsbridge.switchToRealms(this);
  313.     }
  314.  
  315.     public void confirmClicked(boolean p_73878_1_, int p_73878_2_)
  316.     {
  317.         if (p_73878_1_ && p_73878_2_ == 12)
  318.         {
  319.             ISaveFormat isaveformat = this.mc.getSaveLoader();
  320.             isaveformat.flushCache();
  321.             isaveformat.deleteWorldDirectory("Demo_World");
  322.             this.mc.displayGuiScreen(this);
  323.         }
  324.         else if (p_73878_2_ == 13)
  325.         {
  326.             if (p_73878_1_)
  327.             {
  328.                 try
  329.                 {
  330.                     Class oclass = Class.forName("java.awt.Desktop");
  331.                     Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
  332.                     oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(this.field_104024_v)});
  333.                 }
  334.                 catch (Throwable throwable)
  335.                 {
  336.                     logger.error("Couldn\'t open link", throwable);
  337.                 }
  338.             }
  339.  
  340.             this.mc.displayGuiScreen(this);
  341.         }
  342.     }
  343.  
  344.     /**
  345.      * Draws the main menu panorama
  346.      */
  347.     private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_)
  348.     {
  349.         Tessellator tessellator = Tessellator.instance;
  350.         GL11.glMatrixMode(GL11.GL_PROJECTION);
  351.         GL11.glPushMatrix();
  352.         GL11.glLoadIdentity();
  353.         Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F);
  354.         GL11.glMatrixMode(GL11.GL_MODELVIEW);
  355.         GL11.glPushMatrix();
  356.         GL11.glLoadIdentity();
  357.         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  358.         GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
  359.         GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
  360.         GL11.glEnable(GL11.GL_BLEND);
  361.         GL11.glDisable(GL11.GL_ALPHA_TEST);
  362.         GL11.glDisable(GL11.GL_CULL_FACE);
  363.         GL11.glDepthMask(false);
  364.         OpenGlHelper.glBlendFunc(770, 771, 1, 0);
  365.         byte b0 = 8;
  366.  
  367.         for (int k = 0; k < b0 * b0; ++k)
  368.         {
  369.             GL11.glPushMatrix();
  370.             float f1 = ((float)(k % b0) / (float)b0 - 0.5F) / 64.0F;
  371.             float f2 = ((float)(k / b0) / (float)b0 - 0.5F) / 64.0F;
  372.             float f3 = 0.0F;
  373.             GL11.glTranslatef(f1, f2, f3);
  374.             GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F);
  375.             GL11.glRotatef(-((float)this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F);
  376.  
  377.             for (int l = 0; l < 6; ++l)
  378.             {
  379.                 GL11.glPushMatrix();
  380.  
  381.                 if (l == 1)
  382.                 {
  383.                     GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
  384.                 }
  385.  
  386.                 if (l == 2)
  387.                 {
  388.                     GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
  389.                 }
  390.  
  391.                 if (l == 3)
  392.                 {
  393.                     GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
  394.                 }
  395.  
  396.                 if (l == 4)
  397.                 {
  398.                     GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
  399.                 }
  400.  
  401.                 if (l == 5)
  402.                 {
  403.                     GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
  404.                 }
  405.  
  406.                 this.mc.getTextureManager().bindTexture(titlePanoramaPaths[l]);
  407.                 tessellator.startDrawingQuads();
  408.                 tessellator.setColorRGBA_I(16777215, 255 / (k + 1));
  409.                 float f4 = 0.0F;
  410.                 tessellator.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + f4), (double)(0.0F + f4));
  411.                 tessellator.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - f4), (double)(0.0F + f4));
  412.                 tessellator.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - f4), (double)(1.0F - f4));
  413.                 tessellator.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + f4), (double)(1.0F - f4));
  414.                 tessellator.draw();
  415.                 GL11.glPopMatrix();
  416.             }
  417.  
  418.             GL11.glPopMatrix();
  419.             GL11.glColorMask(true, true, true, false);
  420.         }
  421.  
  422.         tessellator.setTranslation(0.0D, 0.0D, 0.0D);
  423.         GL11.glColorMask(true, true, true, true);
  424.         GL11.glMatrixMode(GL11.GL_PROJECTION);
  425.         GL11.glPopMatrix();
  426.         GL11.glMatrixMode(GL11.GL_MODELVIEW);
  427.         GL11.glPopMatrix();
  428.         GL11.glDepthMask(true);
  429.         GL11.glEnable(GL11.GL_CULL_FACE);
  430.         GL11.glEnable(GL11.GL_DEPTH_TEST);
  431.     }
  432.  
  433.     /**
  434.      * Rotate and blurs the skybox view in the main menu
  435.      */
  436.     private void rotateAndBlurSkybox(float p_73968_1_)
  437.     {
  438.         this.mc.getTextureManager().bindTexture(this.field_110351_G);
  439.         GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
  440.         GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
  441.         GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
  442.         GL11.glEnable(GL11.GL_BLEND);
  443.         OpenGlHelper.glBlendFunc(770, 771, 1, 0);
  444.         GL11.glColorMask(true, true, true, false);
  445.         Tessellator tessellator = Tessellator.instance;
  446.         tessellator.startDrawingQuads();
  447.         GL11.glDisable(GL11.GL_ALPHA_TEST);
  448.         byte b0 = 3;
  449.  
  450.         for (int i = 0; i < b0; ++i)
  451.         {
  452.             tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(i + 1));
  453.             int j = this.width;
  454.             int k = this.height;
  455.             float f1 = (float)(i - b0 / 2) / 256.0F;
  456.             tessellator.addVertexWithUV((double)j, (double)k, (double)this.zLevel, (double)(0.0F + f1), 1.0D);
  457.             tessellator.addVertexWithUV((double)j, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 1.0D);
  458.             tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 0.0D);
  459.             tessellator.addVertexWithUV(0.0D, (double)k, (double)this.zLevel, (double)(0.0F + f1), 0.0D);
  460.         }
  461.  
  462.         tessellator.draw();
  463.         GL11.glEnable(GL11.GL_ALPHA_TEST);
  464.         GL11.glColorMask(true, true, true, true);
  465.     }
  466.  
  467.     /**
  468.      * Renders the skybox in the main menu
  469.      */
  470.     private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_)
  471.     {
  472.         this.mc.getFramebuffer().unbindFramebuffer();
  473.         GL11.glViewport(0, 0, 256, 256);
  474.         this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_);
  475.         this.rotateAndBlurSkybox(p_73971_3_);
  476.         this.rotateAndBlurSkybox(p_73971_3_);
  477.         this.rotateAndBlurSkybox(p_73971_3_);
  478.         this.rotateAndBlurSkybox(p_73971_3_);
  479.         this.rotateAndBlurSkybox(p_73971_3_);
  480.         this.rotateAndBlurSkybox(p_73971_3_);
  481.         this.rotateAndBlurSkybox(p_73971_3_);
  482.         this.mc.getFramebuffer().bindFramebuffer(true);
  483.         GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
  484.         Tessellator tessellator = Tessellator.instance;
  485.         tessellator.startDrawingQuads();
  486.         float f1 = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height;
  487.         float f2 = (float)this.height * f1 / 256.0F;
  488.         float f3 = (float)this.width * f1 / 256.0F;
  489.         tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
  490.         int k = this.width;
  491.         int l = this.height;
  492.         tessellator.addVertexWithUV(0.0D, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F + f3));
  493.         tessellator.addVertexWithUV((double)k, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F - f3));
  494.         tessellator.addVertexWithUV((double)k, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F - f3));
  495.         tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F + f3));
  496.         tessellator.draw();
  497.     }
  498.  
  499.     /**
  500.      * Draws the screen and all the components in it.
  501.      */
  502.     public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
  503.     {
  504.         Tessellator tessellator = Tessellator.instance;
  505.         //GL11.glDisable(GL11.GL_ALPHA_TEST);
  506.         //this.renderSkybox(p_73863_1_, p_73863_2_, p_73863_3_);
  507.  
  508.         mc.getTextureManager().bindTexture(background);
  509.         tessellator.startDrawingQuads();
  510.         tessellator.addVertexWithUV(0, height, 0, 0.0, 1.0);
  511.         tessellator.addVertexWithUV(width, height, 0, 1.0, 1.0);
  512.         tessellator.addVertexWithUV(width, 0, 0, 1.0, 0.0);
  513.         tessellator.addVertexWithUV(0, 0, 0, 0.0, 0.0);
  514.         tessellator.draw();
  515.  
  516.         GL11.glEnable(GL11.GL_ALPHA_TEST);
  517.         /*
  518.         short short1 = 274;
  519.         int k = this.width / 2 - short1 / 2;
  520.         byte b0 = 30;
  521.         this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
  522.         this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
  523.         this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
  524.         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  525.  
  526.         if ((double)this.updateCounter < 1.0E-4D)
  527.         {
  528.             this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44);
  529.             this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44);
  530.             this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44);
  531.             this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44);
  532.             this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
  533.         }
  534.         else
  535.         {
  536.             this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44);
  537.             this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
  538.         }
  539.         */
  540.        
  541.         this.mc.getTextureManager().bindTexture(this.minecraftTitleTextures);
  542.         int k = -this.height / 4;
  543.         int b = -15;
  544.         tessellator.startDrawingQuads();
  545.         tessellator.addVertexWithUV(width / 2 - 128, height / 2 - 16 + k + b, 1, 0.0, 0.0);
  546.         tessellator.addVertexWithUV(width / 2 + 128, height / 2 - 16 + k + b, 1, 1.0, 0.0);
  547.         tessellator.addVertexWithUV(width / 2 + 128, height / 2 + 16 + k + b, 1, 1.0, 1.0);
  548.         tessellator.addVertexWithUV(width / 2 - 128, height / 2 + 16 + k + b, 1, 0.0, 1.0);
  549.         tessellator.draw();
  550.  
  551.         tessellator.setColorOpaque_I(-1);
  552.         GL11.glPushMatrix();
  553.         GL11.glTranslatef((float)(this.width / 2 + 90), (float)(height / 2 + k), 0.0F);
  554.         GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
  555.         float f1 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
  556.         f1 = f1 * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32);
  557.         GL11.glScalef(f1, f1, f1);
  558.         this.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, -256);
  559.         GL11.glPopMatrix();
  560.         String s = "Minecraft 1.7.10";
  561.  
  562.         if (this.mc.isDemo())
  563.         {
  564.             s = s + " Demo";
  565.         }
  566.        
  567.         /*
  568.         List<String> brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true));
  569.         for (int i = 0; i < brandings.size(); i++)
  570.         {
  571.             String brd = brandings.get(i);
  572.             if (!Strings.isNullOrEmpty(brd))
  573.             {
  574.                 this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215);
  575.             }
  576.         }
  577.         */
  578.        
  579.         ForgeHooksClient.renderMainMenu(this, fontRendererObj, width, height);
  580.         String s1 = "\u0410\u0432\u0442\u043e\u0440\u0441\u0442\u0432\u043e: Mojang AB. \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b: Dronald";
  581.         String s2 = "\u041a\u043b\u0438\u0435\u043d\u0442: " + PROFILE;
  582.         String s3 = "\u0410\u043a\u043a\u0430\u0443\u043d\u0442: " + mc.getSession().getUsername();
  583.         this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
  584.         this.drawString(this.fontRendererObj, s2, 2, this.height - 10, -1);
  585.         this.drawString(this.fontRendererObj, s3, 2, 2, -1);
  586.         if (this.field_92025_p != null && this.field_92025_p.length() > 0)
  587.         {
  588.             drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512);
  589.             this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
  590.             this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1);
  591.         }
  592.  
  593.         super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
  594.     }
  595.  
  596.     /**
  597.      * Called when the mouse is clicked.
  598.      */
  599.     protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
  600.     {
  601.         super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
  602.         Object object = this.field_104025_t;
  603.  
  604.         synchronized (this.field_104025_t)
  605.         {
  606.             if (this.field_92025_p.length() > 0 && p_73864_1_ >= this.field_92022_t && p_73864_1_ <= this.field_92020_v && p_73864_2_ >= this.field_92021_u && p_73864_2_ <= this.field_92019_w)
  607.             {
  608.                 GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true);
  609.                 guiconfirmopenlink.func_146358_g();
  610.                 this.mc.displayGuiScreen(guiconfirmopenlink);
  611.             }
  612.         }
  613.     }
  614. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement