diff options
author | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2013-06-13 17:49:21 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-06-13 22:01:50 -0500 |
commit | 930a9e805c453ff4ab924177e58fa4a5a8d70552 (patch) | |
tree | 693a2d5924216933d0cb766cf009c35631142421 /src/main/java/net | |
parent | 93c0d7e6b55d5393794decfbf5c6367c80c2ab12 (diff) | |
download | craftbukkit-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/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerConnection.java | 4 |
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: |