From d701553efeb16a90f5584c343cedd05de9a5242d Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 5 Apr 2014 13:25:34 +0200 Subject: [PATCH] Check event.getBow() != null Fixes #1933 --- .../java/com/gmail/nossr50/listeners/EntityListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index f6278bc83..a430414b6 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -31,6 +31,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.potion.PotionEffect; @@ -75,7 +76,9 @@ public class EntityListener implements Listener { return; } - if (event.getBow().containsEnchantment(Enchantment.ARROW_INFINITE)) { + ItemStack bow = event.getBow(); + + if (bow != null && bow.containsEnchantment(Enchantment.ARROW_INFINITE)) { projectile.setMetadata(mcMMO.infiniteArrowKey, mcMMO.metadataValue); }