Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

 

 

 

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.

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.

Oh O_O Kden, this is beyond my expertise then. have fun! :P

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.