Posted June 28, 201312 yr Hi, So I created this (below) method to register my blocks is MoToolsRegistry.class public static void registerBlocks(Block block, String name, String unlocalizedName){ GameRegistry.registerBlock(block, MoTools.modID + unlocalizedName); LanguageRegistry.addName(block, name); } And called it in MoTools.class MoToolsRegistry reg = new MoToolsRegistry(); reg.registerBlocks(blockAzurite, "Azurite Ore", oreAzurite.getUnlocalizedName2()); But forge is throwing me this error: ---- Minecraft Crash Report ---- // I feel sad now Time: 28/06/13 17:22 Description: Failed to start game cpw.mods.fml.common.LoaderException: java.lang.NullPointerException at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:232) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:195) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:171) at hydro.motools.common.MoToolsRegistry.registerBlocks(MoToolsRegistry.java:10) at hydro.motools.common.MoTools.blockRegistry(MoTools.java:69) at hydro.motools.common.MoTools.load(MoTools.java:49) 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:494) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:213) at net.minecraft.client.Minecraft.startGame(Minecraft.java:448) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:733) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:214) ... 37 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.5.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_10, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 793304368 bytes (756 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 Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.51 FML v5.2.23.738 Minecraft Forge 7.8.1.738 6 mods loaded, 6 mods active mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{5.2.23.738} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized Forge{7.8.1.738} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized darkage{Pre-Alpha} [Hydro's Dark Age] (bin) Unloaded->Constructed->Pre-initialized->Initialized motools{InDev} [Hydro's Mo' Tools] (bin) Unloaded->Constructed->Pre-initialized->Errored TutMod{Alpha 1.0.0} [Tut Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized LWJGL: 2.4.2 OpenGL: AMD Radeon HD 6450 GL version 4.2.12002 Compatibility Profile Context 9.12.0.0, ATI Technologies Inc. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Texture Pack: Default Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null And frankly, I have no idea why. Any help?
June 28, 201312 yr is "blockLazurite initialined ? (somethign like blockLazurite = new BlockLazurite(arguments); ) how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
June 28, 201312 yr Yes. Yes it is sorry we do get some pretty stupid question sometimes at cpw.mods.fml.common.registry.GameRegistry.registerBlock([b]GameRegistry.java:232[/b]) can you check at line 232 of GameRegistry to see what reference is null like if(ref == null){ System.out.println("ref is null"); } how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
June 28, 201312 yr Author Lines 229-233 say: catch (Exception e) { FMLLog.log(Level.SEVERE, e, "Caught an exception during block registration"); throw new LoaderException(e); }
June 28, 201312 yr Author Never mind. I see what I've done. I've used the wrong block This MoToolsRegistry reg = new MoToolsRegistry(); reg.registerBlocks(blockAzurite, "Azurite Ore", oreAzurite.getUnlocalizedName2()) Should be this MoToolsRegistry reg = new MoToolsRegistry(); reg.registerBlocks(oreAzurite, "Azurite Ore", oreAzurite.getUnlocalizedName2()) Silly me
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.