From 8933722576f8b17e35da1a104924dd9a8e0a89be Mon Sep 17 00:00:00 2001 From: galacticwarrior9 Date: Mon, 21 Oct 2024 12:54:52 +0100 Subject: [PATCH] Fix McMMOItemSpawnEvent#setItemStack being ignored in ItemUtils --- src/main/java/com/gmail/nossr50/util/ItemUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index 6dc9b2785..1e5c0c80c 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -760,7 +760,7 @@ public final class ItemUtils { return null; } - return location.getWorld().dropItem(location, itemStack); + return location.getWorld().dropItem(location, event.getItemStack()); } /** @@ -787,7 +787,7 @@ public final class ItemUtils { return null; } - return location.getWorld().dropItemNaturally(location, itemStack); + return location.getWorld().dropItemNaturally(location, event.getItemStack()); } /** @@ -841,6 +841,7 @@ public final class ItemUtils { // We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event. McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(spawnLocation, clonedItem, itemSpawnReason, player); mcMMO.p.getServer().getPluginManager().callEvent(event); + clonedItem = event.getItemStack(); //Something cancelled the event so back out if (event.isCancelled()) {