diff --git a/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/EventListener.java b/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/EventListener.java
index 04841da..7af62b1 100644
--- a/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/EventListener.java
+++ b/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/EventListener.java
@@ -3,6 +3,7 @@ package org.codemc.worldguardwrapper.implementation.v6;
import com.sk89q.worldguard.bukkit.event.block.UseBlockEvent;
import com.sk89q.worldguard.bukkit.event.entity.DamageEntityEvent;
import com.sk89q.worldguard.bukkit.event.entity.UseEntityEvent;
+import com.sk89q.worldguard.protection.events.DisallowedPVPEvent;
import lombok.NoArgsConstructor;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -80,4 +81,19 @@ public class EventListener implements Listener {
}
}
+ @EventHandler
+ public void onDisallowedPVP(DisallowedPVPEvent worldGuardEvent) {
+ AbstractWrappedEvent event = new org.codemc.worldguardwrapper.event.DisallowedPVPEvent(
+ worldGuardEvent.getAttacker(),
+ worldGuardEvent.getDefender(),
+ worldGuardEvent.getCause());
+ Bukkit.getServer().getPluginManager().callEvent(event);
+
+ if (event.getResult() != Result.DEFAULT) {
+ // DEFAULT = Result probably has not been touched by the handler,
+ // so don't touch the original result either.
+ worldGuardEvent.setCancelled(event.getResult() == Result.DENY);
+ }
+ }
+
}
diff --git a/pom.xml b/pom.xml
index f37c2c1..d6b8fba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.codemc.worldguardwrapper
worldguardwrapper-parent
- 1.0.2-SNAPSHOT
+ 1.0.3-SNAPSHOT
pom