ForgePatch/patches_old_unknown/EntityPlayerSP.java.patch

69 lines
2.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -448,6 +449,15 @@
}
}
+ private boolean isHeadspaceFree(BlockPos pos, int height)
+ {
+ for (int y = 0; y < height; y++)
+ {
+ if (!func_175162_d(pos.func_177982_a(0, y, 0))) return false;
+ }
+ return true;
+ }
+
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
{
if (this.field_70145_X)
@@ -460,30 +470,34 @@
double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
double d1 = p_145771_5_ - (double)blockpos.func_177952_p();
- if (!this.func_175162_d(blockpos))
+ int entHeight = Math.max((int)Math.ceil(this.field_70131_O), 1);
+
+ boolean inTranslucentBlock = !this.isHeadspaceFree(blockpos, entHeight);
+
+ if (inTranslucentBlock)
{
int i = -1;
double d2 = 9999.0D;
- if (this.func_175162_d(blockpos.func_177976_e()) && d0 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2)
{
d2 = d0;
i = 0;
}
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d0 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2)
{
d2 = 1.0D - d0;
i = 1;
}
- if (this.func_175162_d(blockpos.func_177978_c()) && d1 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2)
{
d2 = d1;
i = 4;
}
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d1 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2)
{
d2 = 1.0D - d1;
i = 5;
@@ -518,7 +532,8 @@
private boolean func_175162_d(BlockPos p_175162_1_)
{
- return !this.field_70170_p.func_180495_p(p_175162_1_).func_185915_l() && !this.field_70170_p.func_180495_p(p_175162_1_.func_177984_a()).func_185915_l();
+ IBlockState iblockstate = field_70170_p.func_180495_p(p_175162_1_);
+ return !iblockstate.func_177230_c().isNormalCube(iblockstate, field_70170_p, p_175162_1_);
}
public void func_70031_b(boolean p_70031_1_)