diff --git a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java index c49367079..19f47723d 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java @@ -151,12 +151,17 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { return; } Claim claim = event.getClaim(); + if (event.getClaim().getOwnerID() == null) { + return; + } for (Chunk chunk : claim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null && !shops.isEmpty()) { for (Shop shop : shops.values()) { if (griefPrevention.dataStore.getClaimAt(shop.getLocation(), true, true, null) == null) { - shop.delete(); + if (event.getClaim().getOwnerID().equals(shop.getOwner())) { + shop.delete(); + } } } } @@ -168,13 +173,18 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { if (!deleteOnClaimExpired) { return; } + if (event.getClaim().getOwnerID() == null) { + return; + } Claim claim = event.getClaim(); for (Chunk chunk : claim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null && !shops.isEmpty()) { for (Shop shop : shops.values()) { if (griefPrevention.dataStore.getClaimAt(shop.getLocation(), true, true, null) == null) { - shop.delete(); + if (event.getClaim().getOwnerID().equals(shop.getOwner())) { + shop.delete(); + } } } }