diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-11-14 20:03:58 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-11-14 20:14:47 -0600 |
commit | e1afee008feae398d48edcb2b2a3c45640e16271 (patch) | |
tree | 1fbe764aabfdc02467fe32a8def4ecf27185d11f /src/main/java/net/minecraft/server/ItemInWorldManager.java | |
parent | df69ea8814a446502a0d096f542cbbb6879c80cd (diff) | |
download | craftbukkit-e1afee008feae398d48edcb2b2a3c45640e16271.tar craftbukkit-e1afee008feae398d48edcb2b2a3c45640e16271.tar.gz craftbukkit-e1afee008feae398d48edcb2b2a3c45640e16271.tar.lz craftbukkit-e1afee008feae398d48edcb2b2a3c45640e16271.tar.xz craftbukkit-e1afee008feae398d48edcb2b2a3c45640e16271.zip |
Update tile entity on client on cancelled block break. Fixes BUKKIT-2935
When a client tries to break a block it assumes it has done so unless told
otherwise by the server. This means the client also wipes out any tile
entity data it has for the block as well. We do not send this data when
updating the client so clients lose things like text on signs, skull type,
etc when they aren't allowed to break the block.
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemInWorldManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemInWorldManager.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index 771c05f0..3baef72e 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -279,6 +279,11 @@ public class ItemInWorldManager { if (event.isCancelled()) { // Let the client know the block still exists ((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world)); + // Update any tile entity data for this block + TileEntity tileentity = this.world.getTileEntity(i, j, k); + if (tileentity != null) { + this.player.netServerHandler.sendPacket(tileentity.getUpdatePacket()); + } return false; } } |