Jump to content

My First Block Made on forge Isn't working, Please Help!


Wik3d Warrior

Recommended Posts

Ok so in Eclipse, ive made my first block and throughout the enitre mod there are no errors,however, when i go to run it this keeps popping up:

 

java.lang.IllegalArgumentException: Illegal object for naming null

at cpw.mods.fml.client.FMLClientHandler.getObjectName(FMLClientHandler.java:817)

at cpw.mods.fml.common.FMLCommonHandler.addNameForObject(FMLCommonHandler.java:469)

at net.minecraft.src.ModLoader.addName(ModLoader.java:142)

at net.minecraft.src.ModLoader.addName(ModLoader.java:130)

at net.minecraft.src.tutorial.mod_mymod.addNames(mod_mymod.java:33)

at net.minecraft.src.tutorial.mod_mymod.load(mod_mymod.java:21)

at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:356)

at cpw.mods.fml.common.Loader.modInit(Loader.java:273)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:628)

at cpw.mods.fml.client.FMLClientHandler.onLoadComplete(FMLClientHandler.java:223)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:429)

at net.minecraft.client.Minecraft.run(Minecraft.java:738)

at java.lang.Thread.run(Thread.java:680)

 

Also heres both my codes if it helps:

 

mod_mymod:

 

package net.minecraft.src.tutorial;

 

import net.minecraft.src.BaseMod;

import net.minecraft.src.Block;

import net.minecraft.src.ModLoader;

 

 

 

 

public class mod_mymod extends BaseMod {

 

public static Block blockRavireBlock;

@Override

public String getVersion() {

return null;

}

 

@Override

public void load() {

this.registerBlocks();

this.addNames();

}

 

 

private void registerBlocks() {

 

ModLoader.registerBlock(blockRavireBlock);

}

 

 

private void addNames(){

 

ModLoader.addName(blockRavireBlock, "Ravire Block");

} }

 

The actual Block class:

 

package net.minecraft.src.tutorial;

 

import net.minecraft.src.Block;

import net.minecraft.src.Material;

import net.minecraft.src.StepSound;

import net.minecraft.src.forge.ITextureProvider;

 

public class blockRavireBlock extends Block implements ITextureProvider {

 

protected blockRavireBlock(int blockID, int textureID) {

 

super(blockID, textureID, Material.wood);

setHardness(3.1F);

setResistance(0.3F);

setLightValue(10);

setStepSound(soundWoodFootstep);

 

}

@Override

public String getTextureFile(){

return "Ravire.png";

}

}

 

Yup thats all of it.

 

 

Link to comment
Share on other sites

have you edited the EnumToolMaterial base class to add in your RAVIRE EnumToolMaterial? because i dont see a variable anywhere in your code for it.

This.

And do not use ModLoader.addOverride, that is old, deprecated, and rather useless now, use a new texture sheet instead with setTexture on the blocks/items.

And it is better to use addTranslation instead of addName.

Link to comment
Share on other sites

You aren't creating a block! It's nowhere. Obviously it's gonna be null!

Change public static Block blockRavierBlock; to public static Block blockRavierBlock = new BlockRavierBlock(...);

Done.

Or change the op to reflect your actual mod.

There shouldn't be a problem with the code on pastebin.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Link to comment
Share on other sites

You aren't creating a block! It's nowhere. Obviously it's gonna be null!

Change public static Block blockRavierBlock; to public static Block blockRavierBlock = new BlockRavierBlock(...);

Done.

Or change the op to reflect your actual mod.

There shouldn't be a problem with the code on pastebin.

he posted the actual code, but he didnt update his original post.

 

and im pretty sure this was fixed since he hasnt replied back yet.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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