mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
Fixes #220
This commit is contained in:
parent
0da524bfde
commit
41bb2c0284
@ -20,12 +20,14 @@ import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Fireball;
|
||||
import org.bukkit.entity.FishHook;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.LargeFireball;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
@ -1298,14 +1300,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
||||
else if (damager instanceof Projectile) {
|
||||
projectile = (Projectile) damager;
|
||||
//Arrow, Egg, EnderPearl, Fireball, Fish, FishHook, LargeFireball, SmallFireball, Snowball, ThrownExpBottle, ThrownPotion, WitherSkull
|
||||
if (damager instanceof Arrow || damager instanceof LargeFireball || damager instanceof Fireball || damager instanceof SmallFireball) {
|
||||
ProjectileSource shooter = projectile.getShooter();
|
||||
if (shooter == null || !(shooter instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
p = (Player) shooter;
|
||||
}
|
||||
else if (damager instanceof ThrownPotion) {
|
||||
if (damager instanceof Projectile) {
|
||||
if (damager instanceof ThrownPotion) {
|
||||
ThrownPotion potion = (ThrownPotion) damager;
|
||||
Collection<PotionEffect> effects = potion.getEffects();
|
||||
for (PotionEffect effect : effects) {
|
||||
@ -1320,6 +1316,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ProjectileSource shooter = projectile.getShooter();
|
||||
if (shooter == null || !(shooter instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
p = (Player) shooter;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user