summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorbloodshot <jdroque@gmail.com>2014-01-06 18:02:01 -0500
committerTravis Watkins <amaranth@ubuntu.com>2014-04-18 12:52:13 -0500
commit4c9bf34bf3f7954313dd6e5f8d8b208119c115ca (patch)
tree7e6e91de88f646047a44668cdefdac8faff300fc /src/main/java/net/minecraft/server
parent5c115116ef25eadb3a5e54b4d093c2c940c7857f (diff)
downloadcraftbukkit-4c9bf34bf3f7954313dd6e5f8d8b208119c115ca.tar
craftbukkit-4c9bf34bf3f7954313dd6e5f8d8b208119c115ca.tar.gz
craftbukkit-4c9bf34bf3f7954313dd6e5f8d8b208119c115ca.tar.lz
craftbukkit-4c9bf34bf3f7954313dd6e5f8d8b208119c115ca.tar.xz
craftbukkit-4c9bf34bf3f7954313dd6e5f8d8b208119c115ca.zip
Update client stack when block place is cancelled. Fixes BUKKIT-5284
Currently, whenever a player places a block in a protected area the equipped itemstack size on client is never updated properly since the client thinks the block was placed. The reason this happens is because ItemStack.matches returns true since the server does not decrement stack size if a BlockPlaceEvent is cancelled. To correct this on cancel we set the flag to always update the client regardless of matching.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/PlayerConnection.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 9fa307ef..75a5cbe2 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -626,7 +626,9 @@ public class PlayerConnection implements PacketPlayInListener {
return;
}
- this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j());
+ if (!this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j())) {
+ always = true; // force PacketPlayOutSetSlot to be sent to client to update ItemStack count
+ }
// CraftBukkit end
flag = true;