Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.71 KB | None | 0 0
  1. package fr.minecraftforgefrance.client.custommenu;
  2.  
  3.  
  4.  
  5. import java.io.BufferedReader;
  6.  
  7. import java.io.IOException;
  8.  
  9. import java.io.InputStreamReader;
  10.  
  11. import java.lang.reflect.InvocationTargetException;
  12.  
  13. import java.net.URI;
  14.  
  15. import java.net.URISyntaxException;
  16.  
  17. import java.util.ArrayList;
  18.  
  19. import java.util.Calendar;
  20.  
  21. import java.util.Date;
  22.  
  23. import java.util.List;
  24.  
  25. import java.util.Random;
  26.  
  27.  
  28.  
  29. import net.minecraft.client.Minecraft;
  30.  
  31. import net.minecraft.client.gui.GuiButton;
  32.  
  33. import net.minecraft.client.gui.GuiButtonLanguage;
  34.  
  35. import net.minecraft.client.gui.GuiConfirmOpenLink;
  36.  
  37. import net.minecraft.client.gui.GuiLanguage;
  38.  
  39. import net.minecraft.client.gui.GuiMultiplayer;
  40.  
  41. import net.minecraft.client.gui.GuiOptions;
  42.  
  43. import net.minecraft.client.gui.GuiScreen;
  44.  
  45. import net.minecraft.client.gui.GuiSelectWorld;
  46.  
  47. import net.minecraft.client.gui.GuiYesNo;
  48.  
  49. import net.minecraft.client.gui.GuiYesNoCallback;
  50.  
  51. import net.minecraft.client.renderer.OpenGlHelper;
  52.  
  53. import net.minecraft.client.renderer.Tessellator;
  54.  
  55. import net.minecraft.client.renderer.texture.DynamicTexture;
  56.  
  57. import net.minecraft.client.resources.I18n;
  58.  
  59. import net.minecraft.util.EnumChatFormatting;
  60.  
  61. import net.minecraft.util.MathHelper;
  62.  
  63. import net.minecraft.util.ResourceLocation;
  64.  
  65. import net.minecraft.world.demo.DemoWorldServer;
  66.  
  67. import net.minecraft.world.storage.ISaveFormat;
  68.  
  69. import net.minecraft.world.storage.WorldInfo;
  70.  
  71. import net.minecraftforge.client.ForgeHooksClient;
  72.  
  73.  
  74.  
  75. import org.apache.commons.io.Charsets;
  76.  
  77. import org.apache.logging.log4j.LogManager;
  78.  
  79. import org.apache.logging.log4j.Logger;
  80.  
  81. import org.lwjgl.opengl.GL11;
  82.  
  83. import org.lwjgl.opengl.GLContext;
  84.  
  85. import org.lwjgl.util.glu.Project;
  86.  
  87.  
  88.  
  89. import com.google.common.base.Strings;
  90.  
  91. import com.google.common.collect.Lists;
  92.  
  93.  
  94.  
  95. import cpw.mods.fml.client.FMLClientHandler;
  96.  
  97. import cpw.mods.fml.client.GuiModList;
  98.  
  99. import cpw.mods.fml.common.FMLCommonHandler;
  100.  
  101. import cpw.mods.fml.relauncher.Side;
  102.  
  103. import cpw.mods.fml.relauncher.SideOnly;
  104.  
  105.  
  106.  
  107. @SideOnly(Side.CLIENT)
  108.  
  109. public class GuiCustomMainMenu extends GuiScreen implements GuiYesNoCallback
  110.  
  111. {
  112.  
  113. private static final Logger logger = LogManager.getLogger();
  114.  
  115. /** The RNG used by the Main Menu Screen. */
  116.  
  117. private static final Random rand = new Random();
  118.  
  119. /** Counts the number of screen updates. */
  120.  
  121. private float updateCounter;
  122.  
  123. /** The splash message. */
  124.  
  125. private String splashText;
  126.  
  127. private GuiButton buttonResetDemo;
  128.  
  129. /** Timer used to rotate the panorama, increases every tick. */
  130.  
  131. private int panoramaTimer;
  132.  
  133. /**
  134.  
  135. * Texture allocated for the current viewport of the main menu's panorama background.
  136.  
  137. */
  138.  
  139. private DynamicTexture viewportTexture;
  140.  
  141. private final Object field_104025_t = new Object();
  142.  
  143. private String field_92025_p;
  144.  
  145. private String field_146972_A;
  146.  
  147. private String field_104024_v;
  148.  
  149. private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt");
  150.  
  151. private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png");
  152.  
  153.  
  154.  
  155. private final ResourceLocation backGround = new ResourceLocation("modtutoriel", "textures/gui/menu.png"); // faut changer l'id du mod ici
  156.  
  157.  
  158.  
  159. public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information.";
  160.  
  161. private int field_92024_r;
  162.  
  163. private int field_92023_s;
  164.  
  165. private int field_92022_t;
  166.  
  167. private int field_92021_u;
  168.  
  169. private int field_92020_v;
  170.  
  171. private int field_92019_w;
  172.  
  173. private ResourceLocation field_110351_G;
  174.  
  175.  
  176.  
  177. public GuiCustomMainMenu()
  178.  
  179. {
  180.  
  181. this.field_146972_A = field_96138_a;
  182.  
  183. this.splashText = "missingno";
  184.  
  185. BufferedReader bufferedreader = null;
  186.  
  187.  
  188.  
  189. try
  190.  
  191. {
  192.  
  193. ArrayList arraylist = new ArrayList();
  194.  
  195. bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8));
  196.  
  197. String s;
  198.  
  199.  
  200.  
  201. while((s = bufferedreader.readLine()) != null)
  202.  
  203. {
  204.  
  205. s = s.trim();
  206.  
  207.  
  208.  
  209. if(!s.isEmpty())
  210.  
  211. {
  212.  
  213. arraylist.add(s);
  214.  
  215. }
  216.  
  217. }
  218.  
  219.  
  220.  
  221. if(!arraylist.isEmpty())
  222.  
  223. {
  224.  
  225. do
  226.  
  227. {
  228.  
  229. this.splashText = (String)arraylist.get(rand.nextInt(arraylist.size()));
  230.  
  231. }
  232.  
  233. while(this.splashText.hashCode() == 125780783);
  234.  
  235. }
  236.  
  237. }
  238.  
  239. catch(IOException ioexception1)
  240.  
  241. {
  242.  
  243. ;
  244.  
  245. }
  246.  
  247. finally
  248.  
  249. {
  250.  
  251. if(bufferedreader != null)
  252.  
  253. {
  254.  
  255. try
  256.  
  257. {
  258.  
  259. bufferedreader.close();
  260.  
  261. }
  262.  
  263. catch(IOException ioexception)
  264.  
  265. {
  266.  
  267. ;
  268.  
  269. }
  270.  
  271. }
  272.  
  273. }
  274.  
  275.  
  276.  
  277. this.updateCounter = rand.nextFloat();
  278.  
  279. this.field_92025_p = "";
  280.  
  281.  
  282.  
  283. if(!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b())
  284.  
  285. {
  286.  
  287. this.field_92025_p = I18n.format("title.oldgl1", new Object[0]);
  288.  
  289. this.field_146972_A = I18n.format("title.oldgl2", new Object[0]);
  290.  
  291. this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game";
  292.  
  293. }
  294.  
  295. }
  296.  
  297.  
  298.  
  299. /**
  300.  
  301. * Called from the main game loop to update the screen.
  302.  
  303. */
  304.  
  305. public void updateScreen()
  306.  
  307. {
  308.  
  309. ++this.panoramaTimer;
  310.  
  311. }
  312.  
  313.  
  314.  
  315. /**
  316.  
  317. * Returns true if this GUI should pause the game when it is displayed in single-player
  318.  
  319. */
  320.  
  321. public boolean doesGuiPauseGame()
  322.  
  323. {
  324.  
  325. return false;
  326.  
  327. }
  328.  
  329.  
  330.  
  331. /**
  332.  
  333. * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
  334.  
  335. */
  336.  
  337. protected void keyTyped(char p_73869_1_, int p_73869_2_)
  338.  
  339. {}
  340.  
  341.  
  342.  
  343. /**
  344.  
  345. * Adds the buttons (and other controls) to the screen in question.
  346.  
  347. */
  348.  
  349. public void initGui()
  350.  
  351. {
  352.  
  353. this.viewportTexture = new DynamicTexture(256, 256);
  354.  
  355. this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture);
  356.  
  357. Calendar calendar = Calendar.getInstance();
  358.  
  359. calendar.setTime(new Date());
  360.  
  361.  
  362.  
  363. if(calendar.get(2) + 1 == 11 && calendar.get(5) == 9)
  364.  
  365. {
  366.  
  367. this.splashText = "Happy birthday, ez!";
  368.  
  369. }
  370.  
  371. else if(calendar.get(2) + 1 == 6 && calendar.get(5) == 1)
  372.  
  373. {
  374.  
  375. this.splashText = "Happy birthday, Notch!";
  376.  
  377. }
  378.  
  379. else if(calendar.get(2) + 1 == 12 && calendar.get(5) == 24)
  380.  
  381. {
  382.  
  383. this.splashText = "Merry X-mas!";
  384.  
  385. }
  386.  
  387. else if(calendar.get(2) + 1 == 1 && calendar.get(5) == 1)
  388.  
  389. {
  390.  
  391. this.splashText = "Happy new year!";
  392.  
  393. }
  394.  
  395. else if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31)
  396.  
  397. {
  398.  
  399. this.splashText = "OOoooOOOoooo! Spooky!";
  400.  
  401. }
  402.  
  403.  
  404.  
  405. boolean flag = true;
  406.  
  407. int i = this.height / 4 + 48;
  408.  
  409.  
  410.  
  411. if(this.mc.isDemo())
  412.  
  413. {
  414.  
  415. this.addDemoButtons(i, 24);
  416.  
  417. }
  418.  
  419. else
  420.  
  421. {
  422.  
  423. this.addSingleplayerMultiplayerButtons(i, 24);
  424.  
  425. }
  426.  
  427.  
  428.  
  429. this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, I18n.format("menu.options", new Object[0])));
  430.  
  431. this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, I18n.format("menu.quit", new Object[0])));
  432.  
  433. Object object = this.field_104025_t;
  434.  
  435.  
  436.  
  437. synchronized(this.field_104025_t)
  438.  
  439. {
  440.  
  441. this.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p);
  442.  
  443. this.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A);
  444.  
  445. int j = Math.max(this.field_92023_s, this.field_92024_r);
  446.  
  447. this.field_92022_t = (this.width - j) / 2;
  448.  
  449. this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24;
  450.  
  451. this.field_92020_v = this.field_92022_t + j;
  452.  
  453. this.field_92019_w = this.field_92021_u + 24;
  454.  
  455. }
  456.  
  457. }
  458.  
  459.  
  460.  
  461. /**
  462.  
  463. * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game.
  464.  
  465. */
  466.  
  467. private void addSingleplayerMultiplayerButtons(int x, int y)
  468.  
  469. {
  470.  
  471. this.buttonList.add(new GuiButton(1, this.width / 3 - 120, x, 98, 20, I18n.format("\u00A7cJouer Solo")));
  472.  
  473. this.buttonList.add(new GuiButton(22, this.width / 2 + 102, x + 0, 98, 20, I18n.format("\u00A7cTeamspeak")));
  474.  
  475. GuiButton webSiteButton2 = new GuiButton(23, this.width / 3 + 155, x + y * 2, "\u00A7cVoter");
  476.  
  477. this.buttonList.add(new GuiButton(20, this.width / 2 - 96, 35 + y * 2, "\u00A7cRejoindre Silicium"));
  478.  
  479. GuiButton webSiteButton = new GuiButton(21, this.width / 3 - 100, x + y * 2, "\u00A7cSite");
  480.  
  481. webSiteButton.width = 100;
  482.  
  483. webSiteButton2.width = 100;
  484.  
  485. this.buttonList.add(webSiteButton);
  486.  
  487. this.buttonList.add(webSiteButton2);
  488.  
  489. }
  490.  
  491.  
  492.  
  493. /**
  494.  
  495. * Adds Demo buttons on Main Menu for players who are playing Demo.
  496.  
  497. */
  498.  
  499. private void addDemoButtons(int x, int y)
  500.  
  501. {
  502.  
  503. this.buttonList.add(new GuiButton(11, this.width / 2 - 100, x, I18n.format("menu.playdemo", new Object[0])));
  504.  
  505. this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, x + y * 1, I18n.format("menu.resetdemo", new Object[0])));
  506.  
  507. ISaveFormat isaveformat = this.mc.getSaveLoader();
  508.  
  509. WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
  510.  
  511.  
  512.  
  513. if(worldinfo == null)
  514.  
  515. {
  516.  
  517. this.buttonResetDemo.enabled = false;
  518.  
  519. }
  520.  
  521. }
  522.  
  523.  
  524.  
  525. protected void actionPerformed(GuiButton button)
  526.  
  527. {
  528.  
  529. if(button.id == 0)
  530.  
  531. {
  532.  
  533. this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
  534.  
  535. }
  536.  
  537.  
  538.  
  539. if(button.id == 5)
  540.  
  541. {
  542.  
  543. this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
  544.  
  545. }
  546.  
  547.  
  548.  
  549. if(button.id == 1)
  550.  
  551. {
  552.  
  553. this.mc.displayGuiScreen(new GuiSelectWorld(this));
  554.  
  555. }
  556.  
  557.  
  558.  
  559. if(button.id == 2)
  560.  
  561. {
  562.  
  563. this.mc.displayGuiScreen(new GuiMultiplayer(this));
  564.  
  565. }
  566.  
  567.  
  568.  
  569. if(button.id == 4)
  570.  
  571. {
  572.  
  573. this.mc.shutdown();
  574.  
  575. }
  576.  
  577.  
  578.  
  579. if(button.id == 11)
  580.  
  581. {
  582.  
  583. this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
  584.  
  585. }
  586.  
  587.  
  588.  
  589. if(button.id == 12)
  590.  
  591. {
  592.  
  593. ISaveFormat isaveformat = this.mc.getSaveLoader();
  594.  
  595. WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
  596.  
  597.  
  598.  
  599. if(worldinfo != null)
  600.  
  601. {
  602.  
  603. GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12);
  604.  
  605. this.mc.displayGuiScreen(guiyesno);
  606.  
  607. }
  608.  
  609. }
  610.  
  611.  
  612.  
  613. if(button.id == 20)
  614.  
  615. {
  616.  
  617. // TODO pour la connexion au serveur
  618.  
  619. FMLClientHandler.instance().connectToServerAtStartup("craft64.crystal-serv.com", 27485); // ip, port
  620.  
  621. }
  622.  
  623.  
  624.  
  625. if(button.id == 21)
  626.  
  627. {
  628.  
  629. try
  630.  
  631. {
  632.  
  633. Class oclass = Class.forName("java.awt.Desktop");
  634.  
  635. Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
  636.  
  637. oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://Silicium-mc.craftaserv.fr")});
  638.  
  639. }
  640.  
  641. catch(Throwable throwable)
  642.  
  643. {
  644.  
  645. logger.error("Couldn\'t open link", throwable);
  646.  
  647. }
  648.  
  649. }
  650.  
  651. if(button.id == 23)
  652.  
  653. {
  654.  
  655. try
  656.  
  657. {
  658.  
  659. Class oclass = Class.forName("java.awt.Desktop");
  660.  
  661. Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
  662.  
  663. oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://silicium-mc.craftaserv.fr/vote")});
  664.  
  665. }
  666.  
  667. catch(Throwable throwable)
  668.  
  669. {
  670.  
  671. logger.error("Couldn\'t open link", throwable);
  672.  
  673. }
  674.  
  675. }
  676.  
  677. }
  678.  
  679.  
  680.  
  681. public void confirmClicked(boolean p_73878_1_, int id)
  682.  
  683. {
  684.  
  685. if(p_73878_1_ && id == 12)
  686.  
  687. {
  688.  
  689. ISaveFormat isaveformat = this.mc.getSaveLoader();
  690.  
  691. isaveformat.flushCache();
  692.  
  693. isaveformat.deleteWorldDirectory("Demo_World");
  694.  
  695. this.mc.displayGuiScreen(this);
  696.  
  697. }
  698.  
  699. else if(id == 13)
  700.  
  701. {
  702.  
  703. if(p_73878_1_)
  704.  
  705. {
  706.  
  707. try
  708.  
  709. {
  710.  
  711. Class oclass = Class.forName("java.awt.Desktop");
  712.  
  713. Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
  714.  
  715. oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(this.field_104024_v)});
  716.  
  717. }
  718.  
  719. catch(Throwable throwable)
  720.  
  721. {
  722.  
  723. logger.error("Couldn\'t open link", throwable);
  724.  
  725. }
  726.  
  727. }
  728.  
  729.  
  730.  
  731. this.mc.displayGuiScreen(this);
  732.  
  733. }
  734.  
  735. }
  736.  
  737.  
  738.  
  739. private void renderBackGround()
  740.  
  741. {
  742.  
  743. GL11.glViewport(0, 0, 256, 256);
  744.  
  745. this.mc.getTextureManager().bindTexture(backGround);
  746.  
  747. GL11.glDisable(GL11.GL_TEXTURE_2D);
  748.  
  749. GL11.glEnable(GL11.GL_TEXTURE_2D);
  750.  
  751. GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
  752.  
  753. Tessellator tessellator = Tessellator.instance;
  754.  
  755. tessellator.startDrawingQuads();
  756.  
  757. GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
  758.  
  759. GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
  760.  
  761. tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
  762.  
  763. int k = this.width;
  764.  
  765. int l = this.height;
  766.  
  767. tessellator.addVertexWithUV(0, 0, this.zLevel, 0, 0);
  768.  
  769. tessellator.addVertexWithUV(0, l, this.zLevel, 0, 1);
  770.  
  771. tessellator.addVertexWithUV(k, l, this.zLevel, 1, 1);
  772.  
  773. tessellator.addVertexWithUV(k, 0, this.zLevel, 1, 0);
  774.  
  775. tessellator.draw();
  776.  
  777. }
  778.  
  779.  
  780.  
  781. /**
  782.  
  783. * Draws the screen and all the components in it.
  784.  
  785. */
  786.  
  787. public void drawScreen(int x, int y, float partialTick)
  788.  
  789. {
  790.  
  791. GL11.glDisable(GL11.GL_ALPHA_TEST);
  792.  
  793. this.renderBackGround();
  794.  
  795. GL11.glEnable(GL11.GL_ALPHA_TEST);
  796.  
  797. Tessellator tessellator = Tessellator.instance;
  798.  
  799. short short1 = 274;
  800.  
  801. int k = this.width / 2 - short1 / 2;
  802.  
  803. byte b0 = 30;
  804.  
  805. this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
  806.  
  807. this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
  808.  
  809. this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
  810.  
  811. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  812.  
  813.  
  814.  
  815. if((double)this.updateCounter < 1.0E-4D)
  816.  
  817. {
  818.  
  819. this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44);
  820.  
  821. this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44);
  822.  
  823. this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44);
  824.  
  825. this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44);
  826.  
  827. this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
  828.  
  829. }
  830.  
  831. else
  832.  
  833. {
  834.  
  835. this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44);
  836.  
  837. this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
  838.  
  839. }
  840.  
  841.  
  842.  
  843. tessellator.setColorOpaque_I(-1);
  844.  
  845. GL11.glPushMatrix();
  846.  
  847. GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
  848.  
  849. GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
  850.  
  851. float f1 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
  852.  
  853. f1 = f1 * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32);
  854.  
  855. GL11.glScalef(f1, f1, f1);
  856.  
  857. this.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, -256);
  858.  
  859. GL11.glPopMatrix();
  860.  
  861. String s = "Minecraft 1.7.10";
  862.  
  863.  
  864.  
  865. if(this.mc.isDemo())
  866.  
  867. {
  868.  
  869. s = s + " Demo";
  870.  
  871. }
  872.  
  873.  
  874.  
  875. List <string>brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true));
  876.  
  877. for(int i = 0; i < brandings.size(); i++)
  878.  
  879. {
  880.  
  881. String brd = brandings.get(i);
  882.  
  883. if(!Strings.isNullOrEmpty(brd))
  884.  
  885. {
  886.  
  887. this.drawString(this.fontRendererObj, brd, 2, this.height - (10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215);
  888.  
  889. }
  890.  
  891. }
  892.  
  893. String s1 = "\u00A74By KrushHD";
  894.  
  895. this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
  896.  
  897.  
  898.  
  899. if(this.field_92025_p != null && this.field_92025_p.length() > 0)
  900.  
  901. {
  902.  
  903. drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512);
  904.  
  905. this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
  906.  
  907. this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1);
  908.  
  909. }
  910.  
  911.  
  912.  
  913. super.drawScreen(x, y, partialTick);
  914.  
  915. }
  916.  
  917.  
  918.  
  919. /**
  920.  
  921. * Called when the mouse is clicked.
  922.  
  923. */
  924.  
  925. protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
  926.  
  927. {
  928.  
  929. super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
  930.  
  931. Object object = this.field_104025_t;
  932.  
  933.  
  934.  
  935. synchronized(this.field_104025_t)
  936.  
  937. {
  938.  
  939. 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)
  940.  
  941. {
  942.  
  943. GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true);
  944.  
  945. guiconfirmopenlink.func_146358_g();
  946.  
  947. this.mc.displayGuiScreen(guiconfirmopenlink);
  948.  
  949. }
  950.  
  951. }
  952.  
  953. }
  954.  
  955. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement