• S'inscrire
    • Se connecter
    • Recherche
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes

    Résolu Recette basique impossible

    1.7.x
    1.7.2
    4
    12
    2767
    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.
    • D
      DarkOfNight dernière édition par

      Bonjour à tous,
      J’ai tenté de créer plusieurs recettes “basiques” (via des blocs vanilla). Eclipse veut bien lancer le mod sans problèmes.
      Par contre les launchers (Minecraft et un autre pour mon serveur) me dise qu’ils ne trouvent pas l’item “arrow” :

      Merci de bien vouloir m’aider.

      ModMCU.java

      package mcuniversal.modmcu;
      
      import net.minecraft.init.Blocks;
      import net.minecraft.init.Items;
      import net.minecraft.item.ItemStack;
      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.registry.GameRegistry;
      import mcuniversal.modmcu.CommonProxy;
      
      @Mod(modid = ModMCU.MODID, name = "ModMCU", version = "1.4.4")
      public class ModMCU
      {
      
      public static final String MODID = "ModMCU";
      @Instance(MODID)
      public static ModMCU instance;
      
      @SidedProxy(clientSide = "mcuniversal.modmcu.ClientProxy", serverSide = "mcuniversal.modmcu.CommonProxy")
      public static CommonProxy proxy;
      
      @EventHandler
      public void preInit(FMLPreInitializationEvent event)
      {
      
      }
      
      @EventHandler
      public void Init(FMLInitializationEvent event)
      {
      proxy.registerRender();
      GameRegistry.addRecipe(new ItemStack(Items.arrow, 4), new Object[]{"XX3", "X5X", "7XX", Character.valueOf('3'), new ItemStack(Blocks.cobblestone, 1), Character.valueOf('5'), new ItemStack(Items.stick, 1), Character.valueOf('7'), new ItemStack(Items.stick, 1), });
      GameRegistry.addRecipe(new ItemStack(Items.arrow, 16), new Object[]{"XX3", "X5X", "7XX", Character.valueOf('3'), new ItemStack(Blocks.stone, 1), Character.valueOf('5'), new ItemStack(Items.stick, 1), Character.valueOf('7'), new ItemStack(Items.stick, 1), });
      GameRegistry.addRecipe(new ItemStack(Items.arrow, 64), new Object[]{"XX3", "X5X", "7XX", Character.valueOf('3'), new ItemStack(Blocks.stonebrick, 1), Character.valueOf('5'), new ItemStack(Items.stick, 1), Character.valueOf('7'), new ItemStack(Items.stick, 1), });
      
      GameRegistry.addShapelessRecipe(new ItemStack(Items.string, 4), new Object[]{ new ItemStack(Blocks.wool, 1) } );
      
      GameRegistry.addRecipe(new ItemStack(Items.slime_ball, 1), new Object[]{"123", "456", "789", Character.valueOf('1'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('2'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('3'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('4'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('5'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('6'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('7'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('8'), new ItemStack(Items.wheat_seeds, 4), Character.valueOf('9'), new ItemStack(Items.wheat_seeds, 4), });
      }
      public void postInit(FMLPostInitializationEvent event)
      {
      
      }
      }​
      

      Erreur :

      ​Description: There was a severe problem during mod loading that has caused the game to fail
      
      cpw.mods.fml.common.LoaderException: java.lang.NoSuchFieldError: arrow
      at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
      at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)
      at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
      at net.minecraft.client.Minecraft.func_71384_a(MinecraftOverlay.java:527)
      at net.minecraft.client.Minecraft.func_99999_d(MinecraftOverlay.java:815)
      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)
      Caused by: java.lang.NoSuchFieldError: arrow
      at mcuniversal.modmcu.ModMCU.Init(ModMCU.java:46)
      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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
      at sun.reflect.GeneratedMethodAccessor3.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:47)
      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.sendEventToModContainer(LoadController.java:208)
      at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
      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:47)
      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:118)
      at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
      … 10 more
      
      1 réponse Dernière réponse Répondre Citer 0
      • jglrxavpok
        jglrxavpok Modérateurs dernière édition par

        Explique nous comment tu as compilé le mod. Ça a l’air de venir de là.

        Modérateur sur MFF. 
        Mon Github: http://github.com/jglrxavpok
        Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

        1 réponse Dernière réponse Répondre Citer 0
        • Fine33
          Fine33 dernière édition par

          ​ GameRegistry.addRecipe(new ItemStack(Items.arrow, 4), new Object[]{"XX3", "X5X", "7XX", Character.valueOf('3'), new ItemStack(Blocks.cobblestone, 1), Character.valueOf('5'), new ItemStack(Items.stick, 1), Character.valueOf('7'), new ItemStack(Items.stick, 1), });
          

          Déjà, tu n’as pas inscrit ce que signifie “X”. Si tu veux qu’il n’y ait rien à la place des “X”, tu les remplace par des espaces.

          Mes mods :

          Agriculcraft

          #L'âge ne fait pas le mod.(L'âge ne fait pas le mod.)

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

            xavpok -> 444 messages, 42 points de réputation, ça mérite un screen

            En tout cas xavpok à la bonne réponse.

            1 réponse Dernière réponse Répondre Citer 0
            • jglrxavpok
              jglrxavpok Modérateurs dernière édition par

              Tu as du utiliser les .class générés par Eclipse et non pas ceux par Gradle.
              Il faut absolument utiliser gradle sinon l’obfuscation de Minecraft ne sera pas prise en compte.

              Modérateur sur MFF. 
              Mon Github: http://github.com/jglrxavpok
              Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

              1 réponse Dernière réponse Répondre Citer 0
              • D
                DarkOfNight dernière édition par

                J’utilise La commande Build de ForgeGradlew qui me compile le mod, ainsi que la commande Jar.

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

                  gradlew build
                  puis tu as prit le fichier jar qui se trouve dans forge/build/libs/ ?

                  1 réponse Dernière réponse Répondre Citer 0
                  • D
                    DarkOfNight dernière édition par

                    Oui, que j’ai mis après dans le dossier mods de mon .minecraft / serveur…
                    avant il marchait nickel, mais depuis que je l’ai recompilé en une version “1.4.4” au lieu de “1.4.2” (version du mod, pas de minecraft), eh bien il plante… J’ai réessayé en lui remettant en 1.4.2, mais rien n’y fait…

                    le fait que le mod n’est pas obfusqué (désolé pour l’orthographe) pourrait générer ce problème? (je cherche la commande pour régler ça au cas où)

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

                      Oui, c’est ça qui cause le problème. Envoie ton fichier build.gradle.

                      1 réponse Dernière réponse Répondre Citer 1
                      • D
                        DarkOfNight dernière édition par

                        buildscript {
                        
                            repositories {
                                mavenCentral()
                                maven {
                                    name = "forge"
                                    url = "http://files.minecraftforge.net/maven"
                                }
                                maven {
                                    name = "sonatype"
                                    url = "https://oss.sonatype.org/content/repositories/snapshots/"
                                }
                            }
                            dependencies {
                                classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
                            }
                        }
                        
                        apply plugin: 'forge'
                        
                        version = "1.4.4"
                        group= "mcuniversal.modmcu.ModMCU" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
                        archivesBaseName = "Mod MCU"
                        
                        minecraft {
                            version = "1.7.2-10.12.2.1147"
                            assetDir = "eclipse/assets"
                        }
                        
                        dependencies {
                            // you may put jars on which you depend on in ./libs
                            // or you may define them like so..
                            //compile "some.group:artifact:version:classifier"
                            //compile "some.group:artifact:version"
                        
                            // real examples
                            //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
                            //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
                        
                            // for more info…
                            // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
                            // http://www.gradle.org/docs/current/userguide/dependency_management.html
                        
                        }
                        
                        processResources
                        {
                            // this will ensure that this task is redone when the versions change.
                            inputs.property "version", project.version
                            inputs.property "mcversion", project.minecraft.version
                        
                            // replace stuff in mcmod.info, nothing else
                            from(sourceSets.main.resources.srcDirs) {
                                include 'mcmod.info'
                        
                                // replace version and mcversion
                                expand 'version':project.version, 'mcversion':project.minecraft.version
                            }
                        
                            // copy everything else, thats not the mcmod.info
                            from(sourceSets.main.resources.srcDirs) {
                                exclude 'mcmod.info'
                            }
                        }
                        
                        

                        EDIT: c’est bon j’ai réussi, avec la commande “Reobf” de Gradlew. (voilà ce qu’il se passe quand on a plus l’habitude de forger…) Merci pour tout !

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

                          Ce qui est étrange c’est qu’il devrait reobg tout seul.

                          1 réponse Dernière réponse Répondre Citer 0
                          • D
                            DarkOfNight dernière édition par

                            C’est vrai….
                            Mais bon, le principal c’est que ça marche quand même (je ne suis pas à une commande prêt ^^ )

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

                            MINECRAFT FORGE FRANCE © 2018

                            Powered by NodeBB