mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
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.
This commit is contained in:
parent
930a9e805c
commit
5c8498c8b7
@ -197,6 +197,8 @@ public abstract class Container {
|
||||
needsUpdate = true;
|
||||
|
||||
}
|
||||
} else {
|
||||
playerinventory.setCarried(oldCursor);
|
||||
}
|
||||
|
||||
if (needsUpdate && entityhuman instanceof EntityPlayer) {
|
||||
|
Loading…
Reference in New Issue
Block a user