RegisterItemsModels souligné en rouge



  • Bonsoir !

    J'ai voulu créer un nouvel item sur forge en 1.10.2. Mais j'ai un problème dans ma classe ClientProxy.
    Le "registerItemsModels" est souligné en rouge et fait donc crash le jeu.

    package com.blackoking.magicfood.proxy;
    
    import java.io.File;
    
    import com.blackoking.magicfood.items.ItemChickenFly;
    
    public class MagicFoodClientProxy extends MagicFoodCommonProxy
    {
        @Override
        public void preInit(File configFile)
        {
            super.preInit(configFile);
            ItemChickenFly.registerItemsModels();
        }
    
        @Override
        public void init()
        {
            super.init();
        }
    }
    
    

    Pouvez-vous m'aider svp ?


  • Administrateurs

    Salut,
    Quelle est l'erreur indiquée par eclipse ?



  • @'robin4002':

    Salut,
    Quelle est l'erreur indiquée par eclipse ?

    Salut !
    Voici l'erreur :

    The method registerItemsModels() is undefined for the type ItemChickenFly


  • Administrateurs

    La fonction registerItemsModels n'existe pas dans la classe ItemChickenFly.
    Tu te serait pas trompé de classe ?



  • @'robin4002':

    La fonction registerItemsModels n'existe pas dans la classe ItemChickenFly.
    Tu te serait pas trompé de classe ?

    Je t'envoies directement le github, parce que je n'arrive pas à trouver d'erreur par moi même 😞
    https://github.com/BlackOking/MagicFood/tree/master/src/main/java/com/blackoking/magicfood


  • Rédacteurs

    ItemChickenFly.registerItemsModels(); -> MagicFoodItems.registerItemsModels();



  • @'BrokenSwing':

    ItemChickenFly.registerItemsModels(); -> MagicFoodItems.registerItemsModels();

    Merci beaucoup ! Mais maintenant quand je lance le jeu, celui ci crash encore et me met cette erreur

    [23:13:56] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue
    [23:13:56] [Client thread/ERROR] [FML]:
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
    UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar)
    UCH Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar)
    UCE magicfood{0.1} [MagicFood] (bin)
    [23:13:56] [Client thread/ERROR] [FML]: The following problems were captured during this phase
    [23:13:56] [Client thread/ERROR] [FML]: Caught exception from magicfood
    java.lang.IllegalArgumentException: The name minecraft:stone has been registered twice, for net.minecraft.item.ItemMultiTexture@6fde6f05 and net.minecraft.item.ItemMultiTexture@7d9587b3.
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:460) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:206) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:54) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at net.minecraft.item.Item.registerItem(Item.java:1644) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at net.minecraft.item.Item.registerItemBlock(Item.java:1633) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at net.minecraft.item.Item.registerItems(Item.java:1126) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at com.blackoking.magicfood.proxy.MagicFoodCommonProxy.preInit(MagicFoodCommonProxy.java:12) ~[bin/:?]
    at com.blackoking.magicfood.proxy.MagicFoodClientProxy.preInit(MagicFoodClientProxy.java:12) ~[bin/:?]
    at com.blackoking.magicfood.ModMagicFood.preInit(ModMagicFood.java:31) ~[bin/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:579) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213) ~[forgeSrc-1.10.2-12.18.1.2011.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142) [LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:593) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:26) [start/:?]
    [23:13:56] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: –-- Minecraft Crash Report ----
    // Sorry :(
    
    Time: 03/09/16 23:13
    Description: Initializing game
    
    java.lang.IllegalArgumentException: The name minecraft:stone has been registered twice, for net.minecraft.item.ItemMultiTexture@6fde6f05 and net.minecraft.item.ItemMultiTexture@7d9587b3.
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:460)
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:206)
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:54)
    at net.minecraft.item.Item.registerItem(Item.java:1644)
    at net.minecraft.item.Item.registerItemBlock(Item.java:1633)
    at net.minecraft.item.Item.registerItems(Item.java:1126)
    at com.blackoking.magicfood.proxy.MagicFoodCommonProxy.preInit(MagicFoodCommonProxy.java:12)
    at com.blackoking.magicfood.proxy.MagicFoodClientProxy.preInit(MagicFoodClientProxy.java:12)
    at com.blackoking.magicfood.ModMagicFood.preInit(ModMagicFood.java:31)
    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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:579)
    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.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213)
    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.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:593)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)
    at net.minecraft.client.Minecraft.run(Minecraft.java:386)
    at net.minecraft.client.main.Main.main(Main.java:118)
    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:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Thread: Client thread
    Stacktrace:
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:460)
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:206)
    at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.register(FMLControlledNamespacedRegistry.java:54)
    at net.minecraft.item.Item.registerItem(Item.java:1644)
    at net.minecraft.item.Item.registerItemBlock(Item.java:1633)
    at net.minecraft.item.Item.registerItems(Item.java:1126)
    at com.blackoking.magicfood.proxy.MagicFoodCommonProxy.preInit(MagicFoodCommonProxy.java:12)
    at com.blackoking.magicfood.proxy.MagicFoodClientProxy.preInit(MagicFoodClientProxy.java:12)
    at com.blackoking.magicfood.ModMagicFood.preInit(ModMagicFood.java:31)
    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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:579)
    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.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213)
    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.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:593)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:255)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)
    
    -- Initialization --
    Details:
    Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:386)
    at net.minecraft.client.main.Main.main(Main.java:118)
    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:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)
    
    -- System Details --
    Details:
    Minecraft Version: 1.10.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_101, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 740830680 bytes (706 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.32 Powered by Forge 12.18.1.2011 4 mods loaded, 4 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
    UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar)
    UCH Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar)
    UCE magicfood{0.1} [MagicFood] (bin)
    Loaded coremods (and transformers):
    GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13447 Compatibility Profile Context 16.300.2511.1003' Renderer: 'AMD Radeon (TM) R9 380 Series'
    Launched Version: 1.10.2
    LWJGL: 2.9.4
    OpenGL: AMD Radeon (TM) R9 380 Series GL version 4.5.13447 Compatibility Profile Context 16.300.2511.1003, ATI Technologies Inc.
    GL Caps: Using GL 1.3 multitexturing.
    Using GL 1.3 texture combiners.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Shaders are available because OpenGL 2.1 is supported.
    VBOs are available because OpenGL 1.5 is supported.
    
    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs:
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
    [23:13:56] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Thomas\Desktop\Mods\MagicFood\run\.\crash-reports\crash-2016-09-03_23.13.56-client.txt
    Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
    
    

  • Rédacteurs

    Ton github est à jour ?



  • @'BrokenSwing':

    Ton github est à jour ?

    Oui 😉


  • Rédacteurs

    Il faut que tu enlèves ItemChickenFly.registerItems(); de ton proxy, ceci enregistre tout les objets de Minecraft, mais comme ils le sont déjà ça crash.



  • Ok dac, merci ! 😉



  • @'BrokenSwing':

    Il faut que tu enlèves ItemChickenFly.registerItems(); de ton proxy, ceci enregistre tout les objets de Minecraft, mais comme ils le sont déjà ça crash.

    Maintenant le jeu ne crash plus, mais l'item n’apparaît pas du tout en jeu 😞



  • Connais-tu les bases du Java avant de te lancer dans la création de mods ?

    Il faut que tu appels MagicFoodItems.registerItems() et pas ItemChickenFly.registerItems()
    ItemChickenFly.registerItems() revient a faire Item.registerItems(), et cette méthode enregistre tout les items vanilla



  • Dac, merci de l'aide !