From 75e52bbe66aafe5362095a030c01f2fb74a9e168 Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Mon, 14 Jan 2013 11:31:11 -0800 Subject: [PATCH] Making it impossible to attempt to drop air. --- src/main/java/com/gmail/nossr50/util/Misc.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index c2080333d..1c0fa2fcb 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -281,13 +281,15 @@ public class Misc { */ public static void dropItem(Location location, ItemStack itemStack) { + if(itemStack.getType() == Material.AIR) + return; + // 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(location, itemStack); mcMMO.p.getServer().getPluginManager().callEvent(event); - if (event.isCancelled()) { + if (event.isCancelled()) return; - } Item newItem = location.getWorld().dropItemNaturally(location, itemStack);