Add hook for TE data sync on client (#2893)

This commit is contained in:
tterrag 2016-05-26 01:19:29 -04:00 committed by LexManos
parent 48cc7582cc
commit e00a11be99
2 changed files with 22 additions and 1 deletions

View File

@ -9,6 +9,15 @@
this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g();
this.field_147299_f.func_71403_a(this.field_147300_g);
this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f();
@@ -719,7 +719,7 @@
if (tileentity != null)
{
- tileentity.func_145839_a(nbttagcompound);
+ tileentity.handleUpdateTag(nbttagcompound);
}
}
}
@@ -797,14 +797,16 @@
public void func_147251_a(SPacketChat p_147251_1_)
{

View File

@ -68,7 +68,7 @@
public double func_145835_a(double p_145835_1_, double p_145835_3_, double p_145835_5_)
{
double d0 = (double)this.field_174879_c.func_177958_n() + 0.5D - p_145835_1_;
@@ -283,6 +293,186 @@
@@ -283,6 +293,198 @@
return false;
}
@ -85,6 +85,18 @@
+ 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)
+ {
+ this.func_145839_a(tag);
+ }
+
+ /**
+ * Called when the chunk this TileEntity is on is Unloaded.