Jump to content

No name for item -_-


AssassinHero

Recommended Posts

Hey guys, I have added an item into my mod and it doesn't have a name in game. The texture is the and everything but the name isn't

Here's all my code :)

Main

public class ParallelWorlds {

@cpw.mods.fml.common.Mod.Instance("ParallelWorlds")
public static ParallelWorlds Instance = new ParallelWorlds();

	@SidedProxy(clientSide = "assassinhero.parallelworlds.client.ParallelWorldsClientProxy", serverSide = "assassinhero.parallelworlds.common.ParallelWorldsCommonProxy")
	public static ParallelWorldsCommonProxy proxy;

	public static Block NightStone;
	public static Item NightGem;
	@cpw.mods.fml.common.Mod.PreInit
	public void PreInit(FMLPreInitializationEvent event){
		NightStone = new BlockNightStoneBlock(3658).setUnlocalizedName("Night Stone");
		NightGem = new ItemNightGemItem(5000).setUnlocalizedName("Night Gem");



	}

	@Init
	public void InitParallelWorlds(FMLInitializationEvent event){
		NetworkRegistry.instance().registerGuiHandler(this, proxy);

		proxy.registerBlocks();

	}

}

 

The items class

public class ItemNightGemItem extends Item{
public ItemNightGemItem(int par1){
	super(par1);
	setCreativeTab(CreativeTabs.tabMaterials);


}

@Override
public void func_94581_a(IconRegister iconregister){
	iconIndex = iconregister.func_94245_a("ParallelWorlds:ItemNightGemItem");
}

}

 

common proxy

public class ParallelWorldsCommonProxy implements IGuiHandler{

public void registerRenderInformation(){

}

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
	return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
	return null;
}

public void registerTiles(){

}

public void registerBlocks(){

GameRegistry.registerBlock(ParallelWorlds.NightStone, "Night Stone");
LanguageRegistry.addName(ParallelWorlds.NightStone, "Night Stone");
GameRegistry.addRecipe(new ItemStack(ParallelWorlds.NightStone, 1), "XBX", "XMX", Character.valueOf('X'), Block.dirt);

}

public void registerItems(){
	LanguageRegistry.addName(ParallelWorlds.NightGem, "Night Gem");

}

}

 

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

on your main class on the item add .setunlocalizedname("NAME")

or in the item class add this.setunlocalizedname("NAME")

 

something i forgot you need to add LanguageRegistery(NAME, "NAME"); int to the main mod class

 

I had set unlocalizedname

 

I forgot to register the item using

proxy.registerItems();

 

Your comment reminded me though so thank you :D

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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