Skip to content

Commit

Permalink
Fix McMMOItemSpawnEvent#setItemStack being ignored in ItemUtils (mcMM…
Browse files Browse the repository at this point in the history
  • Loading branch information
galacticwarrior9 authored Nov 17, 2024
1 parent 91ab569 commit a93f08a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/gmail/nossr50/util/ItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ public static void spawnItems(@Nullable Player player,
return null;
}

return location.getWorld().dropItem(location, itemStack);
return location.getWorld().dropItem(location, event.getItemStack());
}

/**
Expand All @@ -791,7 +791,7 @@ public static void spawnItems(@Nullable Player player,
return null;
}

return location.getWorld().dropItemNaturally(location, itemStack);
return location.getWorld().dropItemNaturally(location, event.getItemStack());
}

/**
Expand Down Expand Up @@ -845,6 +845,7 @@ public static void spawnItemsTowardsLocation(@Nullable Player player,
// 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()) {
Expand Down

0 comments on commit a93f08a

Please sign in to comment.