Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. package fr.titanium.proxy;
  2.  
  3. import cpw.mods.fml.client.FMLClientHandler;
  4. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  5. import cpw.mods.fml.relauncher.Side;
  6. import cpw.mods.fml.relauncher.SideOnly;
  7. import net.minecraft.client.gui.GuiButton;
  8. import net.minecraft.client.gui.GuiMainMenu;
  9. import net.minecraft.client.gui.GuiScreen;
  10. import net.minecraft.client.gui.GuiYesNoCallback;
  11. import net.minecraft.client.renderer.texture.DynamicTexture;
  12. import net.minecraft.util.ResourceLocation;
  13. import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
  14. import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
  15. import net.minecraftforge.common.MinecraftForge;
  16.  
  17. public class ClientProxy extends CommonProxy {
  18.  
  19. @Override
  20. public void registerRenders() {
  21.  
  22.  
  23. }
  24.  
  25. public ClientProxy( ) {
  26. MinecraftForge.EVENT_BUS.register(this);
  27.  
  28.  
  29. }
  30.  
  31.  
  32.  
  33. @SubscribeEvent
  34. public void onInitGuiEvent(InitGuiEvent.Post event) {
  35. if (event.gui instanceof GuiMainMenu) {
  36. for (Object b : event.buttonList) {
  37. if (((GuiButton) b).id == 14) {
  38. ((GuiButton) b).enabled = false ;
  39. ((GuiButton) b).visible = false ;
  40.  
  41. }
  42. }
  43.  
  44. for (Object b : event.buttonList) {
  45. if (((GuiButton) b).id == 0) {
  46. ((GuiButton) b).enabled = false ;
  47. ((GuiButton) b).visible = false ;
  48.  
  49. }
  50. }
  51.  
  52. for (Object b : event.buttonList) {
  53. if (((GuiButton) b).id == 4) {
  54. ((GuiButton) b).enabled = true ;
  55. ((GuiButton) b).visible = true ;
  56.  
  57. }
  58. }
  59.  
  60. for (Object b : event.buttonList) {
  61. if (((GuiButton) b).id == 5) {
  62. ((GuiButton) b).enabled = false ;
  63. ((GuiButton) b).visible = false ;
  64.  
  65. }
  66. }
  67.  
  68. for (Object b : event.buttonList) {
  69. if (((GuiButton) b).id == 1) {
  70. ((GuiButton) b).enabled = false ;
  71. ((GuiButton) b).visible = false ;
  72.  
  73. }
  74. }
  75.  
  76. for (Object b : event.buttonList) {
  77. if (((GuiButton) b).id == 2) {
  78. ((GuiButton) b).enabled = false ;
  79. ((GuiButton) b).visible = false ;
  80.  
  81. }
  82. }
  83.  
  84. for (Object b : event.buttonList) {
  85. if (((GuiButton) b).id == 6) {
  86. ((GuiButton) b).enabled = false ;
  87. ((GuiButton) b).visible = false ;
  88.  
  89. }
  90. }
  91.  
  92.  
  93. int i = event.gui.height / 4 + 30;
  94. event.buttonList.add(new GuiButton(30, event.gui.width / 2 - 100, i + 24 * 2, "Titanium") {
  95. @Override
  96. public void mouseReleased(int x, int y) {
  97.  
  98. }
  99. });}
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. }
  114.  
  115. @SubscribeEvent
  116. public void onActionPerformed(ActionPerformedEvent.Pre event)
  117. {
  118. if (event.gui instanceof GuiMainMenu)
  119. {
  120.  
  121.  
  122. if(event.button.id == 30)
  123. {
  124. FMLClientHandler.instance().setupServerList();
  125. FMLClientHandler.instance().connectToServerAtStartup("g6.hmserv.eu",25568);
  126. }
  127.  
  128.  
  129. }
  130.  
  131.  
  132.  
  133.  
  134.  
  135. }
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement