forked from clone/WorldGuardWrapper
Bump version
This commit is contained in:
parent
b038a7b444
commit
e8680b22d8
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user