mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
fix spectral arrows bypassing pvp blocking
This commit is contained in:
parent
f98f6990ea
commit
1c487a6a60
@ -6,6 +6,7 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.FishHook;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.SpectralArrow;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -43,6 +44,14 @@ public class PVPBlocker extends FreedomService
|
||||
player = (Player)arrow.getShooter();
|
||||
}
|
||||
}
|
||||
else if (event.getDamager() instanceof SpectralArrow)
|
||||
{
|
||||
SpectralArrow spectralArrow = (SpectralArrow)event.getDamager();
|
||||
if (spectralArrow.getShooter() instanceof Player)
|
||||
{
|
||||
player = (Player)spectralArrow.getShooter();
|
||||
}
|
||||
}
|
||||
else if (event.getDamager() instanceof Trident)
|
||||
{
|
||||
Trident trident = (Trident)event.getDamager();
|
||||
@ -84,7 +93,5 @@ public class PVPBlocker extends FreedomService
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user