Jump to content

Getting variables during custom item render


Briggybros

Recommended Posts

Hello, I'm trying to render a custom item. I've completed the 3rd person rendering without a problem. However, I cannot get the renderer to work for third person as there are some variables I am missing. To test the item renderer I've simply copied the code from ItemRenderer, I will change this later to suit the mod. The code uses variables either private in the ItemRenderer class or passed into the method. The variables are equippedProgress, prevEquippedProgress and the partial tick. How can I access these variables from my custom ItemRenderer?

 

EDIT: No matter what I seem to do in my first person section, nothing seems to change..

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	EntityLivingBase par1EntityLivingBase = (EntityLivingBase) data[1];
	switch (type) {
	case EQUIPPED: {
                    // This works
	}
	case EQUIPPED_FIRST_PERSON: {
                    // How can I get this to work? links?
	}
	default:
		break;
	}
}

Link to comment
Share on other sites

Hi

 

I'm not sure why you need equippedProgress and prevEquippedProgress?  - these are used by the rendering code to position the player's arm (and item) before control passes to your custom renderer, so you don't really need to worry about it?

 

Perhaps if you could describe in a bit more detail what you're trying to do?

 

There are a few links below which might (or might not..) be helpful

http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-first-person-view-items.html

http://greyminecraftcoder.blogspot.com.au/2013/09/custom-item-rendering-using.html

http://greyminecraftcoder.blogspot.com.au/2013/09/sample-code-for-rendering-items.html

 

Cheers

  TGG

Link to comment
Share on other sites

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.