diff --git a/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java b/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java index a46ae70..b33ad60 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java @@ -20,6 +20,7 @@ import de.epiceric.shopchest.shop.Shop; import de.epiceric.shopchest.utils.Permissions; import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.Utils; +import me.ryanhamshire.GriefPrevention.Claim; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -212,7 +213,10 @@ public class ChestProtectListener implements Listener { } if (externalPluginsAllowed && plugin.hasGriefPrevention() && config.enable_griefprevention_integration) { - externalPluginsAllowed &= plugin.getGriefPrevention().allowBuild(p, b.getLocation()) == null; + Claim claim = plugin.getGriefPrevention().dataStore.getClaimAt(b.getLocation(), false, null); + if (claim != null) { + externalPluginsAllowed &= claim.allowContainers(p) == null; + } } if (externalPluginsAllowed || p.hasPermission(Permissions.EXTEND_PROTECTED)) { diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java index 84b6ee0..4beca6d 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java @@ -30,6 +30,7 @@ import de.epiceric.shopchest.utils.Permissions; import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.Utils; import fr.xephi.authme.AuthMe; +import me.ryanhamshire.GriefPrevention.Claim; import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.EconomyResponse; import org.bukkit.Bukkit; @@ -231,11 +232,15 @@ public class ShopInteractListener implements Listener { if (externalPluginsAllowed && plugin.hasGriefPrevention() && config.enable_griefprevention_integration) { plugin.debug("Checking if GriefPrevention allows shop creation..."); - String gpDenyReason = ""; + String gpDenyReason = null; for (Location loc : chestLocations) { if (loc != null) { - gpDenyReason = plugin.getGriefPrevention().allowBuild(p, loc); - externalPluginsAllowed &= gpDenyReason == null; + Claim claim = plugin.getGriefPrevention().dataStore.getClaimAt(loc, false, null); + if (claim != null) { + plugin.debug("Checking if claim allows container access"); + gpDenyReason = claim.allowContainers(p); + externalPluginsAllowed &= gpDenyReason == null; + } } }