mirror of
https://github.com/CodeMC/WorldGuardWrapper.git
synced 2024-11-10 13:15:19 +01:00
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.block.UseBlockEvent;
|
||||||
import com.sk89q.worldguard.bukkit.event.entity.DamageEntityEvent;
|
import com.sk89q.worldguard.bukkit.event.entity.DamageEntityEvent;
|
||||||
import com.sk89q.worldguard.bukkit.event.entity.UseEntityEvent;
|
import com.sk89q.worldguard.bukkit.event.entity.UseEntityEvent;
|
||||||
|
import com.sk89q.worldguard.protection.events.DisallowedPVPEvent;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>org.codemc.worldguardwrapper</groupId>
|
<groupId>org.codemc.worldguardwrapper</groupId>
|
||||||
<artifactId>worldguardwrapper-parent</artifactId>
|
<artifactId>worldguardwrapper-parent</artifactId>
|
||||||
<version>1.0.2-SNAPSHOT</version>
|
<version>1.0.3-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user