diff options
author | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2013-06-13 16:03:39 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-06-13 22:01:50 -0500 |
commit | 5c8498c8b73bd9bedb6aa530acb5b315ca318008 (patch) | |
tree | 8c2dfc89432ae7bc2bda26a23e56c2a4557c132e /src/main/java | |
parent | 930a9e805c453ff4ab924177e58fa4a5a8d70552 (diff) | |
download | craftbukkit-5c8498c8b73bd9bedb6aa530acb5b315ca318008.tar craftbukkit-5c8498c8b73bd9bedb6aa530acb5b315ca318008.tar.gz craftbukkit-5c8498c8b73bd9bedb6aa530acb5b315ca318008.tar.lz craftbukkit-5c8498c8b73bd9bedb6aa530acb5b315ca318008.tar.xz craftbukkit-5c8498c8b73bd9bedb6aa530acb5b315ca318008.zip |
Fix cancellation for InventoryDragEvent. Fixes BUKKIT-4332
Cancelling InventoryDragEvent causes the placed items to be lost. This is
because the cursor is set to the result prior to the event taking place,
so the items are removed from the cursor. When the event is cancelled, the
items removed from the cursor aren't placed in the inventory, and are just
lost.
This change sets the cursor back to the original cursor when the event is
cancelled.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/Container.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java index d48282cf..bb4c41aa 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -197,6 +197,8 @@ public abstract class Container { needsUpdate = true; } + } else { + playerinventory.setCarried(oldCursor); } if (needsUpdate && entityhuman instanceof EntityPlayer) { |