Résolu [Forge v10.13.2.1291] Crash au lancement
-
Bonjour,
J’ai suivi la vidéo ’ [1.7.x] Ajouter un gui et un container à un bloc. ’ de Minecraft Forge France, il n’y a pas de version texte de ce tutoriel donc je demande de l’aide ici.
J’ai régulièrement pris soin (sauf à un moment dont je ne me souviens pas) de vérifier au cours du tutoriel de lancer le client de Minecraft pour voir s’il y avait un problème et je n’en ai pas eu jusqu’à l’étape de la vidéo qui correspond à 1h01,48sec. J’ai un crash au lancement du client qui m’indique:
–-- Minecraft Crash Report ---- // My bad. Time: 06/05/15 19:26 Description: Initializing game java.lang.NullPointerException: Initializing game at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:217) at aa.aaaaaa.aaaaa.meubles.common.Meubles.init(Meubles.java:111) 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.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 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.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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) 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.startGame(Minecraft.java:586) at net.minecraft.client.Minecraft.run(Minecraft.java:931) at net.minecraft.client.main.Main.main(Main.java:164) 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:217) at aa.aaaaaa.aaaaa.meubles.common.Meubles.init(Meubles.java:111) 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.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 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.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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) 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.startGame(Minecraft.java:586) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:931) at net.minecraft.client.main.Main.main(Main.java:164) 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 697839520 bytes (665 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized meubles{0.0.1} [Meubles] (bin) Unloaded->Constructed->Pre-initialized->Errored Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 5800 Series GL version 4.4.13283 Compatibility Profile Context 14.501.1003.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. 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) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
De ce que je comprends l’erreur provient du GuiHandler, pourtant je suis sûr d’avoir bien suivi la vidéo. D’où vient ce problème et comment le résoudre ?
-
Ah oui en effet je n’ai toujours pas fait la version texte
Tu peux envoyer ta classe principale ? -
Voilà.
package aa.aaaaaa.aaaaa.meubles.common; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.block.Block; import net.minecraftforge.common.util.EnumHelper; 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.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import aa.aaaaaa.aaaaa.meubles.proxy.CommonProxy; @Mod(modid = Meubles.MODID, name = "Meubles", version = "0.0.1") public class Meubles { @Instance("MODID") public static Meubles instance; public static final String MODID = "meubles"; @SidedProxy(clientSide = "aa.aaaaaa.aaaaa.meubles.proxy.ClientProxy", serverSide = "aa.aaaaaa.aaaaa.meubles.proxy.CommonProxy") public static CommonProxy proxy; public static Item itemTutoriel, itemTutoriel2, helmetTuto, chestPlateTuto, leggingsTuto, bootsTuto; public static Block blockTutoriel, blockTutoriel2, blockMetadataTuto, blockTutoriel3, blockMetadataMultiTextureTuto, blockOrientable, blockMetadataOrientable, blockRenduAvance, blockRenduAvanceGuiContainer; public static ArmorMaterial armorTuto = EnumHelper.addArmorMaterial("armorTuto", 25, new int[]{4, 6, 5, 4}, 20); // name, durability, damageReduceAmount, enchantability @EventHandler public void preInit(FMLPreInitializationEvent event) { itemTutoriel = new ItemTutoriel().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(CreativeTabs.tabMaterials); itemTutoriel2 = new ItemTutoriel().setUnlocalizedName("tutoriel2").setTextureName(MODID + ":item_tutoriel2").setCreativeTab(CreativeTabs.tabMaterials); helmetTuto = new ItemTutoArmor(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel"); chestPlateTuto = new ItemTutoArmor(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel"); leggingsTuto = new ItemTutoArmor(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel"); bootsTuto = new ItemTutoArmor(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel"); //item GameRegistry.registerItem(itemTutoriel, "item_tutoriel"); GameRegistry.registerItem(itemTutoriel2, "item_tutoriel2"); //itemArmor GameRegistry.registerItem(helmetTuto, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateTuto, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsTuto, "item_tuto_leggings"); GameRegistry.registerItem(bootsTuto, "item_tuto_boots"); //block blockTutoriel = new BlockTutoriel(Material.rock).setBlockName("tutoriel").setBlockTextureName(MODID + ":block_tutoriel").setCreativeTab(CreativeTabs.tabBlock); blockTutoriel2 = new BlockTutoriel(Material.wood).setBlockName("tutoriel2").setBlockTextureName(MODID + ":block_tutoriel2").setCreativeTab(CreativeTabs.tabBlock); //block metadata blockMetadataTuto = new BlockTutorielMetadata().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); //setHardness = résistence à la main & setResistance à la TNT //block multitexture blockTutoriel3 = new BlockTutoriel2(Material.wood).setBlockName("tutoriel3").setCreativeTab(CreativeTabs.tabBlock); //block metadata multitexture blockMetadataMultiTextureTuto = new BlockTutorielMetadataMultiTexture().setBlockName("metadataTuto").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); //setHardness = résistence à la main & setResistance à la TNT //block orientable blockOrientable = new BlockOrientable(Material.wood).setBlockName("blockOrientable").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); //block metadata orientable blockMetadataOrientable = new BlockMetadataOrientable().setBlockName("blockMetadataOrientable").setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabBlock); //block rendu avancé blockRenduAvance = new BlockRenduAvance(Material.wood).setBlockName("renduAvance").setBlockTextureName(MODID + ":block_tutoriel2").setCreativeTab(CreativeTabs.tabBlock); //block rendu avancé blockRenduAvanceGuiContainer = new BlockRenduAvanceGuiContainer(Material.wood).setBlockName("renduAvanceGuiContainer").setBlockTextureName(MODID + ":block_tutoriel2").setCreativeTab(CreativeTabs.tabBlock); //block GameRegistry.registerBlock(blockTutoriel, "block_tutoriel"); GameRegistry.registerBlock(blockTutoriel2, "block_tutoriel2"); //block metadata GameRegistry.registerBlock(blockTutoriel3, "block_tutoriel3"); //block multitexture GameRegistry.registerBlock(blockMetadataTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata"); //block metadata multitexture GameRegistry.registerBlock(blockMetadataMultiTextureTuto, ItemBlockMetadataTutoriel.class, "block_tuto_metadata_multi_texture"); //block orientable GameRegistry.registerBlock(blockOrientable, ItemBlockMetadataTutoriel.class, "blockOrientable"); //block metadata orientable GameRegistry.registerBlock(blockMetadataOrientable, ItemBlockMetadataTutoriel.class, "blockMetadataOrientable"); //block rendu avancé GameRegistry.registerBlock(blockRenduAvance, "blockRenduAvance"); //block rendu avancé gui container GameRegistry.registerBlock(blockRenduAvanceGuiContainer, "blockRenduAvanceGuiContainer"); } @EventHandler public void init(FMLInitializationEvent event) { GameRegistry.registerTileEntity(TileEntityTutoriel.class, "meubles:tutoriel"); GameRegistry.registerTileEntity(TileEntityDirectional.class, "meubles:directional"); GameRegistry.registerTileEntity(TileEntityRenduAvance.class, "meubles:renduAvance"); GameRegistry.registerTileEntity(TileEntityRenduAvanceGuiContainer.class, "meubles:renduAvanceGuiContainer"); NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandlerTuto()); proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Je précise que le package explorer n’indique aucune erreur.
@SidedProxy(clientSide = "aa.aaaaaa.aaaaa.meubles.proxy.ClientProxy", serverSide = "aa.aaaaaa.aaaaa.meubles.proxy.CommonProxy")
J’ai mis des ’ a ’ à cette ligne (de même ailleurs), ça cache mon adresse email.
-
@Instance("MODID") public static Meubles instance;
….
->@Instance(Meubles.MODID) public static Meubles instance;
ou
@Instance("meubles") public static Meubles instance;
-
@‘Lyacos’:
J’ai mis des ’ a ’ à cette ligne (de même ailleurs), ça cache mon adresse email.
PS : la convention java dit que ça se référence plus à un site web qu’à une adresse mail, privilégie fr.tonpseudo.tonmod .
PS 2 : toutes les personnes qui auront ton mod pourront le décompiler et donc voir ton adresse e-mail. -
Même pas besoin de décompiler, il suffit d’ouvrir le .jar
-
@SCAREX: erf ^^, la prochaine fois je jette aussi un œil au rapport de crash. Après ça reste qu’un apprentissage pas un vrai mod pour le moment et j’espère un jour être capable de produire moi-même du code mais je prends bien note de ton PS & PS2 (au passage tu peux supprimer mon adresse email de ta réponse ?).
@robin4002: merci ça marche maintenant, avant de mettre en résolu j’aimerai avoir une dernière réponse, je pensais avoir suivi rigoureusement tes tutoriels vidéos (concernant l’item de base et sur les blocks), j’ai vraiment pas le souvenir que tu es fait ce changement à un moment. Si tu te souviens tu peux me dire pourquoi cette modification et quand tu l’as fait ?
-
https://youtu.be/LLIaljWXMXM?t=13m37s
C’est la seule fois où je touche à l’instance. Enfin il me semble. -
Ah… la vidéo de base, surement un moment d’inattention, merci de l’information. ^^