Permalink
Browse files

Adding support for chestshop signs

  • Loading branch information...
1 parent cae1b89 commit d2c52d3774396a5bfb57ba4bfa8d417572cd82be @azatoth committed Apr 18, 2012
View
@@ -56,6 +56,11 @@
<artifactId>Regios</artifactId>
<version>5.0.3</version>
</dependency>
+ <dependency>
+ <groupId>acrobot</groupId>
+ <artifactId>ChestShop</artifactId>
+ <version>3.39</version>
+ </dependency>
</dependencies>
<repositories>
<repository>
@@ -67,6 +67,7 @@ public void onEnable() {
checkForWorldGuard();
checkForResidence();
+ checkForChestShop();
checkForRegios();
checkForLogBlock();
checkForLWC();
@@ -332,6 +333,22 @@ private void checkForResidence() {
}
}
+ private void checkForChestShop() {
+
+ PluginManager pm = getServer().getPluginManager();
+ Plugin plugin = pm.getPlugin("ChestShop");
+
+ if (plugin != null) {
+
+ log.info("[QuickSign] ChestShop detected. Features enabled.");
+ selectionHandler.setChestShop(true);
+
+ } else {
+
+ log.info("[QuickSign] No ChestShop detected. Features disabled.");
+
+ }
+ }
private void checkForRegios() {
PluginManager pm = getServer().getPluginManager();
@@ -34,6 +34,8 @@
import couk.Adamki11s.Regios.API.RegiosAPI;
import couk.Adamki11s.Regios.Regions.Region;
+import com.Acrobot.ChestShop.Utils.uSign;
+
/**
*
@@ -47,6 +49,7 @@
private WorldGuardPlugin wg = null;
private RegiosAPI regiosAPI = null;
private LWC lwc = null;
+ private boolean chestShop = false;
private boolean residence = false;
public SelectionHandler(QuickSign instance) {
@@ -79,7 +82,11 @@ public void setResidence(boolean residence) {
}
- public void handleSignSelection(PlayerInteractEvent event, Sign sign, Player player) {
+ public void setChestShop(boolean chestShop) {
+ this.chestShop = chestShop;
+ }
+
+ public void handleSignSelection(PlayerInteractEvent event, Sign sign, Player player) {
if (!plugin.getBlackList().allows(sign, player)) {
@@ -88,6 +95,16 @@ public void handleSignSelection(PlayerInteractEvent event, Sign sign, Player pla
}
+ if (chestShop) {
+ if (!plugin.hasPermissions(player, Permission.CHESTSHOP_EDIT)) {
+ if (uSign.isValid(sign)) {
+ QSUtil.tell(player,
+ "You are not allowed to edit ChestShop signs");
+ return;
+ }
+ }
+ }
+
if (checkForSelectionRights(player, sign.getBlock().getLocation())) {
if (event != null) {
@@ -35,7 +35,8 @@
PLACE_COMMAND_SIGNS("quicksign.placecommandsigns"),
PLACE_CONSOLE_COMMAND_SIGNS("quicksign.placeconcommandsigns"),
USE_SPOUT("quicksign.usespout"),
- IGNORE_BLACK_LIST("quicksign.ignoreblacklist");
+ IGNORE_BLACK_LIST("quicksign.ignoreblacklist"),
+ CHESTSHOP_EDIT("quicksign.editchestshopsigns");
//
private final String nodeString;
@@ -62,4 +62,5 @@ permissions:
description: Allows to place console command signs
quicksign.usespout:
description: Allows to use Spout GUI
-
+ quicksign.editchestshopsigns:
+ description: Allows to edit signs that are designated ChestShop signs (dangerous)

0 comments on commit d2c52d3

Please sign in to comment.