From 43f66f6cb76bec82e9cc12c9dd3f3ca37f0f20c4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 22 Feb 2025 19:31:09 +1100 Subject: [PATCH] SPIGOT-8010: Fix handling PlayerDropItemEvent --- .../minecraft/world/inventory/Container.patch | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nms-patches/net/minecraft/world/inventory/Container.patch b/nms-patches/net/minecraft/world/inventory/Container.patch index 142068fdc..808b2dbca 100644 --- a/nms-patches/net/minecraft/world/inventory/Container.patch +++ b/nms-patches/net/minecraft/world/inventory/Container.patch @@ -167,7 +167,20 @@ } } else { int j2; -@@ -662,8 +759,9 @@ +@@ -598,7 +695,11 @@ + } + + itemstack = slot2.safeTake(k, Integer.MAX_VALUE, entityhuman); +- entityhuman.drop(itemstack, true); ++ // CraftBukkit start - SPIGOT-8010: break loop ++ if (entityhuman.drop(itemstack, true) == null) { ++ break; ++ } ++ // CraftBukkit end + entityhuman.handleCreativeModeItemDrop(itemstack); + } + } +@@ -662,8 +763,9 @@ ItemStack itemstack = this.getCarried(); if (!itemstack.isEmpty()) { @@ -178,7 +191,7 @@ } } -@@ -893,6 +991,11 @@ +@@ -893,6 +995,11 @@ } public ItemStack getCarried() {