1. Le forum de Minecraft-France va définitivement fermer ses portes. Celui-ci restera en lecture seule mais vous ne pourrez plus y apporter de nouveaux topics. Nous vous invitons à nous rejoindre sur le Discord de Minecraft-France qui permet de présenter vos projets, discuter avec la communauté etc.. Merci à tous d'avoir fait vivre ce forum de nombreuses années. Pour nous rejoindre sur Discord, Cliquez ici

aide pour modder un item [Forge 1.5.1]

Discussion dans 'Aide à la création de mod' créé par cocasio665, 10 Avr 2013.

  1. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    Bonjour a tous et a toute,
    voila je désire faire un mod avec Forge en 1.5.1, dans le cas de mon problème c est pour faire un simple item.
    Je vous expose le problème : donc je veux crée l item saphir, et ne m y connaissant pas du tout en code je suis aller voir les tuto de robin4002. le problème c est qu en mettant cette ligne :
    " LanguageRegistry.addName(Saphir,"Saphir");"
    dans ma classe principale après avoir tout remplacer il y avais un erreur sur le : " LanguageRegistry"
    j ai donc importai le " LanguageRegistry.addName" et ca a corriger l erreur. mais quand je clic sur debug pour lancer le jeu le chargement de forge marche, l image de mojang apparais puis minecraft plante.
    je ne sais vraiment pas comment faire ...
    ma classe principale :
    Code (java):
    "package More_Cloth_and_Armor.common;[/SIZE]
     
    [SIZE=2]import net.minecraft.item.Item;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.Mod;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.Mod.Init;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.Mod.PostInit;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.Mod.PreInit;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.Mod.ServerStarting;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.SidedProxy;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.event.FMLInitializationEvent;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.event.FMLPostInitializationEvent;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.event.FMLPreInitializationEvent;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.event.FMLServerStartingEvent;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.network.NetworkMod;[/SIZE]
    [SIZE=2]import cpw.mods.fml.common.registry.LanguageRegistry;[/SIZE]
     
    [SIZE=2]@Mod(modid = "
    1457030730", name = "More_Cloth_and_Armor", version = "1.0.0")[/SIZE]
    [SIZE=2]@NetworkMod(clientSideRequired = true, serverSideRequired = false)[/SIZE]
     
    [SIZE=2]public class classPrincipale[/SIZE]
    [SIZE=2]{[/SIZE]
    [SIZE=2] @SidedProxy(clientSide = "
    modTutoriel.client.TutoClientProxy", serverSide = "modTutoriel.common.TutoCommonProxy")[/SIZE]
    [SIZE=2] public static CommonProxy proxy;[/SIZE]
     
    [SIZE=2] /**1**/[/SIZE]
    [SIZE=2] @PreInit[/SIZE]
    [SIZE=2] public void preload(FMLPreInitializationEvent event)[/SIZE]
    [SIZE=2] {[/SIZE]
     
    [SIZE=2] }[/SIZE]
     
    [SIZE=2] /**2**/[/SIZE]
     
    [SIZE=2] public static Item Saphir;[/SIZE]
    [SIZE=2] @Init[/SIZE]
    [SIZE=2] public void load(FMLInitializationEvent event)[/SIZE]
    [SIZE=2] {[/SIZE]
    [SIZE=2] Saphir = new Saphir(4000).setUnlocalizedName("
    Saphir");[/SIZE]
    [SIZE=2] LanguageRegistry.addName(Saphir,"
    Saphir");[/SIZE]
    [SIZE=2] proxy.registerTextures();[/SIZE]
    [SIZE=2] }[/SIZE]
     
    [SIZE=2] /**3**/[/SIZE]
    [SIZE=2] @PostInit[/SIZE]
    [SIZE=2] public void postload(FMLPostInitializationEvent event)[/SIZE]
    [SIZE=2] {[/SIZE]
     
    [SIZE=2] }[/SIZE]
    [SIZE=2] /**4**/[/SIZE]
    [SIZE=2] @ServerStarting[/SIZE]
    [SIZE=2] public void serverStarting(FMLServerStartingEvent event)[/SIZE]
    [SIZE=2] {[/SIZE]
     
    [SIZE=2] }[/SIZE]
     
    [SIZE=2]}"


    et la class du saphire :

    Code (java):
    "package More_Cloth_and_Armor.common;[/SIZE]
     
    [SIZE=2]import net.minecraft.client.renderer.texture.IconRegister;[/SIZE]
    [SIZE=2]import net.minecraft.item.Item;[/SIZE]
     
    [SIZE=2]public class Saphir extends Item[/SIZE]
    [SIZE=2]{[/SIZE]
     
    [SIZE=2]public Saphir(int par1)[/SIZE]
    [SIZE=2]{[/SIZE]
    [SIZE=2]super(par1);[/SIZE]
    [SIZE=2] this.maxStackSize = 64;[/SIZE]
    [SIZE=2]}[/SIZE]
    [SIZE=2] @Override[/SIZE]
    [SIZE=2] public void updateIcons(IconRegister iconRegister)[/SIZE]
    [SIZE=2] {[/SIZE]
    [SIZE=2] iconIndex = iconRegister.registerIcon("
    More_Cloth_and_Armor:Saphir");[/SIZE]
    [SIZE=2] }[/SIZE]
     
    [SIZE=2]}"



    j espere que vous pourriez m' aidez :S
    cordialement
     
  2. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Minecraft plante et ?
    Je peux pas t'aider sans l'erreur qu'il y a dans les logs
    et utilise les balise (code=java) code ici(/code) pour les codes c'est plus lisible (avec des "[]" à la place des "()" )
    Pareil pour les logs utilise spoiler
     
  3. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    ah oui désolé je n y avais pas pansé ^^
    minecraft me marque ca :


    Minecraft has crashed!
    ----------------------

    Minecraft has stopped running because it encountered a problem; Failed to start game

    A full error report has been saved to C:\Users\Mr.cocasio66517\Desktop\modding 1.4.7\forge\mcp\jars\.\crash-reports\crash-2013-04-11_18.16.26-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(



    --- BEGIN ERROR REPORT 1b6a2301 --------
    Full report at:
    C:\Users\Mr.cocasio66517\Desktop\modding 1.4.7\forge\mcp\jars\.\crash-reports\crash-2013-04-11_18.16.26-client.txt
    Please show that file to Mojang, NOT just this screen!

    Generated 11/04/13 18:16

    -- System Details --
    Details:
    Minecraft Version: 1.5.1
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_17, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 930110984 bytes (887 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Suspicious classes: FML and Forge are installed
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v7.44 FML v5.1.16.640 Minecraft Forge 7.7.1.640 4 mods loaded, 4 mods active
    mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
    FML [Forge Mod Loader] (coremods) Unloaded->Constructed
    Forge [Minecraft Forge] (coremods) Unloaded->Constructed
    1457030730 [More_Cloth_and_Armor] (bin) Unloaded->Errored
    LWJGL: 2.4.2
    OpenGL: AMD Radeon HD 6700 Series GL version 4.2.12002 Compatibility Profile Context 9.12.0.0, ATI Technologies Inc.
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Texture Pack: Default
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

    cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: modTutoriel.client.TutoClientProxy
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:67)
    at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:492)
    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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
    at com.google.common.eventbus.EventBus.post(EventBus.java:267)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
    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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
    at com.google.common.eventbus.EventBus.post(EventBus.java:267)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:503)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:407)
    at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
    at net.minecraft.client.Minecraft.run(Minecraft.java:729)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: modTutoriel.client.TutoClientProxy
    at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:56)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:50)
    ... 27 more
    Caused by: java.lang.NullPointerException
    at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:227)
    ... 33 more
    --- END ERROR REPORT 2ddb9ffa ----------
     
  4. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Le problème ne vient pas de l'item, il vient des proxy :
    Code (java):
    @SidedProxy(clientSide = "modTutoriel.client.TutoClientProxy", serverSide = "modTutoriel.common.TutoCommonProxy")
    Tu as oublier d'adapter ces lignes
     
  5. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    et je doit la mettre ou :O
     
  6. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Tu dois juste changer cette ligne par ce qui te correspond
    Dans ton cas c'est More_Cloth_and_Armor.common.CommonProxy et More_Cloth_and_Armor.client.ClientProxy
     
  7. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    Ah oui dacord je n avais pas vu --' je suis vraiment nul ! merci a toi robin :)

    sa ne marche toujours pas :S minecraft crash encore :

    Minecraft has crashed!
    ----------------------

    Minecraft has stopped running because it encountered a problem; Failed to start game

    A full error report has been saved to C:\Users\Mr.cocasio66517\Desktop\modding 1.4.7\forge\mcp\jars\.\crash-reports\crash-2013-04-11_19.58.26-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(



    --- BEGIN ERROR REPORT 1edbdac4 --------
    Full report at:
    C:\Users\Mr.cocasio66517\Desktop\modding 1.4.7\forge\mcp\jars\.\crash-reports\crash-2013-04-11_19.58.26-client.txt
    Please show that file to Mojang, NOT just this screen!

    Generated 11/04/13 19:58

    -- System Details --
    Details:
    Minecraft Version: 1.5.1
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_17, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 930106024 bytes (887 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Suspicious classes: FML and Forge are installed
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v7.44 FML v5.1.16.640 Minecraft Forge 7.7.1.640 4 mods loaded, 4 mods active
    mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
    FML [Forge Mod Loader] (coremods) Unloaded->Constructed
    Forge [Minecraft Forge] (coremods) Unloaded->Constructed
    1457030730 [More_Cloth_and_Armor] (bin) Unloaded->Errored
    LWJGL: 2.4.2
    OpenGL: AMD Radeon HD 6700 Series GL version 4.2.12002 Compatibility Profile Context 9.12.0.0, ATI Technologies Inc.
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Texture Pack: Default
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

    cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: More_Cloth_and_Armor.common.CommonProxy
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:67)
    at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:492)
    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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
    at com.google.common.eventbus.EventBus.post(EventBus.java:267)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
    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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
    at com.google.common.eventbus.EventBus.post(EventBus.java:267)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:503)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:407)
    at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
    at net.minecraft.client.Minecraft.run(Minecraft.java:729)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: More_Cloth_and_Armor.common.CommonProxy
    at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:56)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:50)
    ... 27 more
    Caused by: java.lang.NullPointerException
    at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:227)
    ... 33 more
    --- END ERROR REPORT 9c5530b ----------



    j en est marre xD robin sauve moi ! :)
     
  8. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Il faut créer les proxy, relit mon premier tutoriel sur la classe principale
     
  9. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    Mais j ai fait tout ce que tu a fait :/
     
  10. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Ne up pas 10 minutes après, si tu as cette erreur c'est que fml ne trouve pas les classes de tes proxy, donc tu as fail quelque chose
    Au pire envoie moi les sources de ton mods (forge/mcp/src/minecraft puis le dossier More_Cloth_and_Armor et le dossier mods)
     
  11. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    je n arrive meme pas a t envoyer les dossiers.. je suis un catastrophe :S désolé de te déranger .. :/
     
  12. Swoonix

    Swoonix Résident de l'End

    Inscrit:
    21 Juil 2012
    Messages:
    6 910
    Points:
    219
    Je peux essayer de t'aider si tu me passes toutes tes class.

    EDIT : Regarde dans ta class principale.. tu as ça :

    Code (java):
    @Mod(modid = "1457030730", name = "More_Cloth_and_Armor", version = "1.0.0")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
     
    public class classPrincipale
    {
    @SidedProxy(clientSide = "modTutoriel.client.TutoClientProxy",serverSide="modTutoriel.common.TutoCommonProxy")
    public static CommonProxy proxy;[/code=java]
    Que tu vas remplacer par :
    Code (java):
    @Mod(modid = "1457030730", name = "More_Cloth_and_Armor", version = "1.0.0")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
     
    public class classPrincipale
    {
    @SidedProxy(clientSide = "More_Cloth_and_Armor.client.TutoClientProxy",serverSide="More_Cloth_and_Armor.common.TutoCommonProxy")
    public static CommonProxy proxy;
    Ensuite, il te reste le .TutoCommonProxy et TutoClientProxy à adapter selon tes class.
     
  13. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    je vous envois mon commonproxy :
    Code (java):
    package More_Cloth_and_Armor.common;
     
    public class CommonProxy
    {
        public void registerTextures()
        {
     
        }
    }
    et mon clientProxy :

    Code (java):
    package More_Cloth_and_Armor.client;
     
    import More_Cloth_and_Armor.common.CommonProxy;
     
    public class ClientProxy extends CommonProxy
    {
        @Override
        public void registerTextures()
        {
           
        }
     
    }
     
  14. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Mets ça :
    Code (java):
    @SidedProxy(clientSide = "More_Cloth_and_Armor.common.CommonProxy.ClientProxy", serverSide = "More_Cloth_and_Armor.common.CommonProxy")
     
  15. cocasio665

    cocasio665 Nouveau

    Inscrit:
    10 Avr 2013
    Messages:
    9
    Points:
    40
    Sexe:
    Homme
    mais ca je l est mis .. c est que dans la classe principale qu il faut le mettre ?
     

Partager cette page