Jump to content

Recommended Posts

Posted

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");
    }

 

 

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.