Jump to content

[1.9] Adding numbers/bars/icons to item inventory icon.


Notunknown

Recommended Posts

I want to add additional information to the icon of an item - such as an electric bow which has a durability bar, energy bar (in blue) and a number showing the number of arrows left in the players inventory (which is colored if the next arrow used is a potion effect, or glows if the next arrow used is a glowing arrow).

 

That is an extreme example, but demonstrates what I am after. How can I do this?

Link to comment
Share on other sites

Item#showDurabilityBar

Item#getDurabilityForDisplay

Item#isDamageable

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Item#showDurabilityBar

Item#getDurabilityForDisplay

Item#isDamageable

 

I know about those - but that is for the green durability bar. This is about adding a second durability bar above this. And some numbers above that, which are colored depending on non-tool specific information.

Link to comment
Share on other sites

EnderIO does simlar things (p455w0rd already said), but it uses ASM.

So, there's no way (besides ASMing

RenderItem.renderItemOverlayIntoGUI

) to do this.

 

@Forge: why forge hasn't added any hooks for this?

 

Well, EnderIO is for 1.7.10. That is two major versions (and an overhaul of rendering) ago.

Link to comment
Share on other sites

Well, EnderIO is for 1.7.10. That is two major versions (and an overhaul of rendering) ago.

 

EnderIO has an experimental 1.8.9 version, the source of which is available on GitHub.

 

I think the proper way to do this is with a custom

IModel

and

ItemOverrideList

, like Forge's

ModelDynBucket

.

 

For a limited number of variants (e.g. a single bar with 10 steps), you can do what RFTools does: manually create the textures and then use them with standard models.

 

Edit: Added a missing word.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Well, EnderIO is for 1.7.10. That is two major versions (and an overhaul of rendering) ago.

 

EnderIO has an experimental 1.8.9 version, the source of which is available on GitHub.

 

I think the proper way to do this is with a custom

IModel

and

ItemOverrideList

, like Forge's

ModelDynBucket

.

 

For a limited number of variants (e.g. a single bar with 10 steps), you can do what RFTools does: manually create the textures and then use them standard models.

 

The bar is the easy part (relatively), what about numbers (like an arrow counter on a bow)?

Link to comment
Share on other sites

The bar is the easy part (relatively), what about numbers (like an arrow counter on a bow)?

 

You'll need an

IModel

and

ItemOverrideList

as I said in my previous post. Probably an

ICustomModelLoader

as well.

 

You'll also need a texture for each digit so you can generate the

BakedQuad

s for the number.

 

I don't know that much about the rendering system, so I can't help you much more than this.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

The bar is the easy part (relatively), what about numbers (like an arrow counter on a bow)?

 

You'll need an

IModel

and

ItemOverrideList

as I said in my previous post. Probably an

ICustomModelLoader

as well.

 

You'll also need a texture for each digit so you can generate the

BakedQuad

s for the number.

 

I don't know that much about the rendering system, so I can't help you much more than this.

 

Hmm. I was hoping that there would be a way around doing this, at least when it comes to adding extra bars/numbers.

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.