Bedrock_Miner Posted March 17, 2015 Share Posted March 17, 2015 Heyho guys! I have some problems updating my Mod to 1.8. I need a function to render an image with a special thickness, just like Items are rendered. The shape should adjust to the texture of the item. In 1.7 this was easy using the method ItemRenderer.renderItemIn2D(tessellator, u, v, U, V, thickness); In 1.8 I cannot find anything similar to this. Does anyone know how to get this to work in 1.8? Additionally: is there a way to render this with the vanilla enchantment effect on the texture? Any help is very much appreciated... Quote http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS Link to comment Share on other sites More sharing options...
TheGreyGhost Posted March 17, 2015 Share Posted March 17, 2015 Hi The "builtin/generated" items are generated using this code ItemModelGenerator.makeItemModel() and especially func_178394_a() the thickness comes from here which creates the two large flat faces: arraylist.add(new BlockPart(new Vector3f(0.0F, 0.0F, 7.5F), new Vector3f(16.0F, 16.0F, 8.5F), hashmap, (BlockPartRotation)null, true)); (8.5F - 7.5F = 1 texel wide) and then func_178397_a() for all the thin "sideways" faces that make up the edges I think you would need to use this code to generate your own block model for your item, probably using ISmartItemModel and perhaps ICustomModelLoader http://www.minecraftforge.net/forum/index.php/topic,28714.msg147632.html#msg147632 I think it will be fairly tricky... -TGG Quote Link to comment Share on other sites More sharing options...
Bedrock_Miner Posted March 18, 2015 Author Share Posted March 18, 2015 Thanks a lot! I'll try to find out what I can achieve with this information. Quote http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS Link to comment Share on other sites More sharing options...
Bedrock_Miner Posted March 18, 2015 Author Share Posted March 18, 2015 OK, I now used the makeItemModel method directly to get a model from a resource location. One problem: This method returns a BlockModel. How can I render this model? Quote http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS Link to comment Share on other sites More sharing options...
SuperKael Posted March 18, 2015 Share Posted March 18, 2015 I don't know myself, but If you just dig around in the code a bit you should be able to find how vanilla does it. Quote If I ever say something stupid, or simply incorrect, please excuse me. I don't know anything about 1.8 modding, and I don't know much about entities either, But I try to help when I can. Link to comment Share on other sites More sharing options...
Bedrock_Miner Posted March 18, 2015 Author Share Posted March 18, 2015 Oh, I have a better Idea: I do the rendering stuff myself. But I need to know, how can I get the size of a texture provided as a ResourceLocation in pixels? Any ideas? Quote http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS Link to comment Share on other sites More sharing options...
SuperKael Posted March 18, 2015 Share Posted March 18, 2015 There are various different ways of accomplishing that, but if you can convert the ResourceLocation to an IIcon, you can use IIcon.getItemHeight() and IIcon.getItemWidth() EDIT: If you can retrieve an instance of the IIconRegister, you can use: IIcon icon = (IIcon)IIconRegister.getAtlasSprite(ResourceLocation.toString()); Quote If I ever say something stupid, or simply incorrect, please excuse me. I don't know anything about 1.8 modding, and I don't know much about entities either, But I try to help when I can. Link to comment Share on other sites More sharing options...
Bedrock_Miner Posted March 18, 2015 Author Share Posted March 18, 2015 I am in 1.8, there are no IIcons any more. Quote http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS Link to comment Share on other sites More sharing options...
SuperKael Posted March 18, 2015 Share Posted March 18, 2015 Oh O_O Kden, this is beyond my expertise then. have fun! Quote If I ever say something stupid, or simply incorrect, please excuse me. I don't know anything about 1.8 modding, and I don't know much about entities either, But I try to help when I can. Link to comment Share on other sites More sharing options...
tuskiomi Posted March 18, 2015 Share Posted March 18, 2015 this is beyond my expertise 1/2 your posts are this If you want to look for a file image height, see here: http://stackoverflow.com/questions/672916/how-to-get-image-height-and-width-using-java if you have a resource location, you can use that to find the file, non? Quote Also, I should have you know that you are reading my signature. Link to comment Share on other sites More sharing options...
Bedrock_Miner Posted March 18, 2015 Author Share Posted March 18, 2015 OK, thanks a lot! Quote http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS Link to comment Share on other sites More sharing options...
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.