Reimplement variable eyeHeight for players which was removed in the 1.7 to 1.8 port.

This commit is contained in:
iChun 2015-02-19 02:08:03 +00:00
parent 0e34510032
commit d66951b368
1 changed files with 50 additions and 33 deletions

View File

@ -24,7 +24,15 @@
public InventoryPlayer field_71071_by = new InventoryPlayer(this);
private InventoryEnderChest field_71078_a = new InventoryEnderChest();
public Container field_71069_bz;
@@ -176,7 +190,8 @@
@@ -118,6 +132,7 @@
private final GameProfile field_146106_i;
private boolean field_175153_bG = false;
public EntityFishHook field_71104_cf;
+ public float eyeHeight = this.getDefaultEyeHeight();
private static final String __OBFID = "CL_00001711";
public EntityPlayer(World p_i45324_1_, GameProfile p_i45324_2_)
@@ -176,7 +191,8 @@
{
if (this.field_71074_e != null)
{
@ -34,7 +42,7 @@
}
this.func_71041_bz();
@@ -214,6 +229,14 @@
@@ -214,6 +230,14 @@
if (itemstack == this.field_71074_e)
{
@ -49,7 +57,7 @@
if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0)
{
this.func_71010_c(itemstack, 5);
@@ -223,6 +246,7 @@
@@ -223,6 +247,7 @@
{
this.func_71036_o();
}
@ -57,7 +65,7 @@
}
else
{
@@ -268,7 +292,7 @@
@@ -268,7 +293,7 @@
super.func_70071_h_();
@ -66,7 +74,7 @@
{
this.func_71053_j();
this.field_71070_bA = this.field_71069_bz;
@@ -415,11 +439,13 @@
@@ -415,11 +440,13 @@
int i = this.field_71074_e.field_77994_a;
ItemStack itemstack = this.field_71074_e.func_77950_b(this.field_70170_p, this);
@ -81,7 +89,7 @@
{
this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = null;
}
@@ -479,11 +505,11 @@
@@ -479,11 +506,11 @@
this.field_71109_bG = 0.0F;
this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2);
@ -95,7 +103,7 @@
}
}
}
@@ -613,11 +639,15 @@
@@ -613,11 +640,15 @@
public void func_70645_a(DamageSource p_70645_1_)
{
@ -111,7 +119,7 @@
if (this.func_70005_c_().equals("Notch"))
{
this.func_146097_a(new ItemStack(Items.field_151034_e, 1), true, false);
@@ -628,6 +658,9 @@
@@ -628,6 +659,9 @@
this.field_71071_by.func_70436_m();
}
@ -121,7 +129,7 @@
if (p_70645_1_ != null)
{
this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * (float)Math.PI / 180.0F) * 0.1F);
@@ -716,12 +749,25 @@
@@ -716,12 +750,25 @@
public EntityItem func_71040_bB(boolean p_71040_1_)
{
@ -149,7 +157,7 @@
}
public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_)
@@ -782,13 +828,25 @@
@@ -782,13 +829,25 @@
public void func_71012_a(EntityItem p_71012_1_)
{
@ -176,7 +184,7 @@
if (f > 1.0F)
{
int i = EnchantmentHelper.func_77509_b(this);
@@ -838,12 +896,13 @@
@@ -838,12 +897,13 @@
f /= 5.0F;
}
@ -192,7 +200,7 @@
}
public void func_70037_a(NBTTagCompound p_70037_1_)
@@ -879,6 +938,16 @@
@@ -879,6 +939,16 @@
this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced");
}
@ -209,7 +217,7 @@
this.field_71100_bB.func_75112_a(p_70037_1_);
this.field_71075_bZ.func_75095_b(p_70037_1_);
@@ -910,6 +979,23 @@
@@ -910,6 +980,23 @@
p_70014_1_.func_74757_a("SpawnForced", this.field_82248_d);
}
@ -233,7 +241,7 @@
this.field_71100_bB.func_75117_b(p_70014_1_);
this.field_71075_bZ.func_75091_a(p_70014_1_);
p_70014_1_.func_74782_a("EnderItems", this.field_71078_a.func_70487_g());
@@ -923,6 +1009,7 @@
@@ -923,6 +1010,7 @@
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_)
{
@ -241,7 +249,7 @@
if (this.func_180431_b(p_70097_1_))
{
return false;
@@ -1023,12 +1110,15 @@
@@ -1023,12 +1111,15 @@
{
if (!this.func_180431_b(p_70665_1_))
{
@ -258,7 +266,7 @@
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
float f1 = p_70665_2_;
p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F);
@@ -1076,6 +1166,7 @@
@@ -1076,6 +1167,7 @@
}
else
{
@ -266,7 +274,7 @@
ItemStack itemstack = this.func_71045_bC();
ItemStack itemstack1 = itemstack != null ? itemstack.func_77946_l() : null;
@@ -1127,7 +1218,9 @@
@@ -1127,7 +1219,9 @@
public void func_71028_bD()
{
@ -276,7 +284,7 @@
}
public double func_70033_W()
@@ -1137,6 +1230,7 @@
@@ -1137,6 +1231,7 @@
public void func_71059_n(Entity p_71059_1_)
{
@ -284,7 +292,7 @@
if (p_71059_1_.func_70075_an())
{
if (!p_71059_1_.func_85031_j(this))
@@ -1307,6 +1401,8 @@
@@ -1307,6 +1402,8 @@
public EntityPlayer.EnumStatus func_180469_a(BlockPos p_180469_1_)
{
@ -293,7 +301,7 @@
if (!this.field_70170_p.field_72995_K)
{
if (this.func_70608_bn() || !this.func_70089_S())
@@ -1348,7 +1444,7 @@
@@ -1348,7 +1445,7 @@
if (this.field_70170_p.func_175667_e(p_180469_1_))
{
@ -302,7 +310,7 @@
float f = 0.5F;
float f1 = 0.5F;
@@ -1411,13 +1507,14 @@
@@ -1411,13 +1508,14 @@
public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_)
{
@ -320,7 +328,7 @@
if (blockpos == null)
{
@@ -1444,12 +1541,12 @@
@@ -1444,12 +1542,12 @@
private boolean func_175143_p()
{
@ -335,7 +343,7 @@
{
if (!p_180467_2_)
{
@@ -1466,7 +1563,7 @@
@@ -1466,7 +1564,7 @@
}
else
{
@ -344,7 +352,7 @@
}
}
@@ -1475,7 +1572,7 @@
@@ -1475,7 +1573,7 @@
{
if (this.field_71081_bT != null)
{
@ -353,7 +361,7 @@
switch (EntityPlayer.SwitchEnumFacing.field_179420_a[enumfacing.ordinal()])
{
@@ -1513,16 +1610,22 @@
@@ -1513,16 +1611,22 @@
public BlockPos func_180470_cg()
{
@ -378,7 +386,7 @@
if (p_180473_1_ != null)
{
this.field_71077_c = p_180473_1_;
@@ -1704,6 +1807,10 @@
@@ -1704,6 +1808,10 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
}
@ -389,7 +397,7 @@
}
protected void func_71061_d_()
@@ -1839,6 +1946,8 @@
@@ -1839,6 +1947,8 @@
{
if (p_71008_1_ != this.field_71074_e)
{
@ -398,7 +406,7 @@
this.field_71074_e = p_71008_1_;
this.field_71072_f = p_71008_2_;
@@ -1908,6 +2017,10 @@
@@ -1908,6 +2018,10 @@
this.field_71106_cc = p_71049_1_.field_71106_cc;
this.func_85040_s(p_71049_1_.func_71037_bA());
this.field_82152_aq = p_71049_1_.field_82152_aq;
@ -409,7 +417,7 @@
}
else if (this.field_70170_p.func_82736_K().func_82766_b("keepInventory"))
{
@@ -1920,6 +2033,18 @@
@@ -1920,6 +2034,18 @@
this.field_71078_a = p_71049_1_.field_71078_a;
this.func_70096_w().func_75692_b(10, Byte.valueOf(p_71049_1_.func_70096_w().func_75683_a(10)));
@ -428,7 +436,7 @@
}
protected boolean func_70041_e_()
@@ -1953,7 +2078,14 @@
@@ -1953,7 +2079,14 @@
public void func_70062_b(int p_70062_1_, ItemStack p_70062_2_)
{
@ -444,7 +452,7 @@
}
@SideOnly(Side.CLIENT)
@@ -1998,7 +2130,10 @@
@@ -1998,7 +2131,10 @@
public IChatComponent func_145748_c_()
{
@ -456,7 +464,16 @@
chatcomponenttext.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " "));
chatcomponenttext.func_150256_b().func_150209_a(this.func_174823_aP());
chatcomponenttext.func_150256_b().func_179989_a(this.func_70005_c_());
@@ -2157,6 +2292,120 @@
@@ -2007,7 +2143,7 @@
public float func_70047_e()
{
- float f = 1.62F;
+ float f = eyeHeight;
if (this.func_70608_bn())
{
@@ -2157,6 +2293,120 @@
net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z);
}
@ -530,7 +547,7 @@
+ */
+ public float getDefaultEyeHeight()
+ {
+ return 0.12F;
+ return 1.62F;
+ }
+
+ /**