mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-01 14:33:21 +01:00
Add RedProtect support
This commit is contained in:
parent
3d83bfdddd
commit
bd8f2dfc19
17
pom.xml
17
pom.xml
@ -45,6 +45,10 @@
|
||||
<id>reserve-repo</id>
|
||||
<url>https://dl.bintray.com/theneweconomy/java/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>redprotect-repo</id>
|
||||
<url>https://raw.githubusercontent.com/FabioZumbi12/RedProtect/mvn-repo/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
@ -257,6 +261,19 @@
|
||||
</exclusions>
|
||||
</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>
|
||||
<groupId>com.webkonsept.bukkit.simplechestlock</groupId>
|
||||
<artifactId>simplechestlock</artifactId>
|
||||
|
@ -245,6 +245,10 @@ public class Properties {
|
||||
@ConfigurationComment("Do you want to only let people build inside GriefPrevention claims?")
|
||||
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
|
||||
@ConfigurationComment("Do you want to deny shop access to unlogged users?")
|
||||
public static boolean AUTHME_HOOK = true;
|
||||
|
@ -148,6 +148,13 @@ public class Dependencies {
|
||||
listener = new GriefPrevenentionBuilding(plugin);
|
||||
break;
|
||||
|
||||
case RedProtect:
|
||||
if (!Properties.REDPROTECT_INTEGRATION) {
|
||||
return;
|
||||
}
|
||||
listener = new RedProtectBuilding(plugin);
|
||||
break;
|
||||
|
||||
//Other plugins
|
||||
case Heroes:
|
||||
Heroes heroes = Heroes.getHeroes(plugin);
|
||||
@ -185,6 +192,7 @@ public class Dependencies {
|
||||
|
||||
WorldGuard,
|
||||
GriefPrevention,
|
||||
RedProtect,
|
||||
|
||||
Heroes,
|
||||
|
||||
|
@ -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()));
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ version: '${bukkit.plugin.version}'
|
||||
author: Acrobot
|
||||
authors: ['https://github.com/ChestShop-authors/ChestShop-3/contributors']
|
||||
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'
|
||||
|
||||
commands:
|
||||
|
Loading…
Reference in New Issue
Block a user