Posted March 10, 20169 yr 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
March 10, 20169 yr 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.
March 10, 20169 yr Author Thanks, I'll take a look and see what I can find. Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures
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.