Résolu Bloquer des mods non désirables au lancement du jeu
-
Les mods se trouvant dans mods/<ta version=“” de=“” minecraft=“”>/ sont aussi chargés.
Donc oui il faut les compter.</ta> -
ok alors j’ai 17 mods dans mon fichier mod ( comptan mon mod ) plus deux qui sont dans .AdamiteV2> mods >1.7.10 sa met fait 19 plus le 3 de base de forge sa me fait 22 je mais 22 dans :
public void postInit(FMLPostInitializationEvent event) { if(Loader.instance().getModList().size() != 22) // à changer { FMLCommonHandler.instance().exitJava(1, true); } if(Minecraft.getMinecraft().mcDataDir.getAbsolutePath().contains("AdamiteV2")) { // tout va bien System.out.println("Launcher Adamite vérifié"); } else { System.exit(-1); // radical } }
sa ne fonctionne pas voici le crash report
–-- Minecraft Crash Report ---- // Hi. I'm Minecraft, and I'm a crashaholic. Time: 13/05/16 07:35 Description: Initializing game java.lang.NullPointerException: Initializing game at net.minecraft.item.crafting.CraftingManager.func_92103_a(CraftingManager.java:230) at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:250) at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:245) at com.adamitemod.mod.init.CraftsMod.init(CraftsMod.java:34) at com.adamitemod.mod.AdamiteMod.preInit(AdamiteMod.java:94) 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:532) at sun.reflect.GeneratedMethodAccessor5.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:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) 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: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.func_71384_a(Minecraft.java:480) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) at net.minecraft.client.main.Main.main(SourceFile:148) 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) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.item.crafting.CraftingManager.func_92103_a(CraftingManager.java:230) at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:250) at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:245) at com.adamitemod.mod.init.CraftsMod.init(CraftsMod.java:34) at com.adamitemod.mod.AdamiteMod.preInit(AdamiteMod.java:94) 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:532) at sun.reflect.GeneratedMethodAccessor5.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:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) 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: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.func_71384_a(Minecraft.java:480) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) at net.minecraft.client.main.Main.main(SourceFile:148) 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) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (x86) version 10.0 Java Version: 1.8.0_66, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 132918840 bytes (126 MB) / 519110656 bytes (495 MB) up to 1037959168 bytes (989 MB) JVM Flags: 2 total; -Xms512M -Xmx1G 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.99.99 Minecraft Forge 10.13.4.1558 Optifine OptiFine_1.7.10_HD_C1 20 mods loaded, 20 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.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1558-1.7.10.jar) UCH Forge{10.13.4.1558} [Minecraft Forge] (forge-1.7.10-10.13.4.1558-1.7.10.jar) UCH CodeChickenCore{1.0.4.29} [CodeChicken Core] (minecraft.jar) UCH NotEnoughItems{1.0.3.74} [Not Enough Items] (NotEnoughItems-1.7.10.jar) UCH <cofh asm="">{000} [CoFH ASM] (minecraft.jar) UCH bspkrsCore{6.12} [bspkrsCore] ([1.7.10]bspkrsCore-universal-6.12.jar) UCH ArmorStatusHUD{1.27} [ArmorStatusHUD] ([1.7.10]ArmorStatusHUD-client-1.27.jar) UCH StatusEffectHUD{1.26} [StatusEffectHUD] ([1.7.10]StatusEffectHUD-client-1.26.jar) UCE adamitemod{1.0.0} [Adamite Mod] (adamitemod-1.0.0.jar) UCH Baubles{1.0.1.10} [Baubles] (Baubles-1.7.10-1.0.1.10.jar) UCH bdlib{1.9.2.104} [BD Lib] (bdlib-1.9.2.104-mc1.7.10.jar) UCH Botania{r1.8-249} [Botania] (Botania.jar) UCH CoFHCore{1.7.10R3.0.3} [CoFH Core] (CoFHCore-[1.7.10]3.0.3-303.jar) UCH ExtraUtilities{1.2.2} [Extra Utilities] (extrautilities-1.2.2.jar) UCH flansmod{4.10.0} [Flan's Mod] (FlansMod.jar) UCH Mantle{1.7.10-0.3.2.jenkins184} [Mantle] (Mantle-1.7.10-0.3.2.jar) UCH RandomThings{2.2.4} [Random Things] (RandomThings-2.2.4.jar) UCH StorageDrawers{1.7.10-1.5.4} [Storage Drawers] (StorageDrawers-1.7.10-1.5.4.jar) UCH TConstruct{1.7.10-1.8.8.DEV.GITBORK} [Tinkers' Construct] (TConstruct.jar) GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.4276' Renderer: 'Intel(R) HD Graphics' CoFHCore: -[1.7.10]3.0.3-303 Mantle Environment: DO NOT REPORT THIS CRASH! Unsupported mods in environment: optifine TConstruct Environment: Environment healthy. List of loaded APIs: * Baubles|API (1.0.1.10) from Baubles-1.7.10-1.0.1.10.jar * BotaniaAPI (76) from Botania.jar * BuildCraftAPI|core (1.0) from extrautilities-1.2.2.jar * BuildCraftAPI|tools (1.0) from extrautilities-1.2.2.jar * CoFHAPI (1.7.10R1.0.2) from FlansMod.jar * CoFHAPI|block (1.7.10R1.0.0) from extrautilities-1.2.2.jar * CoFHAPI|core (1.7.10R1.0.13B2) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHAPI|energy (1.7.10R1.0.2) from FlansMod.jar * CoFHAPI|fluid (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHAPI|inventory (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHAPI|item (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHAPI|modhelpers (1.7.10R1.0.13B2) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHAPI|tileentity (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHAPI|transport (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHAPI|world (1.7.10R1.0.13) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHLib (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|audio (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHLib|gui (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|gui|container (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|gui|element (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|gui|element|listbox (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|gui|slot (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|inventory (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHLib|render (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHLib|render|particle (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHLib|util (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar * CoFHLib|util|helpers (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|util|position (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|world (1.7.10R1.0.3B3) from CoFHLib-[1.7.10]1.0.3-175.jar * CoFHLib|world|feature (1.7.10R1.0.3) from CoFHCore-[1.7.10]3.0.3-303.jar Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: Intel(R) HD Graphics GL version 4.0.0 - Build 10.18.10.4276, Intel 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) ```</cofh>
-
Tu as un NPE dans cette class CraftsMod.java à la ligne 34
-
sa a rien a voir ar quannd je retire le truc pour limiter le mod sa marche !
-
@‘amigo127’:
sa a rien a voir ar quannd je retire le truc pour limiter le mod sa marche !
En français, ça donne quoi?
-
Ses bon sa fonctionne sans la sécurité maintenant mais sa crash quand je met sa ;
@EventHandler public void postInit(FMLPostInitializationEvent event) { if(Loader.instance().getModList().size() != 22) { FMLCommonHandler.instance().exitJava(1, true); } if(Boolean.parseBoolean(System.getProperty("fml.ignoreInvalidMinecraftCertificates","false"))) { FMLCommonHandler.instance().exitJava(1, true);} }
et pas de crash report :s
-
C’est que une des 2 conditions de ta méthode postInit est sûrement validée, et donc exitJava() est exécutée. Vérifie bien si tu as un total de 22 mods, recompte les si nécessaire !
-
J’en ai 19 plus les trois de base forgemodloader . . .
-
ajoutes :
System.out.println(Loader.instance().getModList().size());
dans init et regardes dans les logs le nombre qu’il indique.
Certains fichiers jar contiennent plusieurs mods. -
Sa s’affiche ou ?
-
Dans les logs.
dossier .minecraft/logs
fichier fml-client-latest.log -
j’arrive pas a lire il y a trop de mods voilla :http://pastebin.com/G3cQyZdz
-
T’es sûr d’avoir mis le println ? En tout cas je ne le vois pas.
-
oui voilla ma class
package com.adamitemod.mod; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.util.WeightedRandomChestContent; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.MinecraftForge; import com.adamitemod.mod.Dynamite.EntityDynamite; import com.adamitemod.mod.blocks.BlockElevator; import com.adamitemod.mod.blocks.ElevatorEvent; import com.adamitemod.mod.init.BlocksMod; import com.adamitemod.mod.init.CraftsMod; import com.adamitemod.mod.init.ItemsMod; import com.adamitemod.mod.items.ItemDynamite; import com.adamitemod.mod.proxy.CommonProxy; import com.adamitemod.mod.world.WorldRegister; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; 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.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @Mod(modid = References.MOD_ID, name = References.MOD_NAME, version = References.VERSION) public class AdamiteMod { @Instance(References.MOD_ID) public static AdamiteMod instance; public static Item Dynamite; public static Block Machine; public static Block MachineCraft; public static Block MachineCraftPul; @SidedProxy(clientSide = References.CLIENT_PROXY, serverSide = References.SERVER_PROXY) public static CommonProxy proxy; public static Block Elevator; public static CreativeTabs Ada = new CreativeTabs("Ada") { @SideOnly(Side.CLIENT) public Item getTabIconItem() { return ItemsMod.adamiteChestplate; } }; @EventHandler public void preInit(FMLPreInitializationEvent event) { { BlocksMod.init(); Elevator = new BlockElevator().setBlockTextureName(References.MOD_ID + ":elevator").setHardness(3.5F).setBlockName("Elevator").setCreativeTab(AdamiteMod.Ada); GameRegistry.registerBlock(Elevator, "Elevator"); BlocksMod.register(); ItemsMod.init(); Machine = new Machine().setBlockName("machine"); MachineCraft = new MachineCraft().setBlockName("machineCraft"); MachineCraftPul = new MachinePul().setBlockName("machinePul"); ItemsMod.register(); Dynamite = new ItemDynamite(Dynamite).setUnlocalizedName("Dynamite").setCreativeTab(AdamiteMod.Ada).setTextureName(References.MOD_ID + ":dynamite"); GameRegistry.registerItem(Dynamite, "Dynamite"); GameRegistry.registerBlock(Machine, "Machine"); GameRegistry.registerBlock(MachineCraft, "MachineCraft"); GameRegistry.registerBlock(MachineCraftPul, "MachinePul"); CraftsMod.init(); WorldRegister.mainRegsitry(); proxy.registerRenders(); EntityRegistry.registerModEntity(EntityDynamite.class, "Dynamite", 7, this, 64, 20, true); } } @EventHandler public void init(FMLInitializationEvent event) { System.out.println(Loader.instance().getModList().size()); proxy.registerRenders(); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.adamite), 1, 2, 1)); ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.adamite), 1, 2, 1)); ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CORRIDOR).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.adamite), 1, 3, 1)); ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CROSSING).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.adamite), 1, 3, 1)); ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_LIBRARY).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.adamite), 1, 3, 1)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.fission), 1, 1, 1)); ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.fission), 1, 1, 1)); ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CORRIDOR).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.fission), 1, 2, 1)); ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CROSSING).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.fission), 1, 2, 1)); ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_LIBRARY).addItem(new WeightedRandomChestContent(new ItemStack(ItemsMod.fission), 1, 2, 1)); MinecraftForge.EVENT_BUS.register(new ElevatorEvent()); FMLCommonHandler.instance().bus().register(new ElevatorEvent()); NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); EntityRegistry.registerModEntity(EntityDynamite.class, "Dynamite", 7, this, 64, 20, true); GameRegistry.registerTileEntity(TileEntityMachine.class, References.MOD_ID + ":MachineTileEntity"); GameRegistry.registerTileEntity(TileEntityMachineCraft.class, References.MOD_ID + ":MachineTileEntityCraft"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { if(Loader.instance().getModList().size() != 22) // à changer { FMLCommonHandler.instance().exitJava(1, true); } } @SubscribeEvent @SideOnly(Side.CLIENT) public void onTick(TickEvent.ClientTickEvent event) { Minecraft mc = FMLClientHandler.instance().getClient(); { } } }
-
System.out.println("coucou je suis la : " + Loader.instance().getModList().size());
Ensuite dans ton éditeur de texte -> ctrl + f -> coucou je suis la
-
fonctionne pas
-
Tu l’as mit où le print ?
Tu as bien recompilé ton mod ? -
dans le post init oui je l’es recompiler
-
Mets-le dans init.
-
Sa ne fonctionne toujours pas
Edit sa ne vien pas de la limitation de mods mais de :Caused by: java.lang.NullPointerException: Can't add null-object to the registry, name adamitemod:MachineCraft.
Dezolé –’