mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 14:34:28 +00:00
65 lines
3.4 KiB
Diff
65 lines
3.4 KiB
Diff
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
|
|
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
|
|
@@ -38,6 +38,9 @@
|
|
protected List<LayerRenderer<T>> field_177097_h = Lists.<LayerRenderer<T>>newArrayList();
|
|
protected boolean field_177098_i = false;
|
|
|
|
+ public static float NAME_TAG_RANGE = 64.0f;
|
|
+ public static float NAME_TAG_RANGE_SNEAK = 32.0f;
|
|
+
|
|
public RendererLivingEntity(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_)
|
|
{
|
|
super(p_i46156_1_);
|
|
@@ -83,10 +86,12 @@
|
|
|
|
public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
|
|
{
|
|
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return;
|
|
GlStateManager.func_179094_E();
|
|
GlStateManager.func_179129_p();
|
|
this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_);
|
|
- this.field_77045_g.field_78093_q = p_76986_1_.func_70115_ae();
|
|
+ boolean shouldSit = p_76986_1_.func_70115_ae() && (p_76986_1_.field_70154_o != null && p_76986_1_.field_70154_o.shouldRiderSit());
|
|
+ this.field_77045_g.field_78093_q = shouldSit;
|
|
this.field_77045_g.field_78091_s = p_76986_1_.func_70631_g_();
|
|
|
|
try
|
|
@@ -95,7 +100,7 @@
|
|
float f1 = this.func_77034_a(p_76986_1_.field_70758_at, p_76986_1_.field_70759_as, p_76986_9_);
|
|
float f2 = f1 - f;
|
|
|
|
- if (p_76986_1_.func_70115_ae() && p_76986_1_.field_70154_o instanceof EntityLivingBase)
|
|
+ if (shouldSit && p_76986_1_.field_70154_o instanceof EntityLivingBase)
|
|
{
|
|
EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.field_70154_o;
|
|
f = this.func_77034_a(entitylivingbase.field_70760_ar, entitylivingbase.field_70761_aq, p_76986_9_);
|
|
@@ -191,6 +196,7 @@
|
|
{
|
|
super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
|
}
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_));
|
|
}
|
|
|
|
protected boolean func_177088_c(T p_177088_1_)
|
|
@@ -469,10 +475,11 @@
|
|
|
|
public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_)
|
|
{
|
|
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return;
|
|
if (this.func_177070_b(p_177067_1_))
|
|
{
|
|
double d0 = p_177067_1_.func_70068_e(this.field_76990_c.field_78734_h);
|
|
- float f = p_177067_1_.func_70093_af() ? 32.0F : 64.0F;
|
|
+ float f = p_177067_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
|
|
|
|
if (d0 < (double)(f * f))
|
|
{
|
|
@@ -518,6 +525,7 @@
|
|
}
|
|
}
|
|
}
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_));
|
|
}
|
|
|
|
protected boolean func_177070_b(T p_177070_1_)
|