mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Merge pull request #279 from speedxx/development
fix spectral arrows bypassing pvp blocking
This commit is contained in:
commit
44fe8f6f94
@ -6,6 +6,7 @@ import org.bukkit.GameMode;
|
|||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.FishHook;
|
import org.bukkit.entity.FishHook;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.SpectralArrow;
|
||||||
import org.bukkit.entity.Trident;
|
import org.bukkit.entity.Trident;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -43,6 +44,14 @@ public class PVPBlocker extends FreedomService
|
|||||||
player = (Player)arrow.getShooter();
|
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)
|
else if (event.getDamager() instanceof Trident)
|
||||||
{
|
{
|
||||||
Trident trident = (Trident)event.getDamager();
|
Trident trident = (Trident)event.getDamager();
|
||||||
@ -84,7 +93,5 @@ public class PVPBlocker extends FreedomService
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user