Added griefdefender support
This commit is contained in:
parent
8e0643e59c
commit
621e98dc96
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>randomteleport-plugin-hooks</artifactId>
|
||||
<groupId>de.themoep.randomteleport.pluginhook</groupId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>griefdefender</artifactId>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.bloodmc</groupId>
|
||||
<artifactId>GriefDefenderAPI</artifactId>
|
||||
<version>-dd5aa2224c-1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
package de.themoep.randomteleport.hook.plugin;
|
||||
|
||||
import com.griefdefender.api.GriefDefender;
|
||||
import com.griefdefender.api.claim.ClaimTypes;
|
||||
import de.themoep.randomteleport.hook.ProtectionHook;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class GriefDefenderHook implements ProtectionHook {
|
||||
|
||||
@Override
|
||||
public Plugin getPlugin() {
|
||||
return Bukkit.getPluginManager().getPlugin("GriefDefender");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "GriefDefender";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBuild(Player player, Location location) {
|
||||
return GriefDefender.getCore().getClaimManager(location.getWorld().getUID()).getClaimAt(location.getBlockX(), location.getBlockY(), location.getBlockZ()).getType() == ClaimTypes.WILDERNESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBuild(Player player, World world, int chunkX, int chunkZ) {
|
||||
if(GriefDefender.getCore().isEnabled(world.getUID())) {
|
||||
return GriefDefender.getCore().getClaimManager(world.getUID()).getClaimAt(chunkX,0,chunkZ).isTrusted(player.getUniqueId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@
|
|||
<module>worldguard-6</module>
|
||||
<module>worldguard-7</module>
|
||||
<module>griefprevention</module>
|
||||
<module>griefdefender</module>
|
||||
<module>redprotect</module>
|
||||
<module>factions</module>
|
||||
<module>factions-uuid</module>
|
||||
|
|
Loading…
Reference in New Issue