Jump to content

1.8.9 dynamic item rendering


UberAffe

Recommended Posts

Items in my mod will designed by the player similar to tinkers but much more fine grained, to the point that a sword could be shaped like a bucket if that is how it was designed. I've got a pretty good idea of how to handle the properties of the item but frankly I suck at graphics.

 

Is it feasible to render an item based on it's NBT and if so how would I attach the renderer to the item.

 

This is what I had in mind for rendering an item:

public class ItemRenderer {

private static final int PARTDIM = 8;

public void RenderItem(IDraftable draft){
	IPartType[][][] parts = draft.GetPartArray();
                int depth = draft.GetPartsDeep() * PARTDIM;
	int width = draft.GetPartsWide() * PARTDIM;
	int height = draft.GetPartsHigh() * PARTDIM;
	for(int i = 0; i < width; i++)//y position
		for(int j = 0; j < height; j++)//x position
			for(int k = 0; k < depth; k++)//z position
				parts[i][j][[k].GetRenderer().RenderPart(i,j,k);// render piece in location, pieces are partially transparent
}
}

 

my items implement IDraftable and each IPartType implementation has an associated IPartRenderer implementation.

 

Edit: I'm sure that the location won't be as simple as integers but is the underlying idea feasible?

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

Link to comment
Share on other sites

You'll want to look at

ISmartItemModel

to create a model based on the NBT. I can't help you with it myself, but it's been discussed in various threads on this forum.

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.

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.