Cleanup/fix item render hooks

This commit is contained in:
newthead 2012-03-16 23:57:59 -07:00
parent d7cbbfb3d2
commit 8e92edb4b7
4 changed files with 11 additions and 7 deletions

View file

@ -267,7 +267,7 @@ public class ForgeHooksClient
{
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslatef(0.0F, 0.3F, 0.0F);
GL11.glTranslatef(0.0F, -0.3F, 0.0F);
GL11.glScalef(1.5F, 1.5F, 1.5F);
GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);

View file

@ -1,5 +1,6 @@
package net.minecraft.src.forge;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.RenderBlocks;
public interface IEquippedItemRenderer

View file

@ -19,7 +19,8 @@
- if (par2ItemStack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
+ if (customRenderer != null)
+ {
{
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ if (par2ItemStack.itemID < 256)
+ {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", par2ItemStack.getItem())));
@ -31,8 +32,7 @@
+ ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack.itemID, par2ItemStack.getItemDamage());
+ }
+ else if (par2ItemStack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
{
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
+ {
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", par2ItemStack.getItem())));
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
}

View file

@ -94,7 +94,7 @@
}
if (this.field_27004_a)
@@ -187,9 +239,62 @@
@@ -187,9 +239,65 @@
float var12;
float var13;
@ -138,6 +138,8 @@
+ else
+ {
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)(par6), (float)(par7), -3.0F + this.zLevel);
+
+ int var8 = Item.itemsList[par3].getColorFromDamage(par4, 0);
+ float var14 = (float)(var8 >> 16 & 255) / 255.0F;
@ -150,6 +152,7 @@
+ }
+
+ ForgeHooksClient.renderInventoryItem(customRenderer, renderBlocks, par3, par4);
+ GL11.glPopMatrix();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ }
+ }
@ -159,7 +162,7 @@
Block var15 = Block.blocksList[par3];
GL11.glPushMatrix();
GL11.glTranslatef((float)(par6 - 2), (float)(par7 + 3), -3.0F + this.zLevel);
@@ -221,7 +326,7 @@
@@ -221,7 +329,7 @@
if (Item.itemsList[par3].func_46058_c())
{
GL11.glDisable(GL11.GL_LIGHTING);
@ -168,7 +171,7 @@
for (var8 = 0; var8 <= 1; ++var8)
{
@@ -247,11 +352,11 @@
@@ -247,11 +355,11 @@
if (par3 < 256)
{