Jump to content

Recommended Posts

Posted

My mod added a suit of armor in a new material. Amazingly, that much works. However, when I take off my armor in creative mode (e.g. to enchant or repair pieces of it), the empty armor slots in my creative inventory are black squares instead of armor-piece outlines. Surprisingly, survival mode is unaffected.

 

It appears to be a small thing, but I've learned from unpleasant experience that even small visible defects can can spring from bugs that are doing worse behind the scenes. Therefore, I am trying to figure it out anyway.

 

I've walked through as much of the vanilla armor class as I can, and I didn't see how it could have been affected by what I modded in my armor class. I didn't even touch the method that registers those icons.

 

Then I tried commenting out my added creative tab. Voila! The empty slot icons returned to normal in creative mode.

 

Has anyone else noticed the slots turning black after adding a creative tab? Is it a forge bug, or a tutorial oversight, or must I have done something wrong?

 

My creative tab code:

 

tabTest = new CreativeTabs("Testing") {
	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem() {
		return Items.brewing_stand;
	}
};

 

 

EDIT:

Looking at how vanilla tabs are instantiated, I noticed that they did not have the @Override annotation on getTabIconItem(). I removed it from mine, and the empty slots returned to normal. I don't know why, but the fix worked.

 

Somewhere out there is a tutorial that is teaching new modders like me to put that @Override in there. If anyone spots it, please ask the tutor to make a correction.

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.