mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Revert "Invalidate tile entities that are queued for removal (#5512)"
This reverts commit 75788f63ee.
This solution is invalid as TEs are free to modify the world tileEntities
list, usually indirectly via chunkloading, from inside invalidate().
This happens in vanilla, in TileEntityChest#invalidate, where it calls
checkForAdjacentChests(), which has the potential to load neighboring
chunks and cause a CME.
A more sophisticated solution is needed.
This commit is contained in:
1 parent
3c426a2e66
commit
633fd9bd2e
1 file changed
+31
-37
@@ -704,7 +704,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2289,11 +2483,13 @@
|
||||
@@ -2289,6 +2483,7 @@
|
||||
|
||||
this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
|
||||
}
|
||||
@@ -712,13 +712,7 @@
|
||||
}
|
||||
|
||||
public void func_147457_a(TileEntity p_147457_1_)
|
||||
{
|
||||
this.field_147483_b.add(p_147457_1_);
|
||||
+ p_147457_1_.func_145843_s(); // Forge: invalidate TE promptly as removal happens later
|
||||
}
|
||||
|
||||
public boolean func_175665_u(BlockPos p_175665_1_)
|
||||
@@ -2315,7 +2511,7 @@
|
||||
@@ -2315,7 +2510,7 @@
|
||||
if (chunk1 != null && !chunk1.func_76621_g())
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(p_175677_1_);
|
||||
@@ -727,7 +721,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2338,6 +2534,7 @@
|
||||
@@ -2338,6 +2533,7 @@
|
||||
{
|
||||
this.field_72985_G = p_72891_1_;
|
||||
this.field_72992_H = p_72891_2_;
|
||||
@@ -735,7 +729,7 @@
|
||||
}
|
||||
|
||||
public void func_72835_b()
|
||||
@@ -2347,6 +2544,11 @@
|
||||
@@ -2347,6 +2543,11 @@
|
||||
|
||||
protected void func_72947_a()
|
||||
{
|
||||
@@ -747,7 +741,7 @@
|
||||
if (this.field_72986_A.func_76059_o())
|
||||
{
|
||||
this.field_73004_o = 1.0F;
|
||||
@@ -2360,6 +2562,11 @@
|
||||
@@ -2360,6 +2561,11 @@
|
||||
|
||||
protected void func_72979_l()
|
||||
{
|
||||
@@ -759,7 +753,7 @@
|
||||
if (this.field_73011_w.func_191066_m())
|
||||
{
|
||||
if (!this.field_72995_K)
|
||||
@@ -2484,6 +2691,11 @@
|
||||
@@ -2484,6 +2690,11 @@
|
||||
|
||||
public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_)
|
||||
{
|
||||
@@ -771,7 +765,7 @@
|
||||
Biome biome = this.func_180494_b(p_175670_1_);
|
||||
float f = biome.func_180626_a(p_175670_1_);
|
||||
|
||||
@@ -2525,6 +2737,11 @@
|
||||
@@ -2525,6 +2736,11 @@
|
||||
|
||||
public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_)
|
||||
{
|
||||
@@ -783,7 +777,7 @@
|
||||
Biome biome = this.func_180494_b(p_175708_1_);
|
||||
float f = biome.func_180626_a(p_175708_1_);
|
||||
|
||||
@@ -2542,7 +2759,7 @@
|
||||
@@ -2542,7 +2758,7 @@
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(p_175708_1_);
|
||||
|
||||
@@ -792,7 +786,7 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -2574,10 +2791,10 @@
|
||||
@@ -2574,10 +2790,10 @@
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(p_175638_1_);
|
||||
@@ -806,7 +800,7 @@
|
||||
{
|
||||
k2 = 1;
|
||||
}
|
||||
@@ -2589,7 +2806,7 @@
|
||||
@@ -2589,7 +2805,7 @@
|
||||
|
||||
if (k2 >= 15)
|
||||
{
|
||||
@@ -815,7 +809,7 @@
|
||||
}
|
||||
else if (j2 >= 14)
|
||||
{
|
||||
@@ -2630,12 +2847,13 @@
|
||||
@@ -2630,12 +2846,13 @@
|
||||
|
||||
public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_)
|
||||
{
|
||||
@@ -830,7 +824,7 @@
|
||||
int j2 = 0;
|
||||
int k2 = 0;
|
||||
this.field_72984_F.func_76320_a("getBrightness");
|
||||
@@ -2673,7 +2891,7 @@
|
||||
@@ -2673,7 +2890,7 @@
|
||||
int l5 = MathHelper.func_76130_a(k4 - k3);
|
||||
int i6 = MathHelper.func_76130_a(l4 - l3);
|
||||
|
||||
@@ -839,7 +833,7 @@
|
||||
{
|
||||
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
|
||||
|
||||
@@ -2683,7 +2901,8 @@
|
||||
@@ -2683,7 +2900,8 @@
|
||||
int k6 = k4 + enumfacing.func_96559_d();
|
||||
int l6 = l4 + enumfacing.func_82599_e();
|
||||
blockpos$pooledmutableblockpos.func_181079_c(j6, k6, l6);
|
||||
@@ -849,7 +843,7 @@
|
||||
j5 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
|
||||
|
||||
if (j5 == i5 - i7 && k2 < this.field_72994_J.length)
|
||||
@@ -2725,7 +2944,7 @@
|
||||
@@ -2725,7 +2943,7 @@
|
||||
int j9 = Math.abs(i8 - l3);
|
||||
boolean flag = k2 < this.field_72994_J.length - 6;
|
||||
|
||||
@@ -858,7 +852,7 @@
|
||||
{
|
||||
if (this.func_175642_b(p_180500_1_, blockpos2.func_177976_e()) < k8)
|
||||
{
|
||||
@@ -2791,10 +3010,10 @@
|
||||
@@ -2791,10 +3009,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();
|
||||
@@ -873,7 +867,7 @@
|
||||
|
||||
for (int j3 = j2; j3 <= k2; ++j3)
|
||||
{
|
||||
@@ -2847,10 +3066,10 @@
|
||||
@@ -2847,10 +3065,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_)
|
||||
{
|
||||
@@ -888,7 +882,7 @@
|
||||
List<T> list = Lists.<T>newArrayList();
|
||||
|
||||
for (int j3 = j2; j3 < k2; ++j3)
|
||||
@@ -2930,11 +3149,13 @@
|
||||
@@ -2930,11 +3148,13 @@
|
||||
|
||||
public void func_175650_b(Collection<Entity> p_175650_1_)
|
||||
{
|
||||
@@ -905,7 +899,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2948,7 +3169,8 @@
|
||||
@@ -2948,7 +3168,8 @@
|
||||
IBlockState iblockstate1 = this.func_180495_p(p_190527_2_);
|
||||
AxisAlignedBB axisalignedbb = p_190527_3_ ? null : p_190527_1_.func_176223_P().func_185890_d(this, p_190527_2_);
|
||||
|
||||
@@ -915,7 +909,7 @@
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -2958,7 +3180,7 @@
|
||||
@@ -2958,7 +3179,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -924,7 +918,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3042,7 +3264,7 @@
|
||||
@@ -3042,7 +3263,7 @@
|
||||
public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_)
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(p_175651_1_);
|
||||
@@ -933,7 +927,7 @@
|
||||
}
|
||||
|
||||
public boolean func_175640_z(BlockPos p_175640_1_)
|
||||
@@ -3208,6 +3430,8 @@
|
||||
@@ -3208,6 +3429,8 @@
|
||||
d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
|
||||
}
|
||||
|
||||
@@ -942,7 +936,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 +3493,7 @@
|
||||
@@ -3269,7 +3492,7 @@
|
||||
|
||||
public long func_72905_C()
|
||||
{
|
||||
@@ -951,7 +945,7 @@
|
||||
}
|
||||
|
||||
public long func_82737_E()
|
||||
@@ -3279,17 +3503,17 @@
|
||||
@@ -3279,17 +3502,17 @@
|
||||
|
||||
public long func_72820_D()
|
||||
{
|
||||
@@ -972,7 +966,7 @@
|
||||
|
||||
if (!this.func_175723_af().func_177746_a(blockpos1))
|
||||
{
|
||||
@@ -3301,7 +3525,7 @@
|
||||
@@ -3301,7 +3524,7 @@
|
||||
|
||||
public void func_175652_B(BlockPos p_175652_1_)
|
||||
{
|
||||
@@ -981,7 +975,7 @@
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -3321,12 +3545,18 @@
|
||||
@@ -3321,12 +3544,18 @@
|
||||
|
||||
if (!this.field_72996_f.contains(p_72897_1_))
|
||||
{
|
||||
@@ -1000,7 +994,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3428,8 +3658,7 @@
|
||||
@@ -3428,8 +3657,7 @@
|
||||
|
||||
public boolean func_180502_D(BlockPos p_180502_1_)
|
||||
{
|
||||
@@ -1010,7 +1004,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -3490,12 +3719,12 @@
|
||||
@@ -3490,12 +3718,12 @@
|
||||
|
||||
public int func_72800_K()
|
||||
{
|
||||
@@ -1025,7 +1019,7 @@
|
||||
}
|
||||
|
||||
public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_)
|
||||
@@ -3539,7 +3768,7 @@
|
||||
@@ -3539,7 +3767,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double func_72919_O()
|
||||
{
|
||||
@@ -1034,7 +1028,7 @@
|
||||
}
|
||||
|
||||
public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_)
|
||||
@@ -3573,7 +3802,7 @@
|
||||
@@ -3573,7 +3801,7 @@
|
||||
|
||||
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_)
|
||||
{
|
||||
@@ -1043,7 +1037,7 @@
|
||||
{
|
||||
BlockPos blockpos1 = p_175666_1_.func_177972_a(enumfacing);
|
||||
|
||||
@@ -3581,18 +3810,15 @@
|
||||
@@ -3581,18 +3809,15 @@
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(blockpos1);
|
||||
|
||||
@@ -1066,7 +1060,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3658,6 +3884,124 @@
|
||||
@@ -3658,6 +3883,124 @@
|
||||
return j2 >= -128 && j2 <= 128 && k2 >= -128 && k2 <= 128;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user