mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-03 22:12:18 +01:00
Made WorldGuard check to see if both the attacker & defender are in a pvp area.
This commit is contained in:
parent
6802a7d747
commit
01f9fd561d
@ -289,9 +289,10 @@ private void onEntityDamageByEntity(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