Bump version

This commit is contained in:
Gabriele C 2018-11-04 12:33:10 +01:00
parent b038a7b444
commit e8680b22d8
2 changed files with 17 additions and 1 deletions

View File

@ -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);
}
}
}

View File

@ -6,7 +6,7 @@
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.0.2-SNAPSHOT</version>
<version>1.0.3-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>