mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-12 13:43:57 +01:00
NPCs killable with projectiles, fixes #1940
This commit is contained in:
parent
2d3592a89c
commit
939b6b8f63
@ -292,9 +292,8 @@ public class NpcListener implements Listener {
|
||||
final ObjectiveType type = ObjectiveType.KILL_NPC;
|
||||
final Set<String> dispatchedQuestIDs = new HashSet<>();
|
||||
Player player = null;
|
||||
if (damager instanceof Projectile
|
||||
&& evt.getNPC().getEntity().getLastDamageCause().getEntity() instanceof Player) {
|
||||
player = (Player) evt.getNPC().getEntity().getLastDamageCause().getEntity();
|
||||
if (damager instanceof Projectile && ((Projectile)damageEvent.getDamager()).getShooter() instanceof Player) {
|
||||
player = (Player) ((Projectile)damageEvent.getDamager()).getShooter();
|
||||
} else if (damager instanceof Player) {
|
||||
player = (Player) damager;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user