MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Game Menu

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    35 Messages 3 Publieurs 8.5k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par

      J’ai encore jamais vu ça, réinstalle Eclipse.

      1 réponse Dernière réponse Répondre Citer 0
      • Z Hors-ligne
        Zedokf_DrM
        dernière édition par

        Donc voilà j’ai une erreur ici mon code du dossier ModCustomMenu : ```java
        package fr.minecraftforgefrance.client.custommenu;

        import net.minecraft.client.Minecraft;
        import net.minecraft.client.gui.GuiIngameMenu;
        import net.minecraft.client.gui.GuiMainMenu;
        import cpw.mods.fml.client.FMLClientHandler;
        import cpw.mods.fml.common.FMLCommonHandler;
        import cpw.mods.fml.common.Mod;
        import cpw.mods.fml.common.Mod.EventHandler;
        import cpw.mods.fml.common.event.FMLInitializationEvent;
        import cpw.mods.fml.common.eventhandler.SubscribeEvent;
        import cpw.mods.fml.common.gameevent.TickEvent;
        import cpw.mods.fml.relauncher.Side;
        import cpw.mods.fml.relauncher.SideOnly;

        @Mod(modid = “custommenu”, name = “SlideFight InGame”, version = “1.0”)
        public class ModCustomMenu
        {
        @EventHandler
        public void init(FMLInitializationEvent event)
        {
        if(event.getSide().isClient())
        {
        FMLCommonHandler.instance().bus().register(this);
        }
        }

        @SubscribeEvent
        @SideOnly(Side.CLIENT)
        public void onTick(TickEvent.ClientTickEvent event)
        {
        Minecraft mc = FMLClientHandler.instance().getClient();
        if(mc.currentScreen != null && mc.currentScreen.getClass().equals(GuiIngameMenu.class))
        {
        mc.displayGuiScreen(new GuiCustomIngameMenu());
        }
        else if(mc.currentScreen != null && mc.currentScreen.getClass().equals(GuiIngameMenu.class))

        {
        mc.displayGuiScreen(new GuiCustomIngameMenu());
        }
        }
        }

        
        Et le code source de GuiCustomIngameMenu : ```java
        package fr.minecraftforgefrance.client.custommenu;
        
        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.GuiShareToLan;
        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 cpw.mods.fml.client.FMLClientHandler;
        import cpw.mods.fml.relauncher.Side;
        import cpw.mods.fml.relauncher.SideOnly;
        
        @SideOnly(Side.CLIENT)
        public class GuiCustomIngameMenu extends GuiScreen
        {
        private int field_146445_a;
        private int field_146444_f;
        private static final String __OBFID = "CL_00000703";
        
        /**
        * Adds the buttons (and other controls) to the screen in question.
        */
        public void initGui()
        {
        this.field_146445_a = 0;
        this.buttonList.clear();
        byte b0 = -16;
        boolean flag = true;
        this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + b0, I18n.format("menu.returnToMenu", new Object[0])));
        
        if (!this.mc.isIntegratedServerRunning())
        {
        ((GuiButton)this.buttonList.get(0)).displayString = I18n.format("menu.disconnect", new Object[0]);
        }
        
        this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + b0, I18n.format("menu.returnToGame", new Object[0])));
        this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + b0, 98, 20, I18n.format("menu.options", new Object[0])));
        this.buttonList.add(new GuiButton(12, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, "Mod Options…"));
        GuiButton guibutton;
        this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 72 + b0, 200, 20, I18n.format("menu.shareToLan", new Object[0])));
        this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.achievements", new Object[0])));
        this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.stats", new Object[0])));
        guibutton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic();
        }
        
        protected void actionPerformed(GuiButton p_146284_1_)
        {
        switch (p_146284_1_.id)
        {
        case 0:
        this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
        break;
        case 1:
        p_146284_1_.enabled = false;
        this.mc.theWorld.sendQuittingDisconnectingPacket();
        this.mc.loadWorld((WorldClient)null);
        this.mc.displayGuiScreen(new GuiMainMenu());
        case 2:
        case 3:
        default:
        break;
        case 4:
        this.mc.displayGuiScreen((GuiScreen)null);
        this.mc.setIngameFocus();
        break;
        case 5:
        if (this.mc.thePlayer != null)
        this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter()));
        break;
        case 6:
        if (this.mc.thePlayer != null)
        this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
        break;
        case 7:
        this.mc.displayGuiScreen(new GuiShareToLan(this));
        break;
        case 12:
        FMLClientHandler.instance().showInGameModOptions(this);
        break;
        }
        }
        
        /**
        * Called from the main game loop to update the screen.
        */
        public void updateScreen()
        {
        super.updateScreen();
        ++this.field_146444_f;
        }
        
        /**
        * Draws the screen and all the components in it.
        */
        public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
        {
        this.drawDefaultBackground();
        this.drawCenteredString(this.fontRendererObj, I18n.format("menu.game", new Object[0]), this.width / 2, 40, 16777215);
        super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
        }
        }
        

        L’erreur est marquée ici : java FMLClientHandler.instance().showInGameModOptions(this); exactement ici : ```java
        showInGameModOptions

        
        Ensuite comment modifier un bouton pour que quand un joueur clique dessus il arrive sur le site ? Merci d'avance
        1 réponse Dernière réponse Répondre Citer 0
        • robin4002R Hors-ligne
          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
          dernière édition par

          Ta classe principale n’est pas bon, je t’avais pourtant donné le bon code ici :
          http://www.minecraftforgefrance.fr/showthread.php?tid=2055&pid=23389#pid23389

          Pour l’erreur avec le
          FMLClientHandler.instance().showInGameModOptions(this);
          retire toute la ligne, de toute façon ce menu n’est pas encore fonctionnel.

          1 réponse Dernière réponse Répondre Citer 0
          • SCAREXS Hors-ligne
            SCAREX
            dernière édition par

            
            Minecraft mc = FMLClientHandler.instance().getClient();
            if(mc.currentScreen != null && mc.currentScreen.getClass().equals(GuiIngameMenu.class))
            {
            mc.displayGuiScreen(new GuiCustomIngameMenu());
            }
            else if(mc.currentScreen != null && mc.currentScreen.getClass().equals(GuiIngameMenu.class))
            
            {
            mc.displayGuiScreen(new GuiCustomIngameMenu());
            }
            

            Useless or not useless ? That is the question.

            Essaie avec çà plutôt :
            [java
            Minecraft mc = FMLClientHandler.instance().getClient();
            if(mc.currentScreen instanceof GuiIngameMenu)
            {
            mc.displayGuiScreen(new GuiCustomIngameMenu());
            }
            [/java]

            Pour l’erreur : ta classe n’est pas extend GuiIngameMenu.

            Faire un lien vers un site.

            Site web contenant mes scripts : http://SCAREXgaming.github.io

            Pas de demandes de support par MP ni par skype SVP.
            Je n'accepte sur skype que l…

            1 réponse Dernière réponse Répondre Citer 0
            • Z Hors-ligne
              Zedokf_DrM
              dernière édition par

              ça fonctionne mais voilà encore un de mes problèmes : ```java
              package fr.minecraftforgefrance.client.custommenu;

              import java.awt.Desktop;
              import java.net.URL;

              import net.minecraft.client.gui.GuiButton;
              import net.minecraft.client.gui.GuiIngameMenu;
              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 cpw.mods.fml.client.FMLClientHandler;
              import cpw.mods.fml.relauncher.Side;
              import cpw.mods.fml.relauncher.SideOnly;

              @SideOnly(Side.CLIENT)
              public class GuiCustomIngameMenu extends GuiIngameMenu
              {
              private int field_146445_a;
              private int field_146444_f;
              private static final String __OBFID = “CL_00000703”;

              /**

              • Adds the buttons (and other controls) to the screen in question.
                */
                public void initGui()
                {
                this.field_146445_a = 0;
                this.buttonList.clear();
                byte b0 = -16;
                boolean flag = true;
                this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + b0, I18n.format(“menu.returnToMenu”, new Object[0])));

              if (!this.mc.isIntegratedServerRunning())
              {
              ((GuiButton)this.buttonList.get(0)).displayString = I18n.format(“menu.disconnect”, new Object[0]);
              }

              this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + b0, I18n.format(“menu.returnToGame”, new Object[0])));
              this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + b0, 98, 20, I18n.format(“menu.options”, new Object[0])));
              this.buttonList.add(new GuiButton(12, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, “TS3”));
              GuiButton guibutton;
              this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 72 + b0, 200, 20, I18n.format(“Site”, new Object[0])));
              this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + b0, 98, 20, I18n.format(“gui.achievements”, new Object[0])));
              this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + b0, 98, 20, I18n.format(“gui.stats”, new Object[0])));
              guibutton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic();
              }

              protected void actionPerformed(GuiButton p_146284_1_)
              {
              switch (p_146284_1_.id)
              {
              case 0:
              this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
              break;
              case 1:
              p_146284_1_.enabled = false;
              this.mc.theWorld.sendQuittingDisconnectingPacket();
              this.mc.loadWorld((WorldClient)null);
              this.mc.displayGuiScreen(new GuiMainMenu());
              case 2:
              case 3:
              default:
              break;
              case 4:
              this.mc.displayGuiScreen((GuiScreen)null);
              this.mc.setIngameFocus();
              break;
              case 5:
              if (this.mc.thePlayer != null)
              this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter()));
              break;
              case 6:
              if (this.mc.thePlayer != null)
              this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
              break;
              case 7:

              Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
              if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
              try {
              desktop.browse(new URL(“http://slidefight.fr”).toURI());
              } catch (Exception e) {
              e.printStackTrace();
              }
              }
              break;
              case 12:
              Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
              if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
              try {
              desktop.browse(new URL(“ts3server://151.80.115.24?port=”).toURI());
              } catch (Exception e) {
              e.printStackTrace();
              }
              } break;
              }
              }

              /**

              • Called from the main game loop to update the screen.
                */
                public void updateScreen()
                {
                super.updateScreen();
                ++this.field_146444_f;
                }

              /**

              • Draws the screen and all the components in it.
                */
                public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
                {
                this.drawDefaultBackground();
                this.drawCenteredString(this.fontRendererObj, I18n.format(“menu.game”, new Object[0]), this.width / 2, 40, 16777215);
                super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
                }
                }
              
              Il y a une erreur ici : ```java
              case 12:
              Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
              
              

              Plus précisément ici : ```java
              Desktop desktop

              1 réponse Dernière réponse Répondre Citer 0
              • robin4002R Hors-ligne
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                dernière édition par

                Il faut un copier/coller du rapport de crash.

                1 réponse Dernière réponse Répondre Citer 0
                • SCAREXS Hors-ligne
                  SCAREX
                  dernière édition par

                  La variable est déjà utilisée plus haut, change juste le nom de la variable.

                  Site web contenant mes scripts : http://SCAREXgaming.github.io

                  Pas de demandes de support par MP ni par skype SVP.
                  Je n'accepte sur skype que l…

                  1 réponse Dernière réponse Répondre Citer 0
                  • Z Hors-ligne
                    Zedokf_DrM
                    dernière édition par

                    D’accord pour le bouton du site ça fonctionne et si je veux faire un bouton ts3 comment faire ? J’ai mis ce code la mais ça fonctionne pas ça ne m’ouvre pas teamspeak : ```java
                    case 12:
                    Desktop teamspeak = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
                    if (teamspeak != null && teamspeak.isSupported(Desktop.Action.BROWSE))
                    {
                    try {
                    teamspeak.browse(new URL(“ts3server://151.80.115.24?port=”).toURI());
                    } catch (Exception e) {
                    e.printStackTrace();
                    }
                    }
                    break;

                    1 réponse Dernière réponse Répondre Citer 0
                    • robin4002R Hors-ligne
                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                      dernière édition par

                      ts3server://151.80.115.24?port=9987

                      1 réponse Dernière réponse Répondre Citer 0
                      • Z Hors-ligne
                        Zedokf_DrM
                        dernière édition par

                        ça ne fonctionne toujours pas voilà ce que j’ai dans la console : ```
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.net.MalformedURLException: unknown protocol: ts3server
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.net.URL.<init>(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.net.URL.<init>(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.net.URL.<init>(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at fr.minecraftforgefrance.client.custommenu.GuiCustomIngameMenu.actionPerformed(GuiCustomIngameMenu.java:96)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.gui.GuiScreen.mouseClicked(GuiScreen.java:252)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:344)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:313)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.runTick(Minecraft.java:1720)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.run(Minecraft.java:951)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.main.Main.main(Main.java:164)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                        [20:58:07] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at GradleStart.main(Unknown Source)

                        1 réponse Dernière réponse Répondre Citer 0
                        • robin4002R Hors-ligne
                          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                          dernière édition par

                          Tu es sous quel système d’exploitation ?

                          1 réponse Dernière réponse Répondre Citer 0
                          • Z Hors-ligne
                            Zedokf_DrM
                            dernière édition par

                            Windows 8

                            1 réponse Dernière réponse Répondre Citer 0
                            • SCAREXS Hors-ligne
                              SCAREX
                              dernière édition par

                              Il ne faut pas faire URL.toURI(), fait directement new URI(“ts3server:…”).

                              Site web contenant mes scripts : http://SCAREXgaming.github.io

                              Pas de demandes de support par MP ni par skype SVP.
                              Je n'accepte sur skype que l…

                              1 réponse Dernière réponse Répondre Citer 0
                              • Z Hors-ligne
                                Zedokf_DrM
                                dernière édition par

                                Comment ça ? Je comprends pas ?

                                1 réponse Dernière réponse Répondre Citer 0
                                • SCAREXS Hors-ligne
                                  SCAREX
                                  dernière édition par

                                  @‘Zedokf_DrM’:

                                  Comment ça ? Je comprends pas ?

                                  Une URL ne peut avoir comme protocole http, https, ftp, sftp ou ftps et non ts3server, il faut donc utiliser une URI, mets çà :

                                  
                                  teamspeak.browse(new URI("ts3server://151.80.115.24?port=9987"));
                                  
                                  

                                  à la place de :

                                  
                                  teamspeak.browse(new URL("ts3server://151.80.115.24?port=").toURI());
                                  
                                  

                                  Site web contenant mes scripts : http://SCAREXgaming.github.io

                                  Pas de demandes de support par MP ni par skype SVP.
                                  Je n'accepte sur skype que l…

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • 1
                                  • 2
                                  • 2 / 2
                                  • Premier message
                                    Dernier message
                                  Design by Woryk
                                  ContactMentions Légales

                                  MINECRAFT FORGE FRANCE © 2024

                                  Powered by NodeBB