summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-11-16 13:46:52 -0600
committerTravis Watkins <amaranth@ubuntu.com>2012-11-16 13:46:52 -0600
commit82c8cf42341a439972dfde9bb144c004dce17fd1 (patch)
treefe21895e0cb62bb6a5f1629cffb74c6dfd146600 /src/main/java
parent6952ad1e59e4bb7fd211d6fe7ac69670c47b705a (diff)
downloadcraftbukkit-82c8cf42341a439972dfde9bb144c004dce17fd1.tar
craftbukkit-82c8cf42341a439972dfde9bb144c004dce17fd1.tar.gz
craftbukkit-82c8cf42341a439972dfde9bb144c004dce17fd1.tar.lz
craftbukkit-82c8cf42341a439972dfde9bb144c004dce17fd1.tar.xz
craftbukkit-82c8cf42341a439972dfde9bb144c004dce17fd1.zip
Update tile entity when interact event is cancelled.
If a plugin cancels a PlayerInteractEvent when left clicking a block the client may have removed this block if they are in creative mode or if the block breaks in a single hit. In this case, we need to update the client's tile entity as well as telling it the block still exists.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/ItemInWorldManager.java5
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 3baef72e..9410b4b7 100644
--- a/src/main/java/net/minecraft/server/ItemInWorldManager.java
+++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java
@@ -118,6 +118,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;
}
// CraftBukkit end