Jump to content

Coding Error Eclipse


Vita1530

Recommended Posts

For the moderators, I looked up about the error I will be mentioning in the upper-right hand search bar and got no results. 

 

For everyone else, the error is IconRegister cannot be resolved to a type

 

The code is:

 

import net.minecraft.item.Item;

import net.minecraft.creativetab.CreativeTabs;

 

public class Lactobacillus extends Item {

 

public Lactobacillus(int id, String texture) {

super(id);

setCreativeTab(CreativeTabs.tabMisc);

}

 

@Override

public void func_94581_a(IconRegister iconRegister)

{

iconIndex = iconRegister.func_94245_a("microcellExquisites:Lactobacillus");

}

}

 

 

I am using the latest RECOMMENDED forge build and Eclipse.  The IconRegister colored in red is the IconRegister underlined by Eclipse.

Please reply if you know a solution!

I wonder why many mods do not have this problem...

Have a nice rest of the day!

Link to comment
Share on other sites

The problem is probably eclipse doesn't know about IconRegister.

Try hovering your mouse over it to see quick fixes and select import blablabla.

 

Else, find out which package that contains IconRegister and import it.

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

In addition to Mazetar's suggestion, I highly suggest that you download the javadocs. They will tell you what a huge chunk of the Forge methods do.

 

Also, be aware that func_94581_a was renamed to updateIcon in the newer builds. You will need to change the method name once you update.

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.