dstars5 Posted May 11, 2013 Posted May 11, 2013 Hey guys, I need to make an item which combines 4 textures into 1. As I need a lot of these, I need to do it in the actual code, rather than making a .png for each one. I need it to be like the spawn eggs, where it takes the background and combines it with the overlay. Below is what I have been able to come up with, but it doesn't work. How do I do this? The code. I basically tried to copy it from the spawn egg class, and change it for my needs. @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @SideOnly(Side.CLIENT) /** * Gets an icon index based on an item's damage value and the given render pass */ public Icon getIconFromDamageForRenderPass(int par1, int par2) { System.out.println(par1 + " " + par2); Icon returnIcon = null; if (par2 == 0) { returnIcon = top; super.getIconFromDamageForRenderPass(par1, par2); } else if (par2 == 1) { returnIcon = mid; super.getIconFromDamageForRenderPass(par1, par2); } else if (par2 == 2) { returnIcon = bot; } return returnIcon; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { super.registerIcons(par1IconRegister); this.top = par1IconRegister.registerIcon("StaffCraft:top"); this.mid = par1IconRegister.registerIcon("StaffCraft:mid"); this.bot = par1IconRegister.registerIcon("StaffCraft:bot"); } 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.