Fixed POTENTIAL issue where mods would query world infrom from TEs before they are set. Closes #2863
This commit is contained in:
parent
9a23cf76d2
commit
6ca018c2b5
3 changed files with 79 additions and 50 deletions
|
@ -85,12 +85,12 @@
|
|||
+ public void onDataPacket(net.minecraft.network.NetworkManager net, net.minecraft.network.play.server.SPacketUpdateTileEntity pkt)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ /**
|
||||
+ * Called when the chunk's TE update tag, gotten from {@link #getUpdateTag()}, is received on the client.
|
||||
+ * <p>
|
||||
+ * Used to handle this tag in a special way. By default this simply calls {@link #readFromNBT(NBTTagCompound)}.
|
||||
+ *
|
||||
+ *
|
||||
+ * @param tag The {@link NBTTagCompound} sent from {@link #getUpdateTag()}
|
||||
+ */
|
||||
+ public void handleUpdateTag(NBTTagCompound tag)
|
||||
|
|
|
@ -405,17 +405,33 @@
|
|||
this.field_72984_F.func_76318_c("pendingBlockEntities");
|
||||
|
||||
if (!this.field_147484_a.isEmpty())
|
||||
@@ -1754,7 +1881,8 @@
|
||||
@@ -1754,8 +1881,12 @@
|
||||
|
||||
public boolean func_175700_a(TileEntity p_175700_1_)
|
||||
{
|
||||
- boolean flag = this.field_147482_g.add(p_175700_1_);
|
||||
+ if (p_175700_1_.func_145831_w() != null) // Forge - set the world early as vanilla doesn't set it until next tick
|
||||
+ p_175700_1_.func_145834_a(this);
|
||||
|
||||
+ List<TileEntity> dest = field_147481_N ? field_147484_a : field_147482_g;
|
||||
+ boolean flag = dest.add(p_175700_1_);
|
||||
|
||||
+
|
||||
if (flag && p_175700_1_ instanceof ITickable)
|
||||
{
|
||||
@@ -1788,9 +1916,13 @@
|
||||
this.field_175730_i.add(p_175700_1_);
|
||||
@@ -1768,6 +1899,11 @@
|
||||
{
|
||||
if (this.field_147481_N)
|
||||
{
|
||||
+ for (TileEntity te : p_147448_1_)
|
||||
+ {
|
||||
+ if (te.func_145831_w() != this) // Forge - set the world early as vanilla doesn't set it until next tick
|
||||
+ te.func_145834_a(this);
|
||||
+ }
|
||||
this.field_147484_a.addAll(p_147448_1_);
|
||||
}
|
||||
else
|
||||
@@ -1788,9 +1924,13 @@
|
||||
{
|
||||
int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
|
||||
int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
|
||||
|
@ -431,7 +447,7 @@
|
|||
{
|
||||
p_72866_1_.field_70142_S = p_72866_1_.field_70165_t;
|
||||
p_72866_1_.field_70137_T = p_72866_1_.field_70163_u;
|
||||
@@ -1989,6 +2121,10 @@
|
||||
@@ -1989,6 +2129,10 @@
|
||||
blockpos$pooledmutableblockpos.func_185344_t();
|
||||
return true;
|
||||
}
|
||||
|
@ -442,7 +458,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -2028,6 +2164,16 @@
|
||||
@@ -2028,6 +2172,16 @@
|
||||
IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos);
|
||||
Block block = iblockstate.func_177230_c();
|
||||
|
||||
|
@ -459,7 +475,7 @@
|
|||
if (iblockstate.func_185904_a() == p_72918_2_)
|
||||
{
|
||||
double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
|
||||
@@ -2104,6 +2250,9 @@
|
||||
@@ -2104,6 +2258,9 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_185343_d(k1, l1, i2));
|
||||
|
||||
|
@ -469,7 +485,7 @@
|
|||
if (iblockstate.func_185904_a() == p_72830_2_)
|
||||
{
|
||||
int j2 = ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue();
|
||||
@@ -2136,6 +2285,7 @@
|
||||
@@ -2136,6 +2293,7 @@
|
||||
public Explosion func_72885_a(@Nullable Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
|
||||
{
|
||||
Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_);
|
||||
|
@ -477,7 +493,7 @@
|
|||
explosion.func_77278_a();
|
||||
explosion.func_77279_a(true);
|
||||
return explosion;
|
||||
@@ -2258,6 +2408,7 @@
|
||||
@@ -2258,6 +2416,7 @@
|
||||
|
||||
public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_)
|
||||
{
|
||||
|
@ -485,7 +501,16 @@
|
|||
if (!this.func_189509_E(p_175690_1_))
|
||||
{
|
||||
if (p_175690_2_ != null && !p_175690_2_.func_145837_r())
|
||||
@@ -2283,8 +2434,10 @@
|
||||
@@ -2265,6 +2424,8 @@
|
||||
if (this.field_147481_N)
|
||||
{
|
||||
p_175690_2_.func_174878_a(p_175690_1_);
|
||||
+ if (p_175690_2_.func_145831_w() != this)
|
||||
+ p_175690_2_.func_145834_a(this); // Forge - set the world early as vanilla doesn't set it until next tick
|
||||
Iterator<TileEntity> iterator = this.field_147484_a.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
@@ -2283,8 +2444,10 @@
|
||||
else
|
||||
{
|
||||
this.func_175700_a(p_175690_2_);
|
||||
|
@ -497,7 +522,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -2297,6 +2450,8 @@
|
||||
@@ -2297,6 +2460,8 @@
|
||||
{
|
||||
tileentity.func_145843_s();
|
||||
this.field_147484_a.remove(tileentity);
|
||||
|
@ -506,7 +531,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
@@ -2309,6 +2464,7 @@
|
||||
@@ -2309,6 +2474,7 @@
|
||||
|
||||
this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
|
||||
}
|
||||
|
@ -514,7 +539,7 @@
|
|||
}
|
||||
|
||||
public void func_147457_a(TileEntity p_147457_1_)
|
||||
@@ -2335,7 +2491,7 @@
|
||||
@@ -2335,7 +2501,7 @@
|
||||
if (chunk != null && !chunk.func_76621_g())
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175677_1_);
|
||||
|
@ -523,7 +548,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
@@ -2358,6 +2514,7 @@
|
||||
@@ -2358,6 +2524,7 @@
|
||||
{
|
||||
this.field_72985_G = p_72891_1_;
|
||||
this.field_72992_H = p_72891_2_;
|
||||
|
@ -531,7 +556,7 @@
|
|||
}
|
||||
|
||||
public void func_72835_b()
|
||||
@@ -2367,6 +2524,11 @@
|
||||
@@ -2367,6 +2534,11 @@
|
||||
|
||||
protected void func_72947_a()
|
||||
{
|
||||
|
@ -543,7 +568,7 @@
|
|||
if (this.field_72986_A.func_76059_o())
|
||||
{
|
||||
this.field_73004_o = 1.0F;
|
||||
@@ -2380,6 +2542,11 @@
|
||||
@@ -2380,6 +2552,11 @@
|
||||
|
||||
protected void func_72979_l()
|
||||
{
|
||||
|
@ -555,7 +580,7 @@
|
|||
if (!this.field_73011_w.func_177495_o())
|
||||
{
|
||||
if (!this.field_72995_K)
|
||||
@@ -2499,6 +2666,11 @@
|
||||
@@ -2499,6 +2676,11 @@
|
||||
|
||||
public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_)
|
||||
{
|
||||
|
@ -567,7 +592,7 @@
|
|||
Biome biome = this.func_180494_b(p_175670_1_);
|
||||
float f = biome.func_180626_a(p_175670_1_);
|
||||
|
||||
@@ -2540,6 +2712,11 @@
|
||||
@@ -2540,6 +2722,11 @@
|
||||
|
||||
public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_)
|
||||
{
|
||||
|
@ -579,7 +604,7 @@
|
|||
Biome biome = this.func_180494_b(p_175708_1_);
|
||||
float f = biome.func_180626_a(p_175708_1_);
|
||||
|
||||
@@ -2557,7 +2734,7 @@
|
||||
@@ -2557,7 +2744,7 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175708_1_);
|
||||
|
||||
|
@ -588,7 +613,7 @@
|
|||
{
|
||||
return true;
|
||||
}
|
||||
@@ -2589,10 +2766,11 @@
|
||||
@@ -2589,10 +2776,11 @@
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175638_1_);
|
||||
|
@ -603,7 +628,7 @@
|
|||
{
|
||||
j = 1;
|
||||
}
|
||||
@@ -2691,7 +2869,7 @@
|
||||
@@ -2691,7 +2879,7 @@
|
||||
int j4 = j2 + enumfacing.func_96559_d();
|
||||
int k4 = k2 + enumfacing.func_82599_e();
|
||||
blockpos$pooledmutableblockpos.func_185343_d(i4, j4, k4);
|
||||
|
@ -612,7 +637,7 @@
|
|||
i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
|
||||
|
||||
if (i3 == l2 - l4 && j < this.field_72994_J.length)
|
||||
@@ -2799,10 +2977,10 @@
|
||||
@@ -2799,10 +2987,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();
|
||||
|
@ -627,7 +652,7 @@
|
|||
|
||||
for (int i1 = i; i1 <= j; ++i1)
|
||||
{
|
||||
@@ -2855,10 +3033,10 @@
|
||||
@@ -2855,10 +3043,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_)
|
||||
{
|
||||
|
@ -642,7 +667,7 @@
|
|||
List<T> list = Lists.<T>newArrayList();
|
||||
|
||||
for (int i1 = i; i1 < j; ++i1)
|
||||
@@ -2938,11 +3116,13 @@
|
||||
@@ -2938,11 +3126,13 @@
|
||||
|
||||
public void func_175650_b(Collection<Entity> p_175650_1_)
|
||||
{
|
||||
|
@ -659,7 +684,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -2955,7 +3135,7 @@
|
||||
@@ -2955,7 +3145,7 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175716_2_);
|
||||
AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.func_176223_P().func_185890_d(this, p_175716_2_);
|
||||
|
@ -668,7 +693,7 @@
|
|||
}
|
||||
|
||||
public int func_181545_F()
|
||||
@@ -3038,7 +3218,7 @@
|
||||
@@ -3038,7 +3228,7 @@
|
||||
public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_)
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175651_1_);
|
||||
|
@ -677,7 +702,7 @@
|
|||
}
|
||||
|
||||
public boolean func_175640_z(BlockPos p_175640_1_)
|
||||
@@ -3235,7 +3415,7 @@
|
||||
@@ -3235,7 +3425,7 @@
|
||||
|
||||
public long func_72905_C()
|
||||
{
|
||||
|
@ -686,7 +711,7 @@
|
|||
}
|
||||
|
||||
public long func_82737_E()
|
||||
@@ -3245,17 +3425,17 @@
|
||||
@@ -3245,17 +3435,17 @@
|
||||
|
||||
public long func_72820_D()
|
||||
{
|
||||
|
@ -707,7 +732,7 @@
|
|||
|
||||
if (!this.func_175723_af().func_177746_a(blockpos))
|
||||
{
|
||||
@@ -3267,7 +3447,7 @@
|
||||
@@ -3267,7 +3457,7 @@
|
||||
|
||||
public void func_175652_B(BlockPos p_175652_1_)
|
||||
{
|
||||
|
@ -716,7 +741,7 @@
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -3287,12 +3467,18 @@
|
||||
@@ -3287,12 +3477,18 @@
|
||||
|
||||
if (!this.field_72996_f.contains(p_72897_1_))
|
||||
{
|
||||
|
@ -735,7 +760,7 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
@@ -3386,8 +3572,7 @@
|
||||
@@ -3386,8 +3582,7 @@
|
||||
|
||||
public boolean func_180502_D(BlockPos p_180502_1_)
|
||||
{
|
||||
|
@ -745,7 +770,7 @@
|
|||
}
|
||||
|
||||
@Nullable
|
||||
@@ -3448,12 +3633,12 @@
|
||||
@@ -3448,12 +3643,12 @@
|
||||
|
||||
public int func_72800_K()
|
||||
{
|
||||
|
@ -760,7 +785,7 @@
|
|||
}
|
||||
|
||||
public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_)
|
||||
@@ -3503,7 +3688,7 @@
|
||||
@@ -3503,7 +3698,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double func_72919_O()
|
||||
{
|
||||
|
@ -769,7 +794,7 @@
|
|||
}
|
||||
|
||||
public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_)
|
||||
@@ -3537,7 +3722,7 @@
|
||||
@@ -3537,7 +3732,7 @@
|
||||
|
||||
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_)
|
||||
{
|
||||
|
@ -778,7 +803,7 @@
|
|||
{
|
||||
BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
|
||||
|
||||
@@ -3545,18 +3730,14 @@
|
||||
@@ -3545,18 +3740,14 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(blockpos);
|
||||
|
||||
|
@ -801,7 +826,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -3622,6 +3803,87 @@
|
||||
@@ -3622,6 +3813,87 @@
|
||||
return i >= -k && i <= k && j >= -k && j <= k;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,11 @@
|
|||
|
||||
return tileentity;
|
||||
}
|
||||
@@ -807,7 +806,7 @@
|
||||
@@ -804,10 +803,11 @@
|
||||
|
||||
public void func_177426_a(BlockPos p_177426_1_, TileEntity p_177426_2_)
|
||||
{
|
||||
+ if (p_177426_2_.func_145831_w() != this.field_76637_e) //Forge don't call unless it's changed, could screw up bad mods.
|
||||
p_177426_2_.func_145834_a(this.field_76637_e);
|
||||
p_177426_2_.func_174878_a(p_177426_1_);
|
||||
|
||||
|
@ -153,7 +157,7 @@
|
|||
{
|
||||
if (this.field_150816_i.containsKey(p_177426_1_))
|
||||
{
|
||||
@@ -816,6 +815,7 @@
|
||||
@@ -816,6 +816,7 @@
|
||||
|
||||
p_177426_2_.func_145829_t();
|
||||
this.field_150816_i.put(p_177426_1_, p_177426_2_);
|
||||
|
@ -161,7 +165,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -844,8 +844,9 @@
|
||||
@@ -844,8 +845,9 @@
|
||||
entity.func_110123_P();
|
||||
}
|
||||
|
||||
|
@ -172,7 +176,7 @@
|
|||
}
|
||||
|
||||
public void func_76623_d()
|
||||
@@ -861,6 +862,7 @@
|
||||
@@ -861,6 +863,7 @@
|
||||
{
|
||||
this.field_76637_e.func_175681_c(this.field_76645_j[i]);
|
||||
}
|
||||
|
@ -180,7 +184,7 @@
|
|||
}
|
||||
|
||||
public void func_76630_e()
|
||||
@@ -870,8 +872,8 @@
|
||||
@@ -870,8 +873,8 @@
|
||||
|
||||
public void func_177414_a(@Nullable Entity p_177414_1_, AxisAlignedBB p_177414_2_, List<Entity> p_177414_3_, Predicate <? super Entity > p_177414_4_)
|
||||
{
|
||||
|
@ -191,7 +195,7 @@
|
|||
i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1);
|
||||
j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1);
|
||||
|
||||
@@ -910,8 +912,8 @@
|
||||
@@ -910,8 +913,8 @@
|
||||
|
||||
public <T extends Entity> void func_177430_a(Class <? extends T > p_177430_1_, AxisAlignedBB p_177430_2_, List<T> p_177430_3_, Predicate <? super T > p_177430_4_)
|
||||
{
|
||||
|
@ -202,7 +206,7 @@
|
|||
i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1);
|
||||
j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1);
|
||||
|
||||
@@ -1000,6 +1002,7 @@
|
||||
@@ -1000,6 +1003,7 @@
|
||||
{
|
||||
this.func_150809_p();
|
||||
p_186034_1_.func_185931_b(this.field_76635_g, this.field_76647_h);
|
||||
|
@ -210,7 +214,7 @@
|
|||
this.func_76630_e();
|
||||
}
|
||||
}
|
||||
@@ -1056,7 +1059,7 @@
|
||||
@@ -1056,7 +1060,7 @@
|
||||
{
|
||||
BlockPos blockpos = (BlockPos)this.field_177447_w.poll();
|
||||
|
||||
|
@ -219,7 +223,7 @@
|
|||
{
|
||||
TileEntity tileentity = this.func_177422_i(blockpos);
|
||||
this.field_76637_e.func_175690_a(blockpos, tileentity);
|
||||
@@ -1120,6 +1123,13 @@
|
||||
@@ -1120,6 +1124,13 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void func_186033_a(PacketBuffer p_186033_1_, int p_186033_2_, boolean p_186033_3_)
|
||||
{
|
||||
|
@ -233,7 +237,7 @@
|
|||
boolean flag = !this.field_76637_e.field_73011_w.func_177495_o();
|
||||
|
||||
for (int i = 0; i < this.field_76652_q.length; ++i)
|
||||
@@ -1168,10 +1178,16 @@
|
||||
@@ -1168,10 +1179,16 @@
|
||||
this.field_76646_k = true;
|
||||
this.func_76590_a();
|
||||
|
||||
|
@ -250,7 +254,7 @@
|
|||
}
|
||||
|
||||
public Biome func_177411_a(BlockPos p_177411_1_, BiomeProvider p_177411_2_)
|
||||
@@ -1239,13 +1255,13 @@
|
||||
@@ -1239,13 +1256,13 @@
|
||||
BlockPos blockpos1 = blockpos.func_177982_a(k, (j << 4) + i1, l);
|
||||
boolean flag = i1 == 0 || i1 == 15 || k == 0 || k == 15 || l == 0 || l == 15;
|
||||
|
||||
|
@ -266,7 +270,7 @@
|
|||
{
|
||||
this.field_76637_e.func_175664_x(blockpos2);
|
||||
}
|
||||
@@ -1376,7 +1392,7 @@
|
||||
@@ -1376,7 +1393,7 @@
|
||||
{
|
||||
blockpos$mutableblockpos.func_181079_c(blockpos$mutableblockpos.func_177958_n(), l, blockpos$mutableblockpos.func_177952_p());
|
||||
|
||||
|
@ -275,7 +279,7 @@
|
|||
{
|
||||
this.field_76637_e.func_175664_x(blockpos$mutableblockpos);
|
||||
}
|
||||
@@ -1487,4 +1503,20 @@
|
||||
@@ -1487,4 +1504,20 @@
|
||||
QUEUED,
|
||||
CHECK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue