MainMenu



  • Bonjour/bonsoir voilà je veux créer un menu personalisé mais j'ai deux erreurs à la ligne 63: "Syntax error on token "null", new expected" et "mc cannot be resolved to a type"

    package com.degraduck.minefustest.common;
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.gui.GuiMainMenu;
    
    import com.degraduck.minefustest.client.GuiCustomMainMenu;
    import com.degraduck.minefustest.proxy.CommonProxy;
    
    import net.minecraft.client.Minecraft;
    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.Mod.Instance;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    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 = "minefustest", name = "Minefus Test", version = "1.1.0")
    
    public class Minefustest {
    
    @Instance("minefustest")
    public static Minefustest instance;
    
    @SidedProxy(clientSide = "com.degraduck.minefustest.proxy.ClientProxy", serverSide = "com.degraduck.minefustest.proxy.CommonProxy")
    public static CommonProxy proxy;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    
    if(event.getSide().isClient())
           {
               FMLCommonHandler.instance().bus().register(this);
           }
       }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    
    }
    
    @SubscribeEvent
       @SideOnly(Side.CLIENT)
       public void onTick(TickEvent.ClientTickEvent event)
       {
           Minecraft mc = FMLClientHandler.instance().getClient();
           if(mc.currentScreen != null mc.currentScreen.getClass().equals(GuiMainMenu.class))
           {
               mc.displayGuiScreen(new GuiCustomMainMenu());
           }
       }
    
    }
    

  • Moddeurs confirmés Rédacteurs Administrateurs

    if(mc.currentScreen != null && mc.currentScreen.getClass().equals(GuiMainMenu.class))



  • Erreurs résolues mais crash, voici les logs d'eclipse:
    :::
    [22:25:16] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [22:25:16] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [22:25:16] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
    [22:25:16] [main/INFO] [FML]: Forge Mod Loader version 7.2.217.1147 for Minecraft 1.7.2 loading
    [22:25:16] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_71, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
    [22:25:16] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    [22:25:16] [main/INFO] [FML]: Loading tweaker net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer from legacyjavafixer-1.0.jar
    [22:25:16] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [22:25:16] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Tweaker: cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker@420ea16e
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Replacing tweaker cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker@420ea16e with net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer$SortReplacement@4e885ea3
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Tweaker: FMLCorePlugin {[]}
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Tweaker: FMLForgePlugin {[]}
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Tweaker: cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker@420ea16e
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Replacing tweaker cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker@420ea16e with net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer$SortReplacement@4e885ea3
    [22:25:16] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [22:25:16] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer$SortReplacement
    [22:25:16] [main/INFO] [FML]: [LegacyJavaFixer] Replacing sort
    [22:25:16] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer$SortReplacement
    [22:25:16] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.lex.legacyjavafixer.LegacyJavaFixer
    [22:25:16] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [22:25:16] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
    [22:25:18] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Sullivan/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1147/forgeSrc-1.7.2-10.12.2.1147.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
    [22:25:18] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
    [22:25:18] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Sullivan/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1147/forgeSrc-1.7.2-10.12.2.1147.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
    [22:25:18] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
    [22:25:18] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [22:25:18] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [22:25:19] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
    [22:25:20] [main/ERROR] [LaunchWrapper]: Unable to launch
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
    Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.7.0_71]
    at java.lang.Runtime.loadLibrary0(Unknown Source) ~[?:1.7.0_71]
    at java.lang.System.loadLibrary(Unknown Source) ~[?:1.7.0_71]
    at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_71]
    at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
    at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
    at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
    at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2690) ~[Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:40) ~[Main.class:?]
    … 6 more
    :::</clinit>


  • Moddeurs confirmés Rédacteurs Administrateurs

    lwjgl n'est pas dans ton classpath, c'est pas ton mod qui cause ce crash.



  • Je ne vois pas comment résoudres ce crash tu peux m'aider?


  • Moddeurs confirmés Rédacteurs Administrateurs

    Essaye de refaire un setup.



  • J'ai refais un setup et j'ai raffraichis les dépendences aucuns changement.

    EDIT: J'ai copié les fichiers de mon autre mod et cela à fonctionné Merci.

    EDIT2: J'ai repris les sources menus custom mais j'aimerai remplacer les bouton solo par mon serveur Ts3 comment faire?

    EDIT3: Voici mon code:

    if(button.id == 1)
    {
    String ipts3 = "ts.ip.fr"; // addresse ts
               int portTs3 = 9987; //port ts
               URI uri = URI.create("ts3server://"+ ipts3 +"?port="+ portts3);
               try { Desktop.getDesktop().browse(uri);
               } catch (IOException e) {
                   // TODO Auto-generated catch block e.printStackTrace(); } }
               }
    }
    

    Il me souligne portts3 à la ligne 5



  • Change tes JVM : Sur Eclipse : Run / Run Configurations / <ton run="">/ Arguments et AJOUTE dans VM Arguments -Djava.library.path="<le chemin="" jusqu'à="" ton="" dossier="" forge="">"/build/natives</le></ton>


  • Moddeurs confirmés Rédacteurs Administrateurs

    Un peu normal puisque ta variable s'appelle portTs3 …
    http://openclassrooms.com/courses/apprenez-a-programmer-en-java



  • Résolu merci.


Log in to reply