Posted December 21, 201311 yr 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
December 21, 201311 yr 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.