Jump to content

Recommended Posts

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

Posted

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

Posted

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

 

 

 

 

 

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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