Posted September 12, 201411 yr Hi I'm testing my mod using the wrapped Minecraft in the Forge source. But when Minecraft was initializing it crashed! I take a look on the crash report and i found out there was a block registration problem. But when i take a look at my mod code, its like there is no problem. The lines where the error happened is line 137 here's the crash report: ---- Minecraft Crash Report ---- // Ooh. Shiny. Time: 9/12/14 4:39 PM Description: There was a severe problem during mod loading that has caused the g ame to fail cpw.mods.fml.common.LoaderException: java.lang.IllegalArgumentException: The nam e pixelblocks:redBlock has been registered twice, for pixelblocks.blocks.Blocks. BeigeColoredBlock@63b0c4 and pixelblocks.blocks.Blocks.BisqueColoredBlock@1fac3b a. at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:22 2) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:17 1) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:16 0) at pixelblocks.PixelBlocks.preInit(PixelBlocks.java:137) 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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(Synchronized EventHandler.java:47) 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.ja va: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.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(Synchronized EventHandler.java:47) 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.jav a:118) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:512) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler. java:239) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.IllegalArgumentException: The name pixelblocks:redBlock has been registered twice, for pixelblocks.blocks.Blocks.BeigeColoredBlock@63b0c4 a nd pixelblocks.blocks.Blocks.BisqueColoredBlock@1fac3ba. at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControll edNamespacedRegistry.java:376) at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:817) at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:792) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:21 2) ... 40 more A detailed walkthrough of the error, its code path and all known details is as f ollows: -------------------------------------------------------------------------------- ------- -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Windows 7 (x86) version 6.1 Java Version: 1.8.0_11, Oracle Corporation Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation Memory: 891888616 bytes (850 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 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.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-ini tialized FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded ->Constructed->Pre-initialized Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloade d->Constructed->Pre-initialized pixelblocks{1.0} [PixelBlocks Mod] (bin) Unloaded->Constructed->Errored here are the code in line 137: GameRegistry.registerBlock(BisqueColoredBlock, "BisqueColoredBlock".substring(10)).setCreativeTab(tabWhiteBlocks); If you're having Minecraft problems post it here: http://www.minecraftforum.net/forums/support/unmodified-minecraft-client. If your problem is in Forge post it here: http://www.minecraftforge.net/forum/index.php/board,15.0.html. I'm writing this so n00bs know where they will post their n00by problems.
September 12, 201411 yr Author package pixelblocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import pixelblocks.blocks.Blocks.AliceBlueBlock; import pixelblocks.blocks.Blocks.AlizarinCrimsonColoredBlock; import pixelblocks.blocks.Blocks.AmberColoredBlock; import pixelblocks.blocks.Blocks.AmethystColoredBlock; import pixelblocks.blocks.Blocks.AntiqueWhiteColoredBlock; import pixelblocks.blocks.Blocks.AquamarineColoredBlock; import pixelblocks.blocks.Blocks.AsparagusColoredBlock; import pixelblocks.blocks.Blocks.AzureColoredBlock; import pixelblocks.blocks.Blocks.BeigeColoredBlock; import pixelblocks.blocks.Blocks.BisqueColoredBlock; import pixelblocks.blocks.Blocks.BistreColoredBlock; import pixelblocks.proxy.CommonProxy; 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.registry.GameRegistry; @Mod(modid = "pixelblocks", name = "PixelBlocks Mod", version = "1.0") public class PixelBlocks { @SidedProxy(clientSide="pixelblocks.proxy.ClientProxy", serverSide="pixelblocks.proxy.CommonProxy") public static CommonProxy proxy; //Declares blocks in Minecraft public static Block AliceBlueColoredBlock; public static Block AlizarinCrimsonColoredBlock; public static Block AmberColoredBlock; public static Block AmethystColoredBlock; public static Block AntiqueWhiteColoredBlock; public static Block AquamarineColoredBlock; public static Block AsparagusColoredBlock; public static Block AzureColoredBlock; public static Block BeigeColoredBlock; public static Block BisqueColoredBlock; public static Block BistreColoredBlock; //Creative Tabs public static CreativeTabs tabRedBlocks = new CreativeTabs("tabRedBlocks") { @Override public Item getTabIconItem() { return new ItemStack(AlizarinCrimsonColoredBlock).getItem(); } }; public static CreativeTabs tabYellowBlocks = new CreativeTabs("tabYellowBlocks") { @Override public Item getTabIconItem() { return new ItemStack(AmberColoredBlock).getItem(); } }; public static CreativeTabs tabGreenBlocks = new CreativeTabs("tabGreenBlocks") { @Override public Item getTabIconItem() { return new ItemStack(AsparagusColoredBlock).getItem(); } }; public static CreativeTabs tabBlueBlocks = new CreativeTabs("tabBlueBlocks") { @Override public Item getTabIconItem() { return new ItemStack(AzureColoredBlock).getItem(); } }; public static CreativeTabs tabVioletBlocks = new CreativeTabs("tabVioletBlocks") { @Override public Item getTabIconItem() { return new ItemStack(AmethystColoredBlock).getItem(); } }; public static CreativeTabs tabBrownBlocks = new CreativeTabs("tabBrownBlocks") { public Item getTabIconItem() { return new ItemStack(BistreColoredBlock).getItem(); } }; public static CreativeTabs tabWhiteBlocks = new CreativeTabs("tabWhiteBlocks") { @Override public Item getTabIconItem() { return new ItemStack(AliceBlueColoredBlock).getItem(); } }; @EventHandler public void preInit(FMLPreInitializationEvent event) { //Defines Blocks in Minecraft //Red Tab AlizarinCrimsonColoredBlock = new AlizarinCrimsonColoredBlock(Material.rock).setBlockTextureName("pixelblocks:AlizarinCrimson"); //Yellow Tab AmberColoredBlock = new AmberColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Amber"); //Green Tab AsparagusColoredBlock = new AsparagusColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Asparagus"); //Blue Tab AquamarineColoredBlock = new AquamarineColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Aquamarine"); AzureColoredBlock = new AzureColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Azure"); //Violet Tab AmethystColoredBlock = new AmethystColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Amethyst"); //White Tab AliceBlueColoredBlock = new AliceBlueBlock(Material.rock).setBlockTextureName("pixelblocks:AliceBlue"); AntiqueWhiteColoredBlock = new AntiqueWhiteColoredBlock(Material.rock).setBlockTextureName("pixelblocks:AntiqueWhite"); BeigeColoredBlock = new BeigeColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Beige"); BisqueColoredBlock = new BisqueColoredBlock(Material.rock).setBlockTextureName("pixelblocks:Bisque"); //Brown Tab BistreColoredBlock = new BistreColoredBlock(Material.rock).setBlockTextureName("pixelblocks.Bistre"); GameRegistry.registerBlock(AliceBlueColoredBlock, "AliceBlueColoredBlock".substring(1)).setCreativeTab(tabWhiteBlocks); GameRegistry.registerBlock(AlizarinCrimsonColoredBlock, "AlizarinCrimsonColoredBlock".substring(2)).setCreativeTab(tabRedBlocks); GameRegistry.registerBlock(AmberColoredBlock, "AmberColoredBlock".substring(3)).setCreativeTab(tabYellowBlocks); GameRegistry.registerBlock(AmethystColoredBlock, "AmethystColoredBlock".substring(4)).setCreativeTab(tabVioletBlocks); GameRegistry.registerBlock(AntiqueWhiteColoredBlock, "AntiqueWhiteColoredBlock".substring(5)).setCreativeTab(tabWhiteBlocks); GameRegistry.registerBlock(AquamarineColoredBlock, "AquamarineColoredBlock".substring(6)).setCreativeTab(tabBlueBlocks); GameRegistry.registerBlock(AsparagusColoredBlock, "AsparagusColoredBlock".substring(7)).setCreativeTab(tabGreenBlocks); GameRegistry.registerBlock(AzureColoredBlock, "AzureColoredBlock".substring().setCreativeTab(tabBlueBlocks); GameRegistry.registerBlock(BeigeColoredBlock, "BeigeColoredBlock".substring(9)).setCreativeTab(tabWhiteBlocks); GameRegistry.registerBlock(BisqueColoredBlock, "BisqueColoredBlock".substring(10)).setCreativeTab(tabWhiteBlocks); GameRegistry.registerBlock(BistreColoredBlock, "BistreColoredBlock".substring(11)).setCreativeTab(tabBrownBlocks); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRenderers(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } If you're having Minecraft problems post it here: http://www.minecraftforum.net/forums/support/unmodified-minecraft-client. If your problem is in Forge post it here: http://www.minecraftforge.net/forum/index.php/board,15.0.html. I'm writing this so n00bs know where they will post their n00by problems.
September 12, 201411 yr Author Thanks! I used substring because i want to know how many blocks i registered If you're having Minecraft problems post it here: http://www.minecraftforum.net/forums/support/unmodified-minecraft-client. If your problem is in Forge post it here: http://www.minecraftforge.net/forum/index.php/board,15.0.html. I'm writing this so n00bs know where they will post their n00by problems.
September 13, 201411 yr Author Look closely, what i plan to do is to make 86 solid color blocks and i used substring in the block registration because i want to know how many blocks i made (Like making a ordered list). If you're having Minecraft problems post it here: http://www.minecraftforum.net/forums/support/unmodified-minecraft-client. If your problem is in Forge post it here: http://www.minecraftforge.net/forum/index.php/board,15.0.html. I'm writing this so n00bs know where they will post their n00by problems.
September 13, 201411 yr You could all read this in the crash report. And the game crashes if you register 2 things with the same ID.
September 13, 201411 yr Author The problem is fixed right now If you're having Minecraft problems post it here: http://www.minecraftforum.net/forums/support/unmodified-minecraft-client. If your problem is in Forge post it here: http://www.minecraftforge.net/forum/index.php/board,15.0.html. I'm writing this so n00bs know where they will post their n00by problems.
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.