Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

How To Change The Enchantment Glint Color [1.6.2]


  • Please log in to reply
7 replies to this topic

#1

Zendreax

Posted 10 April 2013 - 04:39 AM

Re edited this old help topic to a helpful post.
Sorry if it's a bit messy and looks like it takes forever but it shouldn't take no more than 5 minutes.
This is really easy, all you're doing is changing IDs, it's fun to experiment with the different colors. If you want to do an individual item this might be a good reference but i never figured out how to do that yet.

If you need help or have any questions, feel free to send me a message, i will always be happy to respond.

If you have forge+MCP then you can find all the files in Forge Source\forge\mcp\src\minecraft\net\minecraft\client\renderer\entity

Posted Image

Go into "RenderItem.java" and look for this (just press ctrl+F and type in "glint", you might have to search around a tiny bit.):
It should be around line 420 if you haven't edited this file much.


public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
{
if (par3ItemStack != null)
{
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);

if (par3ItemStack.hasEffect())
{
GL11.glDepthFunc(GL11.GL_GREATER);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
par2TextureManager.func_110577_a(field_110798_h);
this.zLevel -= 50.0F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
GL11.glColor4f(1.9F, 3.1F, 2.1F, 3.0F);
this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
this.zLevel += 50.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}
}

Look at the one line here...

GL11.glColor4f(1.9F, 3.1F, 2.1F, 3.0F);

Yours will not be the same color IDs as mine since i already edited it and cant remember the default ones. But this color is white with a slight hint of yellow.
Edit the color IDs like so, you will have to guess the IDs for the color you want but i've narrowed it down to this so far.

GL11.glColor4f(red, green, blue, alpha);

Alpha is how transparent you want the glint to be

Now for the 3D rendered model...

Go into "ItemRenderer.java", press "Ctrl + F" and search for "110930"
You should find it in something like this...


if (par2ItemStack.hasEffect() && par3 == 0)
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
var4.func_110577_a(field_110930_B);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float var14 = 0.76F;
GL11.glColor4f(1.9F * var14, 3.1F * var14, 2.1F * var14, 3.0F);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
float var15 = 0.125F;
GL11.glScalef(var15, var15, var15);
float var16 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
GL11.glTranslatef(var16, 0.0F, 0.0F);
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glScalef(var15, var15, var15);
var16 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
GL11.glTranslatef(-var16, 0.0F, 0.0F);
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}

GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}

GL11.glPopMatrix();
}


Look at the line within this code to find
Do not change the variation IDs unless you really know what you're doing.

GL11.glColor4f(1.9F * var14, 3.1F * var14, 2.1F * var14, 3.0F);

Now you have to change the color ID of it when it's on the ground

Press "Ctrl + F" and look for "GL11.glPushMatrix();"
2 lines above that should be the color IDs for the enchanted glint color
It should look something like this.
if (var18.hasEffect())
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
this.renderManager.renderEngine.func_110577_a(field_110798_h);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float var21 = 0.76F;
GL11.glColor4f(1.9F * var21, 3.1F * var21, 2.1F * var21, 3.0F);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
float var22 = 0.125F;
GL11.glScalef(var22, var22, var22);
float var23 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
GL11.glTranslatef(var23, 0.0F, 0.0F);
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
ItemRenderer.renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, var16);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glScalef(var22, var22, var22);
var23 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
GL11.glTranslatef(-var23, 0.0F, 0.0F);
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
ItemRenderer.renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, var16);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}


Look for this line
GL11.glColor4f(1.9F * var21, 3.1F * var21, 2.1F * var21, 3.0F);

And change it to your liking like you did with the other ones.

And there you go Posted Image

Register or log in to remove.

#2

Tiupt3
    Tiupt3

    Tree Puncher

  • Members
  • 12 posts

Posted 15 April 2013 - 07:54 PM

I've been searching for this to the farest I got is that it has something to do with glint.png in the misc folder.
I believe that the real color you see in game is hard coded

#3

RaynbowDeath

Posted 16 April 2013 - 11:18 AM

Copying thy known effect unto your item may be impossible as it is hard-coded in-game and in .Class files
Although, You could make a filter in MCEdit using Python that would make it work like that; possibly, Sethbling may be the only that can do that (as well as Hypixel but he may not give you the filter). In texture packs, it can be the greatest Impossibru that may be done in Minecraft.
Other theories that I could include are but not limited to:
1. If texture packs are given the chance by Mojang to not just replace the appearance of the game but to also replace it's programming files such as it's .Class files in the minecraft.jar , you could(if you're have the programming skills to manipulate .class files) make alternate .Class files to make what you want to happen.
2. The MCPatcher or Optifine method might do something new in retexturing(don't ask me about it[not an expert]) those items that they would glow as you want them to do.

Other things like that yeah, the guy above me is right: The thing you want is hard-coded in the game programming, but any of my theories may re-code it in a snap.

Hope that helps you. ^_^

Quote

I was once an ordinary Steve thinking about rainbows when I was struck by lightning to death, but still, my big thought  about rainbows, brought me back to life. Now, living as Death, using the power of rainbows in accordance with life and death

#4

blue_dragon360
  • Location: Valhalla
  • Minecraft: blue_dragon360

Posted 16 April 2013 - 06:07 PM

The image that effects this is the glint.png in the misc folder, but that only effects the shape of the glow, not the color. See steelfeathers' texture pack guide for more information. http://www.minecraft...e-to-texturing/

Posted Image

If you would like to follow the progress of my WIP texture pack, click above.

I really need feedback!


#5

HandlerChief
  • Location: Wishing I could be in England
  • Minecraft: bmanbman28

Posted 17 April 2013 - 04:28 AM

View Postblue_dragon360, on 16 April 2013 - 06:07 PM, said:

The image that effects this is the glint.png in the misc folder, but that only effects the shape of the glow, not the color. See steelfeathers' texture pack guide for more information. http://www.minecraft...e-to-texturing/

Yeah,

Example of mine:
http://imgur.com/uE1Uc7a

#6

GreenSidis

Posted 18 April 2013 - 04:42 PM

Couldn't you just make an animation? I don't really get why you can't do that...

#7

Zendreax

Posted 13 August 2013 - 08:45 AM

EDIT: Nevermind

#8

Zendreax

Posted 13 August 2013 - 10:45 AM

Bump
Re edited. I finally figured it out.