Quote from SergeantBalthazar
Well that didn't help one bit, so I went back into my code, changed the "abstract class" back into "public class" and got no errors, but I get a new crash report on the CMD, which is all about codes which I have not edited. So, could you take a look guys?
Error
== MCP 5.6 (data: 5.6, client: 1.1, server: 1.1) == [07:21:55] 27 achievements [07:21:55] 174 recipes [07:21:56] ModLoader 1.1 Initializing... [07:21:56] Mod Initialized: mod_FirstBlock 1.1.0 [07:21:56] Overriding /terrain.png with /FirstBlock.png @ 30. 43 left. [07:21:56] Exception in thread "Minecraft main thread" java.lang.ExceptionInInit ializerError [07:21:56] at net.minecraft.client.Minecraft.startGame(Minecraft.java:316) [07:21:56] at net.minecraft.client.Minecraft.run(Minecraft.java:620) [07:21:56] at java.lang.Thread.run(Unknown Source) [07:21:56] Caused by: java.lang.RuntimeException: java.lang.NullPointerException [07:21:56] at net.minecraft.src.ModLoader.init(ModLoader.java:745) [07:21:56] at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:15 0) [07:21:56] at net.minecraft.src.RenderManager.<init>(RenderManager.java:78) [07:21:56] at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9 ) [07:21:56] ... 3 more [07:21:56] Caused by: java.lang.NullPointerException [07:21:56] at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.j ava:361) [07:21:56] at net.minecraft.src.ModLoader.AddRecipe(ModLoader.java:344) [07:21:56] at net.minecraft.src.mod_FirstBlock.load(mod_FirstBlock.java:19) [07:21:56] at net.minecraft.src.ModLoader.init(ModLoader.java:714) [07:21:56] ... 6 more [07:24:14] [07:24:14] [07:24:14] [07:24:14] [07:24:14] [07:24:14] [07:24:14] Press any key to continue . . .
OK I FIXED EVERYTHING. CODE IS BELOW.
mod_FirstBlock
package net.minecraft.src; public class mod_FirstBlock extends BaseMod { public static Block First; public static int firstID = 233; static { First = new BlockFirst(firstID, ModLoader.addOverride("/terrain.png", "/FirstBlock.png")).setHardness(1.0F).setBlockName("First").setResistance(6000.0F).setLightValue(0.3F); } public String getVersion() { return "1.1.0"; } public void load() { ModLoader.RegisterBlock(First); ModLoader.AddName(First, "First Block"); ModLoader.AddRecipe(new ItemStack(First), new Object[]{ "X X", "XX ", " X ", Character.valueOf('X'), Block.dirt }); } }
The firstID thing means the Block ID.
I changed the way the block is registered. You should use this way next time. To add a block use these statements:
public static Block YOURBLOCKNAMEHERE; public static int yourblocknamehereID = PUTDESIREDBLOCKIDHERE; static { YourBlockNameHere = new BlockNamehere(yourblocknamehereID, ModLoader.addOverride("/terrain.png", "/nameoftexturehere.png")).setHardness(1.0F).setBlockName("Your Block Name Here").setResistance(6000.0F).setLightValue(0.3F); }
BlockFirst
package net.minecraft.src; import java.util.Random; public class BlockFirst extends Block{ public BlockFirst(int i, int j){ super(i, j, Material.ground); } public int idDropped(int i, Random random) { return mod_FirstBlock.First.blockID; } }
Pictures:
Texture

Pic of block in-game:

+1 me if i helped :tongue.gif:.
1
1
Thanks. I have learned something new today :biggrin.gif: