Résolu Problème mod menu

volts_spk

Débrouillard
24 Juin 2015
22
0
14
France
Bonjour/bonsoir,

M'étant lancé dans la création d'un launcher il me faut un menu personnalisé, seulement lorsque je lance mon minecraft avec mes mods et mon mod menu custom, mon jeu crash et j'ai ça :

Code:
Description: Unexpected error
 
java.lang.IllegalArgumentException: n must be positive
    at java.util.Random.nextInt(Unknown Source)
    at fr.minecraftforgefrance.client.custommenu.GuiCustomMainMenu.<init>(GuiCustomMainMenu.java:103)
    at fr.minecraftforgefrance.client.custommenu.ModCustomMenu.onTickClient(ModCustomMenu.java:43)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_86_ModCustomMenu_onTickClient_ClientTickEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
    at cpw.mods.fml.common.FMLCommonHandler.onPostClientTick(FMLCommonHandler.java:329)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2014)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:916)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:835)
    at net.minecraft.client.main.Main.main(SourceFile:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

sinon en dessous il y a la liste de tous les mods, et ils sont tous "available", même le mod menu ...

Merci.
 
C'est un bug directement dans le code de ton menu custom.
À un moment tu passe un paramètre à la méthode java.util.Random.nextInt(), or ce paramètre (noté n dans la définition de la méthode) doit être positif. Ce n'est pas le cas dans ton code visiblement.