Jump to content

[1.8] How to render a solidified texture?


Bedrock_Miner

Recommended Posts

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...

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.