From 13470ccf79072e40e548b615b2ff19f6b60d634f Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Sat, 7 Jan 2012 20:26:23 -0500 Subject: [PATCH] Inform the client when break events are cancelled. Thanks mrapple! --- src/main/java/net/minecraft/server/ItemInWorldManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index f0c39a424a..a1183c0ede 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -93,6 +93,8 @@ public class ItemInWorldManager { if (this.b()) { if (event.isCancelled()) { + // Let the client know the block still exists + ((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world)); return; } this.c(i, j, k); @@ -133,6 +135,8 @@ public class ItemInWorldManager { BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, i, j, k, this.player.inventory.getItemInHand(), toolDamage >= 1.0f); if (blockEvent.isCancelled()) { + // Let the client know the block still exists + ((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world)); return; } @@ -201,6 +205,8 @@ public class ItemInWorldManager { this.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { + // Let the client know the block still exists + ((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world)); return false; } }