Posted August 26, 201411 yr I am trying to make colored planks for my mod. I have the planks colored right when placed on the ground but when they are in the inventory they are all white. Here is the ColoredPlanksItemBlock class: public class ColoredPlanksItemBlock extends ItemBlock { private Block block; public ColoredPlanksItemBlock(Block block) { super(block); this.block = block; this.setUnlocalizedName(Names.Blocks.COLORED_PLANKS); this.setHasSubtypes(true); } @Override public int getMetadata(int meta) { return meta; } @Override public String getUnlocalizedName(ItemStack itemStack) { return String.format("item.%s%s.%s", Textures.PREFIX, Names.Blocks.COLORED_PLANKS, Names.Colors.COLOR[itemStack.getItemDamage()]); } @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack itemStack, int pass) { return Integer.parseInt(Colors.fromNumber[itemStack.getItemDamage()], 16); } } I know that the getColorFromItemStack method is being called (I added a check for it) however the item is not getting colored. I am very confused as to why this is not working as vanilla does it the same way with leaves. Any help is greatly appreciated. Thanks!
September 4, 201411 yr Author After over a week of testing and trying things, i still have not fixed this problem. Please help
September 10, 201411 yr Author I found the solution!!! i was missing this: @SideOnly(Side.CLIENT) public int getRenderColor(int meta) { return Integer.parseInt(Colors.fromNumber[meta], 16); } from my block class.
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.