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

Is there a method to get the Texture from a Item and get the Color code from a Pixel in that Texture ?

Because I'd like for example to paint a Texture for a Item, that is made out of Gold, in the same Color as the Gold Ingot.

 

I've already tried to do it with the RenderManager, but this doesn't help me ...

i have that question to but i have something more complex in mind , in the java side and in the inner side of the png files but

the your sounds more simple

 

if you uncompress the minecraft jar , the jar from the game not the one in eclipse you can get all the textures

just fint gold ingot open it whith gimp

 

.minecraft/versions/1.8/1.8/assets/minecraft/textures/items/gold_ingot.png

 

gold ingot has 8 diferent  colors the brigthes yellow is ffff8b

Hi

 

Vanilla has a good example of this in ItemModelGenerator - it uses the texture of a given item to build the 3D IBlockModel of the item

- starts from makeItemModel, the accessing of the texels is in func_178393_a using getFrameTextureData().  You just need to provide the TextureAtlasSprite from the texture map (see makeItemModel)

 

-TGG

 

 

 

 

 

  • Author

OK, I've tried to use

TextureAtlasSprite sprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(material)).getTexture();
int[][] textureRBG = sprite.getFrameTextureData(sprite.getFrameCount);

But I always get a Array out of Bound Exception at Index 0, Size: 0 when calling getFrameTextureData().

The Texture is correct because sprite.getIconName() returns the correct Texture ...

 

Guest
This topic is now closed to further replies.

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.