summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNate Mortensen <nate.richard.mortensen@gmail.com>2013-06-13 17:49:21 -0600
committerWesley Wolfe <weswolf@aol.com>2013-06-13 22:01:50 -0500
commit930a9e805c453ff4ab924177e58fa4a5a8d70552 (patch)
tree693a2d5924216933d0cb766cf009c35631142421 /src
parent93c0d7e6b55d5393794decfbf5c6367c80c2ab12 (diff)
downloadcraftbukkit-930a9e805c453ff4ab924177e58fa4a5a8d70552.tar
craftbukkit-930a9e805c453ff4ab924177e58fa4a5a8d70552.tar.gz
craftbukkit-930a9e805c453ff4ab924177e58fa4a5a8d70552.tar.lz
craftbukkit-930a9e805c453ff4ab924177e58fa4a5a8d70552.tar.xz
craftbukkit-930a9e805c453ff4ab924177e58fa4a5a8d70552.zip
Correct cancellation of InventoryClickEvent. Fixes BUKKIT-4331
Cancelling an InventoryClickEvent for a single click causes the click not to be processed by the clicked inventory. The server then doesn't correctly identify their second click as being a double click, causing an inconsistency between what the Player believes the inventory to be and what the server believes the inventory to be. This change forces an updateInventory call whenever an InventoryClickEvent whose action is NOTHING is cancelled. Both clicks are considered PICKUP_ALL, so updating the inventory after the second click fixes any inconsistencies that could arise between the client and the server.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/PlayerConnection.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index f1c2d482..018c314f 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1287,7 +1287,7 @@ public class PlayerConnection extends Connection {
action = InventoryAction.CLONE_STACK;
} else {
action = InventoryAction.NOTHING;
- }
+ }
}
} else {
click = ClickType.UNKNOWN;
@@ -1376,6 +1376,7 @@ public class PlayerConnection extends Connection {
}*/
switch (action) {
// Modified other slots
+ case PICKUP_ALL:
case MOVE_TO_OTHER_INVENTORY:
case HOTBAR_MOVE_AND_READD:
case HOTBAR_SWAP:
@@ -1384,7 +1385,6 @@ public class PlayerConnection extends Connection {
this.player.updateInventory(this.player.activeContainer);
break;
// Modified cursor and clicked
- case PICKUP_ALL:
case PICKUP_SOME:
case PICKUP_HALF:
case PICKUP_ONE: