Merge pull request #700 from iChun/miscchanges

Fix RenderLivingEvent.Pre/Post not being fired by most Renders.
This commit is contained in:
cpw 2013-07-31 01:35:18 -07:00
commit 9776e0937a

View file

@ -20,7 +20,23 @@
public RendererLivingEntity(ModelBase par1ModelBase, float par2)
{
@@ -442,12 +448,13 @@
@@ -68,6 +74,7 @@
public void func_130000_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
{
+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(par1EntityLivingBase, this))) return;
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
this.mainModel.onGround = this.renderSwingProgress(par1EntityLivingBase, par9);
@@ -277,6 +284,7 @@
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
this.passSpecialRender(par1EntityLivingBase, par2, par4, par6);
+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(par1EntityLivingBase, this));
}
/**
@@ -442,12 +450,13 @@
*/
protected void passSpecialRender(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6)
{
@ -35,7 +51,7 @@
if (d3 < (double)(f2 * f2))
{
@@ -491,6 +498,7 @@
@@ -491,6 +500,7 @@
}
}
}
@ -43,12 +59,3 @@
}
protected boolean func_110813_b(EntityLivingBase par1EntityLivingBase)
@@ -570,6 +578,8 @@
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre((EntityLivingBase)par1Entity, this))) return;
this.func_130000_a((EntityLivingBase)par1Entity, par2, par4, par6, par8, par9);
+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post((EntityLivingBase)par1Entity, this));
}
}