From da08868206677a3e198725fc62aed4936b50cc20 Mon Sep 17 00:00:00 2001 From: cnr Date: Thu, 13 Jul 2017 18:02:39 -0700 Subject: [PATCH] Fix ClassCastException in HitQuestTracker --- .../src/nautilus/game/arcade/quest/HitQuestTracker.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java index 71070aaf1..665657a3d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java @@ -1,13 +1,10 @@ package nautilus.game.arcade.quest; -import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.ProjectileHitEvent; -import mineplex.core.common.util.UtilItem; import mineplex.core.quests.TriggerType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -31,14 +28,14 @@ public class HitQuestTracker extends QuestTracker { if (!getGame().IsLive()) return; - - if (!(event.getEntity() instanceof Player)) + + if (!(event.getDamager() instanceof Player) || !(event.getEntity() instanceof Item)) return; Item itemEntity = (Item) event.getEntity(); String item = itemEntity.getItemStack().getType().toString(); - + incrementQuests((Player) event.getDamager(), 1, "Player", item, getGame().GetKit((Player) event.getDamager()).GetName() + "Kit"); }