mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +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 (attacker != null && attacker instanceof Player) {
|
||||||
if (wcfg.useRegions) {
|
if (wcfg.useRegions) {
|
||||||
Vector pt = toVector(defender.getLocation());
|
Vector pt = toVector(defender.getLocation());
|
||||||
|
Vector pt2 = toVector(attacker.getLocation());
|
||||||
RegionManager mgr = plugin.getGlobalRegionManager().get(player.getWorld());
|
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.");
|
((Player) attacker).sendMessage(ChatColor.DARK_RED + "You are in a no-PvP area.");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user