Fix cursor item dropping when drop event is cancelled

This commit is contained in:
Felix Cravic 2020-05-17 11:44:34 +02:00
parent dff29a4717
commit f588d1103f

View File

@ -952,7 +952,10 @@ public class Player extends LivingEntity {
cursorItem = openInventory.getCursorItem(this);
}
if (!cursorItem.isAir()) {
dropItem(cursorItem);
// Add item to inventory if he hasn't been able to drop it
if (!dropItem(cursorItem)) {
getInventory().addItemStack(cursorItem);
}
}
CloseWindowPacket closeWindowPacket = new CloseWindowPacket();