Fix some light-emitting blocks letting light through (MC-119932) (#4642)

This commit is contained in:
Ben Staddon 2018-05-17 06:29:03 +01:00 committed by LexManos
parent e7cd3d4df6
commit 8d994d074c
1 changed files with 32 additions and 24 deletions

View File

@ -744,22 +744,30 @@
{
return true;
}
@@ -2574,10 +2787,11 @@
@@ -2574,10 +2787,10 @@
else
{
IBlockState iblockstate1 = this.func_180495_p(p_175638_1_);
- int j2 = p_175638_2_ == EnumSkyBlock.SKY ? 0 : iblockstate1.func_185906_d();
- int k2 = iblockstate1.func_185891_c();
+ int blockLight = iblockstate1.func_177230_c().getLightValue(iblockstate1, this, p_175638_1_);
+ int j2 = p_175638_2_ == EnumSkyBlock.SKY ? 0 : blockLight;
+ int j2 = p_175638_2_ == EnumSkyBlock.SKY ? 0 : iblockstate1.func_177230_c().getLightValue(iblockstate1, this, p_175638_1_);
+ int k2 = iblockstate1.func_177230_c().getLightOpacity(iblockstate1, this, p_175638_1_);
- if (k2 >= 15 && iblockstate1.func_185906_d() > 0)
+ if (k2 >= 15 && blockLight > 0)
+ if (false) // Forge: fix MC-119932
{
k2 = 1;
}
@@ -2630,12 +2844,13 @@
@@ -2589,7 +2802,7 @@
if (k2 >= 15)
{
- return 0;
+ return j2; // Forge: fix MC-119932
}
else if (j2 >= 14)
{
@@ -2630,12 +2843,13 @@
public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_)
{
@ -774,7 +782,7 @@
int j2 = 0;
int k2 = 0;
this.field_72984_F.func_76320_a("getBrightness");
@@ -2673,7 +2888,7 @@
@@ -2673,7 +2887,7 @@
int l5 = MathHelper.func_76130_a(k4 - k3);
int i6 = MathHelper.func_76130_a(l4 - l3);
@ -783,7 +791,7 @@
{
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
@@ -2683,7 +2898,8 @@
@@ -2683,7 +2897,8 @@
int k6 = k4 + enumfacing.func_96559_d();
int l6 = l4 + enumfacing.func_82599_e();
blockpos$pooledmutableblockpos.func_181079_c(j6, k6, l6);
@ -793,7 +801,7 @@
j5 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
if (j5 == i5 - i7 && k2 < this.field_72994_J.length)
@@ -2725,7 +2941,7 @@
@@ -2725,7 +2940,7 @@
int j9 = Math.abs(i8 - l3);
boolean flag = k2 < this.field_72994_J.length - 6;
@ -802,7 +810,7 @@
{
if (this.func_175642_b(p_180500_1_, blockpos2.func_177976_e()) < k8)
{
@@ -2791,10 +3007,10 @@
@@ -2791,10 +3006,10 @@
public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate <? super Entity > p_175674_3_)
{
List<Entity> list = Lists.<Entity>newArrayList();
@ -817,7 +825,7 @@
for (int j3 = j2; j3 <= k2; ++j3)
{
@@ -2847,10 +3063,10 @@
@@ -2847,10 +3062,10 @@
public <T extends Entity> List<T> func_175647_a(Class <? extends T > p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate <? super T > p_175647_3_)
{
@ -832,7 +840,7 @@
List<T> list = Lists.<T>newArrayList();
for (int j3 = j2; j3 < k2; ++j3)
@@ -2930,11 +3146,13 @@
@@ -2930,11 +3145,13 @@
public void func_175650_b(Collection<Entity> p_175650_1_)
{
@ -849,7 +857,7 @@
}
}
@@ -2958,7 +3176,7 @@
@@ -2958,7 +3175,7 @@
}
else
{
@ -858,7 +866,7 @@
}
}
@@ -3042,7 +3260,7 @@
@@ -3042,7 +3259,7 @@
public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_)
{
IBlockState iblockstate1 = this.func_180495_p(p_175651_1_);
@ -867,7 +875,7 @@
}
public boolean func_175640_z(BlockPos p_175640_1_)
@@ -3208,6 +3426,8 @@
@@ -3208,6 +3425,8 @@
d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
}
@ -876,7 +884,7 @@
if ((p_184150_9_ < 0.0D || Math.abs(entityplayer1.field_70163_u - p_184150_3_) < p_184150_9_ * p_184150_9_) && (p_184150_7_ < 0.0D || d1 < d2 * d2) && (d0 == -1.0D || d1 < d0))
{
d0 = d1;
@@ -3269,7 +3489,7 @@
@@ -3269,7 +3488,7 @@
public long func_72905_C()
{
@ -885,7 +893,7 @@
}
public long func_82737_E()
@@ -3279,17 +3499,17 @@
@@ -3279,17 +3498,17 @@
public long func_72820_D()
{
@ -906,7 +914,7 @@
if (!this.func_175723_af().func_177746_a(blockpos1))
{
@@ -3301,7 +3521,7 @@
@@ -3301,7 +3520,7 @@
public void func_175652_B(BlockPos p_175652_1_)
{
@ -915,7 +923,7 @@
}
@SideOnly(Side.CLIENT)
@@ -3321,12 +3541,18 @@
@@ -3321,12 +3540,18 @@
if (!this.field_72996_f.contains(p_72897_1_))
{
@ -934,7 +942,7 @@
return true;
}
@@ -3428,8 +3654,7 @@
@@ -3428,8 +3653,7 @@
public boolean func_180502_D(BlockPos p_180502_1_)
{
@ -944,7 +952,7 @@
}
@Nullable
@@ -3490,12 +3715,12 @@
@@ -3490,12 +3714,12 @@
public int func_72800_K()
{
@ -959,7 +967,7 @@
}
public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_)
@@ -3539,7 +3764,7 @@
@@ -3539,7 +3763,7 @@
@SideOnly(Side.CLIENT)
public double func_72919_O()
{
@ -968,7 +976,7 @@
}
public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_)
@@ -3573,7 +3798,7 @@
@@ -3573,7 +3797,7 @@
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_)
{
@ -977,7 +985,7 @@
{
BlockPos blockpos1 = p_175666_1_.func_177972_a(enumfacing);
@@ -3581,18 +3806,15 @@
@@ -3581,18 +3805,15 @@
{
IBlockState iblockstate1 = this.func_180495_p(blockpos1);
@ -1000,7 +1008,7 @@
}
}
}
@@ -3658,6 +3880,124 @@
@@ -3658,6 +3879,124 @@
return j2 >= -128 && j2 <= 128 && k2 >= -128 && k2 <= 128;
}