mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 02:27:42 +01:00
Fixes shooting onto pvp areas from nopvp areas
This commit is contained in:
parent
d9e5fc2b60
commit
27ffdec323
@ -366,9 +366,10 @@ private void onEntityDamageByProjectile(EntityDamageByEntityEvent event) {
|
||||
if (attacker != null && attacker instanceof Player) {
|
||||
if (wcfg.useRegions) {
|
||||
Vector pt = toVector(defender.getLocation());
|
||||
Vector pt2 = toVector(attacker.getLocation());
|
||||
RegionManager mgr = plugin.getGlobalRegionManager().get(player.getWorld());
|
||||
|
||||
if (!mgr.getApplicableRegions(pt).allows(DefaultFlag.PVP)) {
|
||||
if (!mgr.getApplicableRegions(pt).allows(DefaultFlag.PVP) || !mgr.getApplicableRegions(pt2).allows(DefaultFlag.PVP)) {
|
||||
((Player) attacker).sendMessage(ChatColor.DARK_RED + "You are in a no-PvP area.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user