summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2012-01-07 20:26:23 -0500
committerEvilSeph <evilseph@gmail.com>2012-01-07 20:26:23 -0500
commit13470ccf79072e40e548b615b2ff19f6b60d634f (patch)
treef7f06cacd8ad05785217dcf9f0ea86a3dd146f33 /src/main/java/net/minecraft/server
parent86fef037e02b8a954e4b6d7027dbcc1675eec5dd (diff)
downloadcraftbukkit-13470ccf79072e40e548b615b2ff19f6b60d634f.tar
craftbukkit-13470ccf79072e40e548b615b2ff19f6b60d634f.tar.gz
craftbukkit-13470ccf79072e40e548b615b2ff19f6b60d634f.tar.lz
craftbukkit-13470ccf79072e40e548b615b2ff19f6b60d634f.tar.xz
craftbukkit-13470ccf79072e40e548b615b2ff19f6b60d634f.zip
Inform the client when break events are cancelled. Thanks mrapple!
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/ItemInWorldManager.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java
index f0c39a42..a1183c0e 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;
}
}