Posted March 17, 201510 yr 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... http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 17, 201510 yr 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
March 18, 201510 yr Author Thanks a lot! I'll try to find out what I can achieve with this information. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 18, 201510 yr Author 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? http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 18, 201510 yr 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. 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.
March 18, 201510 yr Author 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? http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 18, 201510 yr 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()); 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.
March 18, 201510 yr Author I am in 1.8, there are no IIcons any more. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 18, 201510 yr Oh O_O Kden, this is beyond my expertise then. have fun! 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.
March 18, 201510 yr 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? Also, I should have you know that you are reading my signature.
March 18, 201510 yr Author OK, thanks a lot! http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
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.