Kelco_k22 Posted March 24, 2016 Posted March 24, 2016 the past two or three days I have been trying to update my mod from 1.7.10 to 1.8.9. i have got most of it working the mane thing that I can not is using renderPass and getColorFromItemStack to make an Item icon. the same way mob egg are in 1.7.10. i have looked for the mob egg code in 1.8.9 but have not fond it yet. if any one can link me to something, tell me how to do it or start that will be great public static final int[] Corecol1= new int[] {0xff0000,0x7dff09,0xff9204,0xd2d2d2,0x1560c5,0xd919ea,0xe0ba5d,0xff0000}; public static final int[] Corecol2= new int[] {0xfcff00,0x6cc43e,0x818181,0xff0000,0x2c41ff,0xd45ef3,0xd9bb64,0xff0000,0xffffff,0xfcff00,0xe8cc00}; public static final int[] Corecol3= new int[] {0x0a6e03,0xfff725,0x2e2e2e,0xff0000,0x57b7ff,0x8819ea,0xe0ba5d,0xb79449,0x0a6e03,0xe8cc00}; public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { return getIcon(stack, renderPass); } @Override @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @Override public int getRenderPasses(int metadata) { return 4; } @Override public IIcon getIcon(ItemStack stack, int renderPass){ if (stack.getItem()==KamenRiderCraft2_core.birth_driver||stack.getItem()==KamenRiderCraft2_core.birth_driver_prototype){ return itemIcon; } if(renderPass == 0){ return itemIcon; }else if(renderPass == 1){ return itemIcon1; }else if(renderPass == 2){ return itemIcon3; }else{ return itemIcon2; } } @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack par1ItemStack, int renderPass) { if (par1ItemStack.getItem()==KamenRiderCraft2_core.birth_driver||par1ItemStack.getItem()==KamenRiderCraft2_core.birth_driver_prototype){ return 0xffffff; } if(renderPass == 0){ return 0xffffff; }else if(renderPass == 1){ return Corecol1[get_core(par1ItemStack, "1")]; }else if(renderPass == 2){ return Corecol3[get_core(par1ItemStack, "3")]; }else{ return Corecol2[get_core(par1ItemStack, "2")]; } } Quote
Choonster Posted March 24, 2016 Posted March 24, 2016 Override Item#getColorFromItemStack . If your model inherits from builtin/generated , the renderPass argument of this method is the texture index (i.e. the layer0 texture is renderPass 0). If your model inherits from a different model or manually specifies its elements, the renderPass argument is the tintindex property of an element's face (look at assets/minecraft/models/block/grass.json to see how it specifies the tintindex property for the face that uses a greyscale texture). Quote 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.
Kelco_k22 Posted March 24, 2016 Author Posted March 24, 2016 OK I've got the getColorFromItemStack working. I'm just failing at adding layers. is there ant more help you can give with that Quote
Choonster Posted March 24, 2016 Posted March 24, 2016 On 3/24/2016 at 4:20 PM, Kelco_k22 said: OK I've got the getColorFromItemStack working. I'm just failing at adding layers. is there ant more help you can give with that Create a model that inherits from builtin/generated and set the layerN textures (where N is an integer >= 0). Look at assets/minecraft/models/item/spawn_egg.json to see how vanilla uses two layers for the spawn egg model. Quote 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.
Kelco_k22 Posted March 24, 2016 Author Posted March 24, 2016 thanks I was doing it right, I just did not add a Comma after each layer works fine now only one more thing is there a way to change a layer without making a new .json one of my other mods uses the same way to add more than 1,822,030,560 sword and I don't want to make a .json file for each one Quote
Choonster Posted March 24, 2016 Posted March 24, 2016 On 3/24/2016 at 4:45 PM, Kelco_k22 said: only one more thing is there a way to change a layer without making a new .json one of my other mods uses the same way to add more than 1,822,030,560 sword and I don't want to make a .json file for each one Use ISmartItemModel to generate models on demand. I can't help you with it much myself, but it's been discussed before on this site and others. You can also look at Forge's implementation of it in ModelDynBucket . Quote 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.
Kelco_k22 Posted March 24, 2016 Author Posted March 24, 2016 OK thanks at lest that's a place to start. thanks for all your help, I was just about to throw in the towel before Quote
Recommended Posts
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.