I've been working on a little update to a mod I created and am having some trouble. My mod previously had only "items" and updated to MC 1.2.3 just fine. But, now I'm trying to add naturally generated blocks and am having an issue.
When using MCP 6.0 (I have ModLoader 1.2.3 in the jar), I get no errors on recompilation with my mod. When I run the test client in MCP, I get the following error message:
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT b1ba1330 --------
Generated 3/4/12 9:03 AM
Minecraft: Minecraft 1.2.3
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_31, Sun Microsystems Inc.
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: Intel® HD Graphics Family version 3.0.0 - Build 8.15.10.2353, Intel
java.lang.ArrayIndexOutOfBoundsException: 505
at net.minecraft.src.ModLoader.initStats(ModLoader.java:902)
at net.minecraft.src.ModLoader.init(ModLoader.java:875)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:154)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:423)
at net.minecraft.client.Minecraft.run(Minecraft.java:784)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT a073d87a ----------
Any help in what might be causing this and how I can fix it would be greatly appreciated.
you guys are trying to look too hard!
the problem is that you cant have a block id over 255
your block id is 505
you should have been able to tell that from the first post
you guys are trying to look too hard!
the problem is that you cant have a block id over 255
your block id is 505
you should have been able to tell that from the first post
YOU ARE FRICKIN' AWESOME!! Thank you so much! I knew it was probably something really simple... lol.
i am having the same problem only im an idiot when it comes to coding so how do i fix it back to 255??
If you look at your code, you assigned a number to your block when you created it. For example:
PotatoBlock = (new Block(505, ModLoader.addOverride("/terrain.png", "/gfx/potatoBlock.png"))).setHardness(0.5F).setStepSound(Block.soundClothFootstep).setBlockName("potatoBlock");
Where I have the number 505 is the "data value" number I assigned to my block. Blocks can't go above 255. It doesn't have to be 255 exactly. It can be anywhere from 124(ish, depending on new things that have been added) to 255.
I've been working on a little update to a mod I created and am having some trouble. My mod previously had only "items" and updated to MC 1.2.3 just fine. But, now I'm trying to add naturally generated blocks and am having an issue.
When using MCP 6.0 (I have ModLoader 1.2.3 in the jar), I get no errors on recompilation with my mod. When I run the test client in MCP, I get the following error message:
Mods loaded: 2
ModLoader 1.2.3
mod_CafeFoods 1.2.1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT b1ba1330 --------
Generated 3/4/12 9:03 AM
Minecraft: Minecraft 1.2.3
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_31, Sun Microsystems Inc.
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: Intel® HD Graphics Family version 3.0.0 - Build 8.15.10.2353, Intel
java.lang.ArrayIndexOutOfBoundsException: 505
at net.minecraft.src.ModLoader.initStats(ModLoader.java:902)
at net.minecraft.src.ModLoader.init(ModLoader.java:875)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:154)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:423)
at net.minecraft.client.Minecraft.run(Minecraft.java:784)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT a073d87a ----------
Any help in what might be causing this and how I can fix it would be greatly appreciated.
Thanks!
This is my mod class file code. Thanks for taking a look
Here ya go
the problem is that you cant have a block id over 255
your block id is 505
you should have been able to tell that from the first post
java.lang.ArrayIndexOutOfBoundsException: 505
This clearly states that 505 is out of the limits that are set for this value.
YOU ARE FRICKIN' AWESOME!! Thank you so much! I knew it was probably something really simple... lol.
If you look at your code, you assigned a number to your block when you created it. For example:
Where I have the number 505 is the "data value" number I assigned to my block. Blocks can't go above 255. It doesn't have to be 255 exactly. It can be anywhere from 124(ish, depending on new things that have been added) to 255.
Where Gamergirl7185 has:
PotatoBlock = (new Block(505, ModLoader.addOverride("/terrain.png", "/gfx/potatoBlock.png"))).setHardness(0.5F).setStepSound(Block.soundClothFootstep).setBlockName("potatoBlock");
You would change the 505 to a number under 255 but over 124
The code where you change the number would be in the mod_(whatever you named your mod) class file that you created for your mod.