Résolu Crash Recipe OreDict
-
Bonjour j’ai un problème, mon jeu crash suite a l’ajout de mes recipes avec l’OreDict
[12:16:16] [Client thread/ERROR] [FML]: Caught exception from mechanicalcraft java.lang.NullPointerException at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:236) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:250) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:245) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at com.spyman.mechanicalcraft.common.MechanicalCraft.preInit(MechanicalCraft.java:320) ~[NewMechanicalCraft/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] 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 cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] 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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?] at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556) [Loader.class:?] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:942) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) [idea_rt.jar:?] [12:16:16] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ---- // There are four lights! Time: 01/04/16 12:16 Description: Initializing game java.lang.NullPointerException: Initializing game at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:236) at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:250) at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:245) at com.spyman.mechanicalcraft.common.MechanicalCraft.preInit(MechanicalCraft.java:320) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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:119) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:942) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
-
Dans ton schéma de recette, tu n’indiques pas ce qu’est le “O”. Et pourquoi la balise résolu ?
-
C’est un zero, je le met quand je ne veut pas d’item a cette emplecement
Avant cça ne crashait pas mais depuis quej’ai mit l’oredict il crash -
Ah autant pour moi ^^
Je vais regarder en détail ce qui manque. -
GameRegistry.addRecipe(new ItemStack(tinGear, 1, 0), new Object[] { "0I0", "III", "0I0", 'I', "ingotTin" });
Les recettes ne fonctionnent pas comme ça. Tu ne peux pas dire que I est un string. ça doit être un bloc, un item ou un item stack.
Si tu veux utiliser “ingotTin” du dictionnaire de forge, il faut utiliser les ShapedOreRecipe :
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(tinGear, 1, 0), new Object[] { "0I0", "III", "0I0", 'I', "ingotTin" }));
-
Merci !!