Navigation

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SOLVED GUI qui ne s'ouvre qu'en solo

    1.7.x
    1.7.10
    4
    14
    1545
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PlayFlop_ last edited by

      Bonjour, je m’explique,
      j’ai créer un GUI, en solo aucun soucis
      mais une fois que je me connecte a un serveur
      J’ouvre le gui et il est vide, il n’y a aucun bouton ^^
      Je sais pas d’ou vient cette erreur ^^

      1 Reply Last reply Reply Quote 0
      • Deleted
        Deleted last edited by

        Bonjour, pouvons nous avoir ta classe Gui et la manière dont tu le display, merci d’avance

        1 Reply Last reply Reply Quote 0
        • P
          PlayFlop_ last edited by

          @‘Plaigon’:

          Bonjour, pouvons nous avoir ta classe Gui et la manière d’ou tu le display, merci d’avance

          package fr.playflop.extania.client.menu;
          
          import cpw.mods.fml.relauncher.Side;
          
          import cpw.mods.fml.relauncher.SideOnly;
          
          import java.awt.Desktop;
          import java.net.URI;
          import java.util.List;
          
          import fr.playflop.extania.client.cps.settings.GuiSettings;
          import fr.playflop.extania.client.keystroke.render.GuiScreenKeystrokes;
          import fr.playflop.extania.client.radio.GuiRadio;
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.entity.EntityClientPlayerMP;
          import net.minecraft.client.gui.GuiButton;
          import net.minecraft.client.gui.GuiMainMenu;
          import net.minecraft.client.gui.GuiOptions;
          import net.minecraft.client.gui.GuiScreen;
          import net.minecraft.client.gui.achievement.GuiAchievements;
          import net.minecraft.client.gui.achievement.GuiStats;
          import net.minecraft.client.multiplayer.WorldClient;
          import net.minecraft.client.resources.I18n;
          import net.minecraft.util.EnumChatFormatting;
          import net.minecraft.util.Session;
          
          public class GuiExtaOption
            extends GuiScreen
          {
            private static final GuiScreen LOL = null;
          private int a;
            private int b;
          
            public void initGui()
            {
              this.a = 0;
              this.buttonList.clear();
              int i = -16;
              int j = 1;
              //this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + i, EnumChatFormatting.AQUA + "" + I18n.format("bouton.Deconnecter.name", new Object[0])));
              if (!this.mc.isIntegratedServerRunning()) {
                ((GuiButton)this.buttonList.get(0)).displayString = (EnumChatFormatting.AQUA + "" + I18n.format("bouton.Deconnecter.name", new Object[0]));
              }
              this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 2 + 60 + i, EnumChatFormatting.RED + "" + "Retourner en jeu"));
              this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 2 + 30 + i, EnumChatFormatting.AQUA + "" + "Particules"));
              this.buttonList.add(new GuiButton(6, this.width / 2 - 100, this.height / 2 + 10 + i, EnumChatFormatting.AQUA + "" + "Radio Extania"));
              this.buttonList.add(new GuiButton(7, this.width / 2 - 100, this.height / 2 - 10 + i, EnumChatFormatting.AQUA + "" + "KeyStrokesMod"));
              this.buttonList.add(new GuiButton(8, this.width / 2 - 100, this.height / 2 - 30 + i, EnumChatFormatting.AQUA + "" + "CPS"));
              this.buttonList.add(new GuiButton(9, this.width / 2 - 100, this.height / 2 - 50 + i, EnumChatFormatting.AQUA + "" + "Effect de Potion"));
              this.buttonList.add(new GuiButton(10, this.width / 2 - 100, this.height / 2 - 70 + i, EnumChatFormatting.AQUA + "" + "Armures"));
              //this.buttonList.add(new GuiButton(9, this.width / 2 - 22, this.height / 2 - 50 + i, EnumChatFormatting.AQUA + "" + "SideBar"));
              //this.buttonList.add(new GuiButton(10, this.width / 2 - 22, this.height / 2 - 70 + i, EnumChatFormatting.AQUA + "" + "Sprint"));
              //this.buttonList.add(new GuiButton(6, this.width / 2 - 22, this.height / 4 + 48 + i, 122, 20, EnumChatFormatting.AQUA + "" + "Stats"));
              //this.buttonList.add(new GuiButton(25, this.width / 2 - 100, this.height / 4 + 24 + i, 72, 20, EnumChatFormatting.YELLOW + "" + "Site"));
              //this.buttonList.add(new GuiButton(40, this.width / 2 - 100, this.height / 4 + 96 + i, 72, 20, EnumChatFormatting.BLUE + "" + "Forum"));
              //this.buttonList.add(new GuiButton(26, this.width / 2 - 100, this.height / 4 + 72 + i, 72, 20, EnumChatFormatting.GREEN + "" + "Teamspeak"));
              //this.buttonList.add(new GuiButton(10000, this.width / 2 - 100, this.height / 4 + 48 + i, 72, 20, EnumChatFormatting.DARK_PURPLE + "" + "Boutique"));/**/
            }
          
            public boolean doesGuiPauseGame()
            {
              return false;
            }
          
            protected void actionPerformed(GuiButton paramGuiButton)
            {
              Desktop localDesktop = null;
              switch (paramGuiButton.id)
              {
              case 0: 
                this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
                break;
              case 1: 
                paramGuiButton.enabled = false;
                this.mc.theWorld.sendQuittingDisconnectingPacket();
                this.mc.loadWorld((WorldClient)null);
                this.mc.displayGuiScreen(new GuiMainMenu());
                break;
              case 2: 
              case 3: 
              default: 
                break;
              case 4: 
                this.mc.displayGuiScreen((GuiScreen)null);
                this.mc.setIngameFocus();
                break;
              case 5: 
              Minecraft.getMinecraft().displayGuiScreen(new GuiParticules());
                break;
              case 6: 
              Minecraft.getMinecraft().displayGuiScreen(new GuiRadio());
                break;
              case 7: 
              Minecraft.getMinecraft().displayGuiScreen(new GuiScreenKeystrokes());
                break;
              case 8: 
              Minecraft.getMinecraft().displayGuiScreen(new GuiSettings());
                break;
              case 9: 
              Minecraft.getMinecraft().thePlayer.sendChatMessage("/statuseffect config");
                break;
              case 10: 
              Minecraft.getMinecraft().thePlayer.sendChatMessage("/armorstatus config");
                break;
              case 25: 
                try
                {
                  URI localURI1 = new URI("http://extania-pvp.livehost.fr/");
                  if (Desktop.isDesktopSupported())
                  {
                    localDesktop = Desktop.getDesktop();
                    localDesktop.browse(localURI1);
                  }
                }
                   catch (Exception localException1)
                {
                  localException1.printStackTrace();
                }
          
              case 40: 
                try
                {
                  URI localURI2 = new URI("http://extania-pvp.livehost.fr/?page=forum");
                  if (Desktop.isDesktopSupported())
                  {
                    localDesktop = Desktop.getDesktop();
                    localDesktop.browse(localURI2);
                  }
                }
                catch (Exception localException2)
                {
                  localException2.printStackTrace();
                }
              case 26: 
                try
                {
                  URI localURI3 = new URI("ts3server://eu2.freets3.ovh:3850&nickname=" + Minecraft.getMinecraft().getSession().getUsername());
                  if (Desktop.isDesktopSupported())
                  {
                    localDesktop = Desktop.getDesktop();
                    localDesktop.browse(localURI3);
                  }
                }
                catch (Exception localException3)
                {
                  localException3.printStackTrace();
                }
              case 10000: 
                try
                {
                  URI localURI4 = new URI("http://extania-pvp.livehost.fr/?&page=boutique");
                  if (Desktop.isDesktopSupported())
                  {
                    localDesktop = Desktop.getDesktop();
                    localDesktop.browse(localURI4);
                  }
                }
                catch (Exception localException4)
                {
                  localException4.printStackTrace();
                }
              }
            }
          
          public void updateScreen()
            {
              super.updateScreen();
              this.b += 1;
            }
          
            public void drawScreen(int paramInt1, int paramInt2, float paramFloat)
            {
              drawDefaultBackground();
              //drawCenteredString(this.fontRendererObj, EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + "–-[" + EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + "" + "Exta" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "" + "nia" + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + "" + "]–- ", this.width / 2, 20, 16777215);
              drawCenteredString(this.fontRendererObj, EnumChatFormatting.GOLD + "Options Extania" + EnumChatFormatting.RED/* + Minecraft.getMinecraft().getSession().getUsername()/**/, this.width / 2, 40, 16777215);
              super.drawScreen(paramInt1, paramInt2, paramFloat);
            }
          }
          
          
          1 Reply Last reply Reply Quote 0
          • Deleted
            Deleted last edited by

            Comment affiches-tu ce gui ?

            1 Reply Last reply Reply Quote 0
            • P
              PlayFlop_ last edited by

              @‘Plaigon’:

              Comment affiches-tu ce gui ?

              En cliquant sur un bouton dans un GuiInGameMenu custom

              1 Reply Last reply Reply Quote 0
              • AymericRed
                AymericRed last edited by

                Je pense qu’il parlait de la fonction que tu utilises.

                1 Reply Last reply Reply Quote 0
                • P
                  PlayFlop_ last edited by

                  @‘AymericRed’:

                  Je pense qu’il parlait de la fonction que tu utilises.

                  Bha j’ai envoyé ma class…

                  1 Reply Last reply Reply Quote 0
                  • AymericRed
                    AymericRed last edited by

                    Non tas envoyé la classe du gui mais pas le code qui tu utilises pour ouvrir le gui (du type mc.displayGuiScreen ou player. openGui).

                    1 Reply Last reply Reply Quote 0
                    • P
                      PlayFlop_ last edited by

                      @‘AymericRed’:

                      Non tas envoyé la classe du gui mais pas le code qui tu utilises pour ouvrir le gui (du type mc.displayGuiScreen ou player. openGui).

                      AHHH

                      j’utilise ça:

                      “Minecraft.getMinecraft().displayGuiScreen(new GuiExtaOption());”

                      1 Reply Last reply Reply Quote 0
                      • Romain120105
                        Romain120105 last edited by

                        Je crois qu’il faut mettre un SideOnly

                        1 Reply Last reply Reply Quote 0
                        • P
                          PlayFlop_ last edited by

                          @‘Romain120105’:

                          Je crois qu’il faut mettre un SideOnly

                          Ou ça ?
                          Et je ne pense pas que ce soit ça.

                          1 Reply Last reply Reply Quote 0
                          • Deleted
                            Deleted last edited by

                            Oui le SideOnly n’aiderait en rien.
                            Essaie de mettre un breakpoints ou plusieurs surtout pour voir où s’arrête le code lu lorsque tu joues sur serveur.

                            1 Reply Last reply Reply Quote 0
                            • P
                              PlayFlop_ last edited by

                              Bon j’ai fixé mon problème seul!

                              1 Reply Last reply Reply Quote 0
                              • Deleted
                                Deleted last edited by

                                Bien, tu deviens autonome !

                                1 Reply Last reply Reply Quote 0
                                • 1 / 1
                                • First post
                                  Last post
                                Design by Woryk
                                Contact / Mentions Légales / Faire un don

                                MINECRAFT FORGE FRANCE © 2018

                                Powered by NodeBB