ソースを参照

Making it impossible to attempt to drop air.

Glitchfinder 12 年 前
コミット
75e52bbe66
1 ファイル変更4 行追加2 行削除
  1. 4 2
      src/main/java/com/gmail/nossr50/util/Misc.java

+ 4 - 2
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);