ForgePatch/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.p...

46 lines
1.8 KiB
Diff

--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
@@ -17,6 +17,9 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.util.MathHelper;
+import net.minecraftforge.client.event.RenderLivingEvent;
+import net.minecraftforge.common.MinecraftForge;
+
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@@ -28,6 +31,9 @@
/** The model to be used during the render passes. */
protected ModelBase renderPassModel;
+
+ public static float NAME_TAG_RANGE = 64.0f;
+ public static float NAME_TAG_RANGE_SNEAK = 32.0f;
public RendererLivingEntity(ModelBase par1ModelBase, float par2)
{
@@ -442,12 +448,13 @@
*/
protected void passSpecialRender(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6)
{
+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Pre(par1EntityLivingBase, this))) return;
if (this.func_110813_b(par1EntityLivingBase))
{
float f = 1.6F;
float f1 = 0.016666668F * f;
double d3 = par1EntityLivingBase.getDistanceSqToEntity(this.renderManager.livingPlayer);
- float f2 = par1EntityLivingBase.isSneaking() ? 32.0F : 64.0F;
+ float f2 = par1EntityLivingBase.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
if (d3 < (double)(f2 * f2))
{
@@ -491,6 +498,7 @@
}
}
}
+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Post(par1EntityLivingBase, this));
}
protected boolean func_110813_b(EntityLivingBase par1EntityLivingBase)