From 7b9971b20f6e085a95e633ece4a5c3b1b3b26f7f Mon Sep 17 00:00:00 2001 From: iChun Date: Wed, 31 Jul 2013 08:03:10 +0800 Subject: [PATCH] Fix RenderLivingEvent.Pre/Post not being fired by most Renders. --- .../entity/RendererLivingEntity.java.patch | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch index 4a92efc5f..9df5e61cf 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch @@ -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)); - } -}