Jump to content

Recommended Posts

Posted

For an item I am creating, I need to get a tint colour for one of the render passes from a value saved in its NBT data tag. Currently, I am using a string such as "0xFF00CC" to get a nice pink colour, or various other hex colour multipliers. My only problem is that the vanilla ItemRenderer requires an integer for its colour multiplier, rarther than a string.

 

I've tried searching around to see if there is any conversion code, but I can't seem to be able to find any. Aside from trial and error on colours, if there any way to work around this? Or does anyone know of any code to convert the string value to an integer multiplier, or of any programs or web apps which may do this conversion? My googling doesn't seem to come up with anything :/

 

Luis

Posted

0xFF00CC can be stored as an integer flat.  You don't need to save hex values as strings.

 

However:

 

Long.parseLong("AA0F245C", 16);

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.

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.