mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-15 07:05:51 +01:00
Ensure projectile source exists, fixes #369
This commit is contained in:
parent
1d04d263d7
commit
1bac3ed1f3
@ -58,7 +58,6 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
@ -465,10 +464,9 @@ public class PlayerListener implements Listener {
|
||||
if (damager != null) {
|
||||
if (damager instanceof Projectile) {
|
||||
Projectile projectile = (Projectile) damager;
|
||||
ProjectileSource source = projectile.getShooter();
|
||||
if (source instanceof Entity) {
|
||||
killMob((Entity)source, evt.getEntity());
|
||||
}
|
||||
if (projectile.getShooter() != null && projectile.getShooter() instanceof Entity) {
|
||||
killMob((Entity)projectile.getShooter(), evt.getEntity());
|
||||
}
|
||||
} else if (damager instanceof TNTPrimed) {
|
||||
TNTPrimed tnt = (TNTPrimed) damager;
|
||||
Entity source = tnt.getSource();
|
||||
@ -535,9 +533,8 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
if (damager instanceof Projectile) {
|
||||
Projectile projectile = (Projectile) damager;
|
||||
ProjectileSource source = projectile.getShooter();
|
||||
if (source instanceof Entity) {
|
||||
killPlayer((Entity)source, evt.getEntity());
|
||||
if (projectile.getShooter() != null && projectile.getShooter() instanceof Entity) {
|
||||
killPlayer((Entity)projectile.getShooter(), evt.getEntity());
|
||||
}
|
||||
} else if (damager instanceof TNTPrimed) {
|
||||
TNTPrimed tnt = (TNTPrimed) damager;
|
||||
|
Loading…
Reference in New Issue
Block a user