Add RedProtect support

This commit is contained in:
Phoenix616 2020-01-15 23:44:34 +01:00
parent 3d83bfdddd
commit bd8f2dfc19
5 changed files with 56 additions and 1 deletions

17
pom.xml
View File

@ -45,6 +45,10 @@
<id>reserve-repo</id> <id>reserve-repo</id>
<url>https://dl.bintray.com/theneweconomy/java/</url> <url>https://dl.bintray.com/theneweconomy/java/</url>
</repository> </repository>
<repository>
<id>redprotect-repo</id>
<url>https://raw.githubusercontent.com/FabioZumbi12/RedProtect/mvn-repo/</url>
</repository>
<repository> <repository>
<id>jitpack.io</id> <id>jitpack.io</id>
<url>https://jitpack.io</url> <url>https://jitpack.io</url>
@ -257,6 +261,19 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
<artifactId>RedProtect-Spigot</artifactId>
<version>7.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
<artifactId>RedProtect-Core</artifactId>
<version>7.6.2</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>com.webkonsept.bukkit.simplechestlock</groupId> <groupId>com.webkonsept.bukkit.simplechestlock</groupId>
<artifactId>simplechestlock</artifactId> <artifactId>simplechestlock</artifactId>

View File

@ -245,6 +245,10 @@ public class Properties {
@ConfigurationComment("Do you want to only let people build inside GriefPrevention claims?") @ConfigurationComment("Do you want to only let people build inside GriefPrevention claims?")
public static boolean GRIEFPREVENTION_INTEGRATION = false; public static boolean GRIEFPREVENTION_INTEGRATION = false;
@PrecededBySpace
@ConfigurationComment("Do you want to only let people build inside RedProtect regions?")
public static boolean REDPROTECT_INTEGRATION = false;
@PrecededBySpace @PrecededBySpace
@ConfigurationComment("Do you want to deny shop access to unlogged users?") @ConfigurationComment("Do you want to deny shop access to unlogged users?")
public static boolean AUTHME_HOOK = true; public static boolean AUTHME_HOOK = true;

View File

@ -148,6 +148,13 @@ public class Dependencies {
listener = new GriefPrevenentionBuilding(plugin); listener = new GriefPrevenentionBuilding(plugin);
break; break;
case RedProtect:
if (!Properties.REDPROTECT_INTEGRATION) {
return;
}
listener = new RedProtectBuilding(plugin);
break;
//Other plugins //Other plugins
case Heroes: case Heroes:
Heroes heroes = Heroes.getHeroes(plugin); Heroes heroes = Heroes.getHeroes(plugin);
@ -185,6 +192,7 @@ public class Dependencies {
WorldGuard, WorldGuard,
GriefPrevention, GriefPrevention,
RedProtect,
Heroes, Heroes,

View File

@ -0,0 +1,26 @@
package com.Acrobot.ChestShop.Plugins;
import br.net.fabiozumbi12.RedProtect.Bukkit.RedProtect;
import br.net.fabiozumbi12.RedProtect.Bukkit.Region;
import com.Acrobot.ChestShop.Events.Protection.BuildPermissionEvent;
import me.ryanhamshire.GriefPrevention.GriefPrevention;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
/**
* @author Acrobot
*/
public class RedProtectBuilding implements Listener {
private RedProtect redProtect;
public RedProtectBuilding(Plugin plugin) {
this.redProtect = (RedProtect) plugin;
}
@EventHandler
public void canBuild(BuildPermissionEvent event) {
Region region = redProtect.getAPI().getRegion(event.getSign());
event.allow(region != null && region.canBuild(event.getPlayer()));
}
}

View File

@ -4,7 +4,7 @@ version: '${bukkit.plugin.version}'
author: Acrobot author: Acrobot
authors: ['https://github.com/ChestShop-authors/ChestShop-3/contributors'] authors: ['https://github.com/ChestShop-authors/ChestShop-3/contributors']
description: A chest shop for economy plugins. description: A chest shop for economy plugins.
softdepend: [Vault, Reserve, LWC, Lockette, Deadbolt, OddItem, WorldGuard, GriefPrevention, Heroes, SimpleChestLock, Residence, ShowItem] softdepend: [Vault, Reserve, LWC, Lockette, Deadbolt, OddItem, WorldGuard, GriefPrevention, RedProtect, Heroes, SimpleChestLock, Residence, ShowItem]
api-version: '1.13' api-version: '1.13'
commands: commands: