Jump to content

[1.10.2] Strange crash, I cant figured where the problem is.


Recommended Posts

Posted

Hello again.

 

Well, i've decided to add more block to my mod.

 

But then, this happends :

 

---- Minecraft Crash Report ----
// I feel sad now :(

Time: 14/08/17 15:01
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Steamhouse's Mod (stm)
Caused by: java.lang.NullPointerException
	at fr.steamhouse.mod.init.ModBlocks.registerBlock(ModBlocks.java:257)
	at fr.steamhouse.mod.init.ModBlocks.register(ModBlocks.java:193)
	at fr.steamhouse.mod.MainClass.preInit(MainClass.java:48)
	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:618)
	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:243)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221)
	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:145)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:624)
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:259)
	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:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.10.2
	Operating System: Windows 7 (amd64) version 6.1
	Java Version: 1.8.0_131, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 802307184 bytes (765 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.3.2281 5 mods loaded, 5 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.3.2281.jar) 
	UCH	Forge{12.18.3.2281} [Minecraft Forge] (forgeSrc-1.10.2-12.18.3.2281.jar) 
	UCE	stm{Stable Alpha} [Steamhouse's Mod] (bin) 
	UCH	JEI{3.14.6.409} [Just Enough Items] (jei_1.10.2-3.14.6.409.jar) 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 384.76' Renderer: 'GeForce GTX 770/PCIe/SSE2'

 

And here's my code for all the blocks :

 

package fr.steamhouse.mod.init;

import com.ibm.icu.impl.Norm2AllModes.Normalizer2WithImpl;

import fr.steamhouse.mod.MainClass;
import fr.steamhouse.mod.References;
import fr.steamhouse.mod.blocks.BlockSystemShock;
import fr.steamhouse.mod.blocks.BlockColor;
import fr.steamhouse.mod.blocks.BlockRPGM;
import fr.steamhouse.mod.utilities.Utools;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.color.BlockColors;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.NextTickListEntry;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;

public class ModBlocks {
	
		public static Block matrix;
		public static Block fondVert;
		public static Block Rouge;
		public static Block Bleu;
		public static Block Vert;
		public static Block Noir;
		public static Block Jaune;
		public static Block Blanc;
		public static Block Gris;
		public static Block Rose;
		public static Block Marron;
		public static Block Orange;
		public static Block Violet;
		public static Block carrelage;
		
		public static Block bridgeblack1176;
		public static Block bridgeblack1178;
		public static Block bridgeblack1180;
		public static Block bridgeblack1181;
		public static Block bridgeblack1184;
		public static Block bridgeblack1187;
		public static Block bridgegray1179;
		public static Block bridgegray1231;
		public static Block bridgegray1231_1;
		public static Block bridgetan1228;
		public static Block citmatblue2183;
		public static Block citmatbluegreen2180;
		public static Block citmatgray2186;
		public static Block citmatgray2187;
		public static Block citmatgray2188;
		public static Block citmatgray2189;
		public static Block citmatgray2192;
		public static Block citmatgraynocontain;
		public static Block citmatorange2184;
		public static Block citmatorange2185;
		public static Block citmatorange2190;
		public static Block citmatorange2194;
		public static Block citmatred2182;
		public static Block citmatyellow2181;
		public static Block sharedtan1118;
		
		public static Block brickpath;
		public static Block brickwall;
		public static Block brickwall2;
		public static Block brickwall3;
		public static Block dalle1;
		public static Block dalle2;
		public static Block desertpath;
		public static Block desertpath2;
		public static Block frozenwall;
		public static Block frozenpath;
		public static Block kitchencal;
		public static Block rockpath;
		public static Block rockpath2;
		public static Block rockwall;
		public static Block woodpath;
		
		public static void init() {
			matrix  = new BlockSystemShock("matrix", "matrix").setLightLevel(0.6F);
			fondVert = new BlockColor("fondvert", "fondvert");
			Rouge = new BlockColor("red", "red");
			Bleu = new BlockColor("blue", "blue");
			Vert = new BlockColor("green", "green");
			Noir = new BlockColor("black", "black");
			Jaune = new BlockColor("yellow", "yellow");
			Blanc = new BlockColor("white", "white");
			Violet = new BlockColor("purple", "purple");
			Rose = new BlockColor(("pink"), "pink");
			Gris = new BlockColor("gray", "gray");
			Orange = new BlockColor("orange", "orange");
			Marron = new BlockColor("brown", "brown");
			carrelage = new BlockSystemShock("carrelage", "carrelage");
			
			bridgeblack1176  = new BlockSystemShock("bridgeblack1176", "bridgeblack1176");
			bridgeblack1178 = new BlockSystemShock("bridgeblack1178", "bridgeblack1178");
			bridgeblack1180 = new BlockSystemShock("bridgeblack1180", "bridgeblack1180");
			bridgeblack1181 = new BlockSystemShock("bridgeblack1181", "bridgeblack1181");
			bridgeblack1184 = new BlockSystemShock("bridgeblack1184", "bridgeblack1184");
			bridgeblack1187 = new BlockSystemShock("bridgeblack1187", "bridgeblack1187");
			bridgegray1179 = new BlockSystemShock("bridgegray1179", "bridgegray1179");
			bridgegray1231 = new BlockSystemShock("bridgegray1231", "bridgegray1231");
			bridgegray1231_1 = new BlockSystemShock("bridgegray1231_1", "bridgegray1231_1");
			bridgetan1228 = new BlockSystemShock("bridgetan1228", "bridgetan1228");
			citmatblue2183 = new BlockSystemShock("citmatblue2183", "citmatblue2183");
			citmatbluegreen2180 = new BlockSystemShock("citmatbluegreen2180", "citmatbluegreen2180");
			citmatgray2186 = new BlockSystemShock("citmatgray2186", "citmatgray2186");
			citmatgray2187 = new BlockSystemShock("citmatgray2187", "citmatgray2187");
			citmatgray2188 = new BlockSystemShock("citmatgray2188", "citmatgray2188");
			citmatgray2189 = new BlockSystemShock("citmatgray2189", "citmatgray2189");
			citmatgray2192 = new BlockSystemShock("citmatgray2192", "citmatgray2192");
			citmatgraynocontain = new BlockSystemShock("citmatgraynocontain", "citmatgraynocontain");
			citmatorange2184 = new BlockSystemShock("citmatorange2184", "citmatorange2184");
			citmatorange2185 = new BlockSystemShock("citmatorange2185", "citmatorange2185");
			citmatorange2190 = new BlockSystemShock("citmatorange2190", "citmatorange2190");
			citmatorange2194 = new BlockSystemShock("citmatorange2194", "citmatorange2194");
			citmatred2182 = new BlockSystemShock("citmatred2182", "citmatred2182");
			citmatyellow2181 = new BlockSystemShock("citmatyellow2181", "citmatyellow2181");
			sharedtan1118 = new BlockSystemShock("sharedtan1118", "sharedtan1118");
			
			brickpath = new BlockRPGM("brickpath", "brickpath");
			brickwall = new BlockRPGM("brickwall", "brickwall");
			brickwall2 = new BlockRPGM("brickwall2", "brickwall2");
			brickwall3 = new BlockRPGM("brickwall3", "brickwall3");
			dalle1 = new BlockRPGM("dalle1", "dalle1");
			dalle2 = new BlockRPGM("dalle2", "dalle2");
			desertpath = new BlockRPGM("desertpath", "desertpath");
			desertpath2 = new BlockRPGM("desertpath2", "desertpath2");
			frozenpath = new BlockRPGM("frozenpath", "frozenpath");
			frozenwall = new BlockRPGM("frozenwall", "frozenwall");
			kitchencal = new BlockRPGM("kitchencal", "kitchencal");
			rockpath = new BlockRPGM("rockpath", "rockpath");
			rockpath2 = new BlockRPGM("rockpath2", "rockpath2");
			woodpath = new BlockRPGM("woodpath", "woodpath");
		}
		
		public static void register() {
			registerBlock(matrix);
			registerBlock(Bleu);
			registerBlock(Noir);
			registerBlock(Rouge);
			registerBlock(Vert);
			registerBlock(Jaune);
			registerBlock(Blanc);
			registerBlock(Gris);
			registerBlock(Violet);
			registerBlock(Marron);
			registerBlock(Rose);
			registerBlock(Orange);
			registerBlock(fondVert);
			registerBlock(carrelage);
			
			registerBlock(bridgeblack1176);
			registerBlock(bridgeblack1178);
			registerBlock(bridgeblack1180);
			registerBlock(bridgeblack1181);
			registerBlock(bridgeblack1184);
			registerBlock(bridgeblack1187);
			registerBlock(bridgegray1179);
			registerBlock(bridgegray1231);
			registerBlock(bridgegray1231_1);
			registerBlock(bridgetan1228);
			registerBlock(citmatblue2183);
			registerBlock(citmatbluegreen2180);
			registerBlock(citmatgray2186);
			registerBlock(citmatgray2187);
			registerBlock(citmatgray2188);
			registerBlock(citmatgray2189);
			registerBlock(citmatgray2192);
			registerBlock(citmatgraynocontain);
			registerBlock(citmatorange2184);
			registerBlock(citmatorange2185);
			registerBlock(citmatorange2190);
			registerBlock(citmatorange2194);
			registerBlock(citmatred2182);
			registerBlock(citmatyellow2181);
			registerBlock(sharedtan1118);
			
			registerBlock(brickpath);
			registerBlock(brickwall);
			registerBlock(brickwall2);
			registerBlock(brickwall3);
			registerBlock(dalle1);
			registerBlock(dalle2);
			registerBlock(desertpath);
			registerBlock(desertpath2);
			registerBlock(frozenpath);
			registerBlock(frozenwall);
			registerBlock(kitchencal);
			registerBlock(rockpath);
			registerBlock(rockpath2);
			registerBlock(rockwall);
			registerBlock(woodpath);
		}
		
		public static void registerRenders() {
			registerRender(matrix);
			registerRender(Bleu);
			registerRender(Noir);
			registerRender(Rouge);
			registerRender(Vert);
			registerRender(Jaune);
			registerRender(Blanc);
			registerRender(Gris);
			registerRender(Violet);
			registerRender(Marron);
			registerRender(Rose);
			registerRender(Orange);
			registerRender(fondVert);
			registerRender(carrelage);
			
			registerRender(bridgeblack1176);
			registerRender(bridgeblack1178);
			registerRender(bridgeblack1180);
			registerRender(bridgeblack1181);
			registerRender(bridgeblack1184);
			registerRender(bridgeblack1187);
			registerRender(bridgegray1179);
			registerRender(bridgegray1231);
			registerRender(bridgegray1231_1);
			registerRender(bridgetan1228);
			registerRender(citmatblue2183);
			registerRender(citmatbluegreen2180);
			registerRender(citmatgray2186);
			registerRender(citmatgray2187);
			registerRender(citmatgray2188);
			registerRender(citmatgray2189);
			registerRender(citmatgray2192);
			registerRender(citmatgraynocontain);
			registerRender(citmatorange2184);
			registerRender(citmatorange2185);
			registerRender(citmatorange2190);
			registerRender(citmatorange2194);
			registerRender(citmatred2182);
			registerRender(citmatyellow2181);
			registerRender(sharedtan1118);
			
			registerRender(brickpath);
			registerRender(brickwall);
			registerRender(brickwall2);
			registerRender(brickwall3);
			registerRender(dalle1);
			registerRender(dalle2);
			registerRender(desertpath);
			registerRender(desertpath2);
			registerRender(frozenpath);
			registerRender(frozenwall);
			registerRender(kitchencal);
			registerRender(rockpath);
			registerRender(rockpath2);
			registerRender(rockwall);
			registerRender(woodpath);
		}
		
		public static void registerBlock(Block block) {
			block.setCreativeTab(MainClass.TabB);
			GameRegistry.register(block);
			GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
			Utools.getLogger().info("Register block for" + block.getUnlocalizedName().substring(5));
		}
		
		public static void registerRender(Block block) {
			ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(new ResourceLocation(References.MODID, block.getUnlocalizedName().substring(5)), "inventory"));
			Utools.getLogger().info("Register render for" + block.getUnlocalizedName().substring(5));;
		}
	}

 

I just make this the exact same way than before, so, why this time, it dosent work ? Did I make something wrong ?

 

Thanks for the help !

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.