From 6192ca7fe80235919b43cce576783df9642548d5 Mon Sep 17 00:00:00 2001 From: 1171066 <1171066@isep.ipp.pt> Date: Mon, 26 Jul 2021 19:30:53 +0100 Subject: [PATCH 1/9] Big improvements to the Grief Prevention Integration. Fixed some bugs. Refactored some things. --- .../org/maxgamer/quickshop/QuickShop.java | 4 +- .../GriefPreventionIntegration.java | 344 +++++++++++------- src/main/resources/config.yml | 4 +- 3 files changed, 216 insertions(+), 136 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 4584ca2b9..fb06e16ab 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1834,7 +1834,7 @@ public class QuickShop extends JavaPlugin { } if (selectedVersion == 128) { getConfig().set("shop.force-use-item-original-name", false); - getConfig().set("integration.griefprevention.delete-on-untrusted", false); + getConfig().set("integration.griefprevention.delete-on-claim-untrusted", false); getConfig().set("config-version", ++selectedVersion); } @@ -1860,7 +1860,7 @@ public class QuickShop extends JavaPlugin { getConfig().set("config-version", ++selectedVersion); } if (selectedVersion == 133) { - getConfig().set("integration.griefprevention.delete-on-unclaim", false); + getConfig().set("integration.griefprevention.delete-on-claim-unclaimed", false); getConfig().set("integration.griefprevention.delete-on-claim-expired", false); getConfig().set("config-version", ++selectedVersion); } 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 ee34782e6..cfaf468d4 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java @@ -24,6 +24,8 @@ import me.ryanhamshire.GriefPrevention.GriefPrevention; import me.ryanhamshire.GriefPrevention.events.ClaimDeletedEvent; import me.ryanhamshire.GriefPrevention.events.ClaimExpirationEvent; import me.ryanhamshire.GriefPrevention.events.ClaimModifiedEvent; +import me.ryanhamshire.GriefPrevention.events.TrustChangedEvent; +import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; @@ -43,25 +45,223 @@ import java.util.Map; @IntegrationStage(loadStage = IntegrateStage.onEnableAfter) public class GriefPreventionIntegration extends QSIntegratedPlugin { + final GriefPrevention griefPrevention = GriefPrevention.instance; - private final List createLimits = new ArrayList<>(3); - private final List tradeLimits = new ArrayList<>(3); + private final boolean whiteList; - private final boolean deleteOnUntrusted; - private final boolean deleteOnUnclaim; + + private final boolean deleteOnClaimUntrusted; + + private final boolean deleteOnClaimUnclaimed; + private final boolean deleteOnClaimExpired; + private final boolean deleteOnClaimResized; + private final List createLimits = new ArrayList<>(3); + + private final List tradeLimits = new ArrayList<>(3); + public GriefPreventionIntegration(QuickShop plugin) { super(plugin); ConfigurationSection configurationSection = plugin.getConfig(); this.whiteList = configurationSection.getBoolean("integration.griefprevention.whitelist-mode"); - deleteOnUntrusted = configurationSection.getBoolean("integration.griefprevention.delete-on-untrusted"); - deleteOnUnclaim = configurationSection.getBoolean("integration.griefprevention.delete-on-unclaim"); - deleteOnClaimExpired = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-expired"); - deleteOnClaimResized = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-resized"); - createLimits.addAll(toFlags(configurationSection.getStringList("integration.griefprevention.create"))); - tradeLimits.addAll(toFlags(configurationSection.getStringList("integration.griefprevention.trade"))); + this.deleteOnClaimUntrusted = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-untrusted"); + this.deleteOnClaimUnclaimed = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-unclaimed"); + this.deleteOnClaimExpired = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-expired"); + this.deleteOnClaimResized = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-resized"); + this.createLimits.addAll(toFlags(configurationSection.getStringList("integration.griefprevention.create"))); + this.tradeLimits.addAll(toFlags(configurationSection.getStringList("integration.griefprevention.trade"))); + } + + @Override + public @NotNull String getName() { + return "GriefPrevention"; + } + + @Override + public void load() { + registerListener(); + } + + @Override + public void unload() { + unregisterListener(); + } + + @Override + public boolean canCreateShopHere(@NotNull Player player, @NotNull Location location) { + return checkPermission(player, location, createLimits); + } + + @Override + public boolean canTradeShopHere(@NotNull Player player, @NotNull Location location) { + return checkPermission(player, location, tradeLimits); + } + + // When player changes trust, we will check if the shops there will be deleted or not. + // We will not delete the shops of the claim owner. + // The shops will be deleted if the shop owner doesn't have anymore permission to create a shop there. + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onClaimUntrusted(TrustChangedEvent event) { + if (!deleteOnClaimUntrusted) { + return; + } + for (Claim claim : event.getClaims()) { + for (Chunk chunk : claim.getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (!shop.getOwner().equals(claim.getOwnerID())) { + Claim shopClaim = griefPrevention.dataStore.getClaimAt(shop.getLocation(), false, false, null); + if (shopClaim != null && + shopClaim.getID().equals(claim.getID()) && + !hasPermissionClaim(shopClaim, Bukkit.getPlayer(shop.getOwner()), createLimits)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (Untrusted) #" + shop.getOwner()); + shop.delete(); + } + } + } + } + } + } + } + + // Player can unclaim the main claim or the subclaim. + // So we need to call either the handleMainClaimUnclaimedOrExpired or the handleSubClaimUnclaimed method. + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onClaimUnclaimed(ClaimDeletedEvent event) { + if (!deleteOnClaimUnclaimed) { + return; + } + if (event.getClaim().parent == null) { + handleMainClaimUnclaimedOrExpired(event.getClaim(), "[SHOP DELETE] GP Integration: Single delete (Claim Unclaimed) #"); + } else { + handleSubClaimUnclaimed(event.getClaim(), event.getClaim().parent); + } + } + + // Since only the main claim expires, we will call the handleMainClaimUnclaimedOrExpired method. + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onClaimExpired(ClaimExpirationEvent event) { + if (!deleteOnClaimExpired) { + return; + } + handleMainClaimUnclaimedOrExpired(event.getClaim(),"[SHOP DELETE] GP Integration: Single delete (Claim Expired) #"); + } + + // Player can resize the main claim or the subclaim. + // So we need to call either the handleMainClaimResized or the handleSubClaimResized method. + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onClaimResized(ClaimModifiedEvent event) { + if (!deleteOnClaimResized) { + return; + } + Claim oldClaim = event.getFrom(); + Claim newClaim = event.getTo(); + if (oldClaim.parent == null) { + handleMainClaimResized(oldClaim, newClaim); + } else { + handleSubClaimResized(oldClaim, newClaim, oldClaim.parent); + } + } + + // If it is the main claim, then we will delete all shops that were inside of it. + private void handleMainClaimUnclaimedOrExpired(Claim claim, String logMessage) { + for (Chunk chunk : claim.getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (claim.contains(shop.getLocation(), false, false)) { + plugin.log(logMessage + shop.getOwner()); + shop.delete(); + } + } + } + } + } + + // If it is a subclaim, then we will not remove the shops of the main claim owner. + // Also, we will not remove the shops of the players that have permission to build shops in the main claim. + private void handleSubClaimUnclaimed(Claim subClaim, Claim mainClaim) { + for (Chunk chunk : subClaim.getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (subClaim.contains(shop.getLocation(), false, false)) { + if (!shop.getOwner().equals(mainClaim.getOwnerID()) && + !hasPermissionClaim(mainClaim, Bukkit.getPlayer(shop.getOwner()), createLimits)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Unclaimed) #" + shop.getOwner()); + shop.delete(); + } + } + } + } + } + } + + // If it is a main claim, then we will remove the shop if the main claim was resized (size was decreased). + // The shop will be removed if the old claim contains the shop but the new claim doesn't have it. + private void handleMainClaimResized(Claim oldClaim, Claim newClaim) { + for (Chunk chunk : oldClaim.getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (oldClaim.contains(shop.getLocation(), false, false) && + !newClaim.contains(shop.getLocation(), false, false)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim Resized) #" + shop.getOwner()); + shop.delete(); + } + } + } + } + } + + // If it is a subclaim, then we will remove the shops in 2 situations. + // We will never remove shops of the claim owner. + // We will remove the shop if the shop is now outside the subclaim and the shop owner doesn't have permission in the main claim. + // We will remove the shop if the shop is now inside the subclaim and the shop owner doesn't have permission in the subclaim. + private void handleSubClaimResized(Claim oldClaim, Claim newClaim, Claim mainClaim) { + handleSubClaimResizedHelper(oldClaim, newClaim, mainClaim); + handleSubClaimResizedHelper(newClaim, oldClaim, newClaim); + } + + private void handleSubClaimResizedHelper(Claim claimVerifyChunks, Claim claimVerifyShop, Claim claimPermissionCheck) { + for (Chunk chunk : claimVerifyChunks.getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (!shop.getOwner().equals(claimVerifyChunks.getOwnerID())) { + if (claimVerifyChunks.contains(shop.getLocation(), false, false) && + !claimVerifyShop.contains(shop.getLocation(), false, false) && + !hasPermissionClaim(claimPermissionCheck, Bukkit.getPlayer(shop.getOwner()), createLimits)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Resized) #" + shop.getOwner()); + shop.delete(); + } + } + } + } + } + } + + private boolean checkPermission(@NotNull Player player, @NotNull Location location, List limits) { + if (!griefPrevention.claimsEnabledForWorld(location.getWorld())) { + return true; + } + Claim claim = griefPrevention.dataStore.getClaimAt(location, false, griefPrevention.dataStore.getPlayerData(player.getUniqueId()).lastClaim); + if (claim == null) { + return !whiteList; + } + return hasPermissionClaim(claim, player, limits); + } + + private boolean hasPermissionClaim(@NotNull Claim claim, Player player, List limits) { + for (Flag flag : limits) { + if (!flag.check(claim, player)) { + return false; + } + } + return true; } private List toFlags(List flags) { @@ -75,129 +275,8 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { return result; } - @Override - public @NotNull String getName() { - return "GriefPrevention"; - } - - @Override - public boolean canCreateShopHere(@NotNull Player player, @NotNull Location location) { - return checkPermission(player, location, createLimits); - - } - - @Override - public boolean canTradeShopHere(@NotNull Player player, @NotNull Location location) { - return checkPermission(player, location, tradeLimits); - } - - private boolean checkPermission(@NotNull Player player, @NotNull Location location, List limits) { - if (!griefPrevention.claimsEnabledForWorld(location.getWorld())) { - return true; - } - Claim claim = griefPrevention.dataStore.getClaimAt(location, false, griefPrevention.dataStore.getPlayerData(player.getUniqueId()).lastClaim); - if (claim == null) { - return !whiteList; - } - for (Flag flag : limits) { - if (!flag.check(claim, player)) { - return false; - } - } - return true; - } - - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onUntrusted(me.ryanhamshire.GriefPrevention.events.TrustChangedEvent event) { - if (!deleteOnUntrusted) { - return; - } - for (Claim claim : event.getClaims()) { - for (Chunk chunk : claim.getChunks()) { - Map shops = plugin.getShopManager().getShops(chunk); - if (shops != null) { - for (Shop shop : shops.values()) { - if (!shop.getOwner().equals(claim.getOwnerID())) { - - Claim shopClaim = griefPrevention.dataStore.getClaimAt(shop.getLocation(), true, false, null); - if(shopClaim != null && shopClaim.getID() == claim.getID()) { - - if(event.getIdentifier().equals(shop.getOwner().toString())) { - plugin.log("[SHOP DELETE] GP Integration: Single delete #" + event.getIdentifier()); - shop.delete(); - } else if(event.getIdentifier().contains(shop.getOwner().toString())) { - plugin.log("[SHOP DELETE] GP Integration: Group delete #" + event.getIdentifier()); - shop.delete(); - } else if("all".equals(event.getIdentifier()) || "public".equals(event.getIdentifier())) { - plugin.log("[SHOP DELETE] GP Integration: All/Public delete #" + event.getIdentifier()); - shop.delete(); - } - } - } - } - } - } - } - } - - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onClaimUnclaimed(ClaimDeletedEvent event) { - onUnclaimOrExpiredHelper(event.getClaim(), deleteOnUnclaim); - } - - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onClaimExpired(ClaimExpirationEvent event) { - onUnclaimOrExpiredHelper(event.getClaim(), deleteOnClaimExpired); - } - - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onClaimResized(ClaimModifiedEvent event) { - if (!deleteOnClaimResized) { - return; - } - Claim oldClaim = event.getFrom(); - Claim newClaim = event.getTo(); - for (Chunk chunk : oldClaim.getChunks()) { - Map shops = plugin.getShopManager().getShops(chunk); - if (shops != null) { - for (Shop shop : shops.values()) { - if (oldClaim.contains(shop.getLocation(), true, false) && !newClaim.contains(shop.getLocation(), true, false)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (Resized) #" + shop.getOwner()); - shop.delete(); - } - } - } - } - } - - private void onUnclaimOrExpiredHelper(Claim claim, boolean configSectionBoolean) { - if (!configSectionBoolean) { - return; - } - for (Chunk chunk : claim.getChunks()) { - Map shops = plugin.getShopManager().getShops(chunk); - if (shops != null) { - for (Shop shop : shops.values()) { - if (claim.contains(shop.getLocation(), true, false)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (Unclaimed/Expired) #" + shop.getOwner()); - shop.delete(); - } - } - } - } - } - - @Override - public void load() { - this.registerListener(); - } - - @Override - public void unload() { - this.unregisterListener(); - } - enum Flag { + BUILD { @Override boolean check(Claim claim, Player player) { @@ -227,4 +306,5 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { abstract boolean check(Claim claim, Player player); } + } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 2d2604b2a..b4b0e7fad 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -692,9 +692,9 @@ integration: #ACCESS = The Player must have the ability to access the target claim. trade: [ ] #Should QuickShop delete shops if the shop owner has been untrusted on the claim? - delete-on-untrusted: true + delete-on-claim-untrusted: true #Should QuickShop delete shops if claim has been deleted? - delete-on-unclaim: true + delete-on-claim-unclaimed: true #Should QuickShop delete shops if claim has been expired? delete-on-claim-expired: true #Should QuickShop delete shops if claim has been resized (claim has become smaller and the shop is now outside claim)? From a43abea5279d0619d9b48261bd1a514a8e2e0790 Mon Sep 17 00:00:00 2001 From: 1171066 <1171066@isep.ipp.pt> Date: Tue, 27 Jul 2021 05:19:13 +0100 Subject: [PATCH 2/9] Deleted some features/validation because of some problems found. --- .../org/maxgamer/quickshop/QuickShop.java | 2 +- .../GriefPreventionIntegration.java | 89 +++++++++---------- src/main/resources/config.yml | 19 ++-- 3 files changed, 57 insertions(+), 53 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index fb06e16ab..eb4f0c306 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1834,7 +1834,7 @@ public class QuickShop extends JavaPlugin { } if (selectedVersion == 128) { getConfig().set("shop.force-use-item-original-name", false); - getConfig().set("integration.griefprevention.delete-on-claim-untrusted", false); + getConfig().set("integration.griefprevention.delete-on-claim-trust-changed", false); getConfig().set("config-version", ++selectedVersion); } 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 cfaf468d4..33bae871e 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java @@ -25,7 +25,6 @@ import me.ryanhamshire.GriefPrevention.events.ClaimDeletedEvent; import me.ryanhamshire.GriefPrevention.events.ClaimExpirationEvent; import me.ryanhamshire.GriefPrevention.events.ClaimModifiedEvent; import me.ryanhamshire.GriefPrevention.events.TrustChangedEvent; -import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; @@ -50,7 +49,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { private final boolean whiteList; - private final boolean deleteOnClaimUntrusted; + private final boolean deleteOnClaimTrustChanged; private final boolean deleteOnClaimUnclaimed; @@ -66,7 +65,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { super(plugin); ConfigurationSection configurationSection = plugin.getConfig(); this.whiteList = configurationSection.getBoolean("integration.griefprevention.whitelist-mode"); - this.deleteOnClaimUntrusted = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-untrusted"); + this.deleteOnClaimTrustChanged = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-trust-changed"); this.deleteOnClaimUnclaimed = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-unclaimed"); this.deleteOnClaimExpired = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-expired"); this.deleteOnClaimResized = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-resized"); @@ -99,12 +98,12 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { return checkPermission(player, location, tradeLimits); } - // When player changes trust, we will check if the shops there will be deleted or not. + // We will check if the shops belong to user/users whose permissions were changed. + // If so, we will delete them. // We will not delete the shops of the claim owner. - // The shops will be deleted if the shop owner doesn't have anymore permission to create a shop there. @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onClaimUntrusted(TrustChangedEvent event) { - if (!deleteOnClaimUntrusted) { + public void onClaimTrustChanged(TrustChangedEvent event) { + if (!deleteOnClaimTrustChanged) { return; } for (Claim claim : event.getClaims()) { @@ -112,12 +111,16 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null) { for (Shop shop : shops.values()) { - if (!shop.getOwner().equals(claim.getOwnerID())) { - Claim shopClaim = griefPrevention.dataStore.getClaimAt(shop.getLocation(), false, false, null); - if (shopClaim != null && - shopClaim.getID().equals(claim.getID()) && - !hasPermissionClaim(shopClaim, Bukkit.getPlayer(shop.getOwner()), createLimits)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (Untrusted) #" + shop.getOwner()); + if (!shop.getOwner().equals(claim.getOwnerID()) && + claim.contains(shop.getLocation(), false, false)) { + if (event.getIdentifier().equals(shop.getOwner().toString())) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); + shop.delete(); + } else if (event.getIdentifier().contains(shop.getOwner().toString())) { + plugin.log("[SHOP DELETE] GP Integration: Group delete (Claim/Subclaim Trust Changed)#" + shop.ownerName()); + shop.delete(); + } else if ("all".equals(event.getIdentifier()) || "public".equals(event.getIdentifier())) { + plugin.log("[SHOP DELETE] GP Integration: All/Public delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); shop.delete(); } } @@ -137,7 +140,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { if (event.getClaim().parent == null) { handleMainClaimUnclaimedOrExpired(event.getClaim(), "[SHOP DELETE] GP Integration: Single delete (Claim Unclaimed) #"); } else { - handleSubClaimUnclaimed(event.getClaim(), event.getClaim().parent); + handleSubClaimUnclaimed(event.getClaim()); } } @@ -162,18 +165,18 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { if (oldClaim.parent == null) { handleMainClaimResized(oldClaim, newClaim); } else { - handleSubClaimResized(oldClaim, newClaim, oldClaim.parent); + handleSubClaimResized(oldClaim, newClaim); } } - // If it is the main claim, then we will delete all shops that were inside of it. + // If it is the main claim, then we will delete all the shops that were inside of it. private void handleMainClaimUnclaimedOrExpired(Claim claim, String logMessage) { for (Chunk chunk : claim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null) { for (Shop shop : shops.values()) { if (claim.contains(shop.getLocation(), false, false)) { - plugin.log(logMessage + shop.getOwner()); + plugin.log(logMessage + shop.ownerName()); shop.delete(); } } @@ -182,26 +185,24 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { } // If it is a subclaim, then we will not remove the shops of the main claim owner. - // Also, we will not remove the shops of the players that have permission to build shops in the main claim. - private void handleSubClaimUnclaimed(Claim subClaim, Claim mainClaim) { + // But we will remove all the others. + private void handleSubClaimUnclaimed(Claim subClaim) { for (Chunk chunk : subClaim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null) { for (Shop shop : shops.values()) { - if (subClaim.contains(shop.getLocation(), false, false)) { - if (!shop.getOwner().equals(mainClaim.getOwnerID()) && - !hasPermissionClaim(mainClaim, Bukkit.getPlayer(shop.getOwner()), createLimits)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Unclaimed) #" + shop.getOwner()); - shop.delete(); - } + if (!shop.getOwner().equals(subClaim.getOwnerID()) && + subClaim.contains(shop.getLocation(), false, false)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Unclaimed) #" + shop.ownerName()); + shop.delete(); } } } } } - // If it is a main claim, then we will remove the shop if the main claim was resized (size was decreased). - // The shop will be removed if the old claim contains the shop but the new claim doesn't have it. + // If it is a main claim, then we will remove the shops if the main claim was resized (size was decreased). + // A shop will be removed if the old claim contain it but the new claim doesn't. private void handleMainClaimResized(Claim oldClaim, Claim newClaim) { for (Chunk chunk : oldClaim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); @@ -209,7 +210,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { for (Shop shop : shops.values()) { if (oldClaim.contains(shop.getLocation(), false, false) && !newClaim.contains(shop.getLocation(), false, false)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim Resized) #" + shop.getOwner()); + plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim Resized) #" + shop.ownerName()); shop.delete(); } } @@ -218,26 +219,24 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { } // If it is a subclaim, then we will remove the shops in 2 situations. - // We will never remove shops of the claim owner. - // We will remove the shop if the shop is now outside the subclaim and the shop owner doesn't have permission in the main claim. - // We will remove the shop if the shop is now inside the subclaim and the shop owner doesn't have permission in the subclaim. - private void handleSubClaimResized(Claim oldClaim, Claim newClaim, Claim mainClaim) { - handleSubClaimResizedHelper(oldClaim, newClaim, mainClaim); - handleSubClaimResizedHelper(newClaim, oldClaim, newClaim); + // We will never remove the shops of the claim owner. + // We will remove a shop if the shop was inside the subclaim but now it is outside the subclaim. + // We will remove a shop if the shop was outside the subclaim but now it is inside the subclaim. + private void handleSubClaimResized(Claim oldClaim, Claim newClaim) { + handleSubClaimResizedHelper(oldClaim, newClaim); + handleSubClaimResizedHelper(newClaim, oldClaim); } - private void handleSubClaimResizedHelper(Claim claimVerifyChunks, Claim claimVerifyShop, Claim claimPermissionCheck) { + private void handleSubClaimResizedHelper(Claim claimVerifyChunks, Claim claimVerifyShop) { for (Chunk chunk : claimVerifyChunks.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null) { for (Shop shop : shops.values()) { - if (!shop.getOwner().equals(claimVerifyChunks.getOwnerID())) { - if (claimVerifyChunks.contains(shop.getLocation(), false, false) && - !claimVerifyShop.contains(shop.getLocation(), false, false) && - !hasPermissionClaim(claimPermissionCheck, Bukkit.getPlayer(shop.getOwner()), createLimits)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Resized) #" + shop.getOwner()); - shop.delete(); - } + if (!shop.getOwner().equals(claimVerifyChunks.getOwnerID()) && + claimVerifyChunks.contains(shop.getLocation(), false, false) && + !claimVerifyShop.contains(shop.getLocation(), false, false)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Resized) #" + shop.ownerName()); + shop.delete(); } } } @@ -248,14 +247,10 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { if (!griefPrevention.claimsEnabledForWorld(location.getWorld())) { return true; } - Claim claim = griefPrevention.dataStore.getClaimAt(location, false, griefPrevention.dataStore.getPlayerData(player.getUniqueId()).lastClaim); + Claim claim = griefPrevention.dataStore.getClaimAt(location, false, false, griefPrevention.dataStore.getPlayerData(player.getUniqueId()).lastClaim); if (claim == null) { return !whiteList; } - return hasPermissionClaim(claim, player, limits); - } - - private boolean hasPermissionClaim(@NotNull Claim claim, Player player, List limits) { for (Flag flag : limits) { if (!flag.check(claim, player)) { return false; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index b4b0e7fad..e3a2d9f9e 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -691,13 +691,22 @@ integration: #CONTAINER_ACCESS = The player must be able to access containers. #ACCESS = The Player must have the ability to access the target claim. trade: [ ] - #Should QuickShop delete shops if the shop owner has been untrusted on the claim? - delete-on-claim-untrusted: true - #Should QuickShop delete shops if claim has been deleted? + #Should QuickShop delete shops if the trust permission of the shop owner has been changed on the claim/subclaim? + #It will check if the shops belong to user/users whose permissions were changed and will delete them. + #It will never remove a shop of the claim owner. + delete-on-claim-trust-changed: true + #Should QuickShop delete shops if the claim/subclaim has been unclaimed? + #It will remove all the shops that were inside the claim/subclaim that was unclaimed. + #It will never remove a shop of the claim owner when unclaiming a subclaim. delete-on-claim-unclaimed: true - #Should QuickShop delete shops if claim has been expired? + #Should QuickShop delete shops if the claim has been expired? + #It will remove all the shops that were inside the claim. delete-on-claim-expired: true - #Should QuickShop delete shops if claim has been resized (claim has become smaller and the shop is now outside claim)? + #Should QuickShop delete shops if claim/subclaim has been resized? + #It will remove a shop that the old claim contains but the new claim doesn't. + #It will remove a shop if the shop was inside the subclaim but now it is outside the subclaim. + #It will remove a shop if the shop was outside the subclaim but now it is inside the subclaim. + #It will never remove a shop of the claim owner when resizing a subclaim. delete-on-claim-resized: true #Residence Integration residence: From 664022880f2841a60ccd6c6e4011f57def87c6a3 Mon Sep 17 00:00:00 2001 From: 1171066 <1171066@isep.ipp.pt> Date: Tue, 27 Jul 2021 17:01:12 +0100 Subject: [PATCH 3/9] Minor fix in the trust changed event. --- .../GriefPreventionIntegration.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) 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 33bae871e..31cf68776 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java @@ -111,17 +111,19 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { Map shops = plugin.getShopManager().getShops(chunk); if (shops != null) { for (Shop shop : shops.values()) { - if (!shop.getOwner().equals(claim.getOwnerID()) && - claim.contains(shop.getLocation(), false, false)) { - if (event.getIdentifier().equals(shop.getOwner().toString())) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); - shop.delete(); - } else if (event.getIdentifier().contains(shop.getOwner().toString())) { - plugin.log("[SHOP DELETE] GP Integration: Group delete (Claim/Subclaim Trust Changed)#" + shop.ownerName()); - shop.delete(); - } else if ("all".equals(event.getIdentifier()) || "public".equals(event.getIdentifier())) { - plugin.log("[SHOP DELETE] GP Integration: All/Public delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); - shop.delete(); + if (!shop.getOwner().equals(claim.getOwnerID())) { + Claim shopClaim = griefPrevention.dataStore.getClaimAt(shop.getLocation(), false, false, null); + if (shopClaim != null && shopClaim.getID().equals(claim.getID())) { + if (event.getIdentifier().equals(shop.getOwner().toString())) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); + shop.delete(); + } else if (event.getIdentifier().contains(shop.getOwner().toString())) { + plugin.log("[SHOP DELETE] GP Integration: Group delete (Claim/Subclaim Trust Changed)#" + shop.ownerName()); + shop.delete(); + } else if ("all".equals(event.getIdentifier()) || "public".equals(event.getIdentifier())) { + plugin.log("[SHOP DELETE] GP Integration: All/Public delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); + shop.delete(); + } } } } From d1f6f4074551a83c921b6f83ffb16a0056619661 Mon Sep 17 00:00:00 2001 From: 1171066 <1171066@isep.ipp.pt> Date: Tue, 27 Jul 2021 22:14:31 +0100 Subject: [PATCH 4/9] Improved the Grief Prevention Integration by changing the config file. --- .../org/maxgamer/quickshop/QuickShop.java | 7 ++- .../GriefPreventionIntegration.java | 61 ++++++++++++++----- src/main/resources/config.yml | 32 +++++----- 3 files changed, 67 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index eb4f0c306..d398a1cef 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1764,7 +1764,7 @@ public class QuickShop extends JavaPlugin { if (selectedVersion == 115) { getConfig().set("integration.griefprevention.enable", false); getConfig().set("integration.griefprevention.whitelist-mode", false); - getConfig().set("integration.griefprevention.create", Collections.emptyList()); + getConfig().set("integration.griefprevention.create", "Inventory"); getConfig().set("integration.griefprevention.trade", Collections.emptyList()); getConfig().set("config-version", 116); selectedVersion = 116; @@ -1872,7 +1872,10 @@ public class QuickShop extends JavaPlugin { getConfig().set("integration.advancedregionmarket.enable", true); getConfig().set("config-version", ++selectedVersion); } - + if (selectedVersion == 136) { + getConfig().set("integration.griefprevention.delete-on-subclaim-created", true); + getConfig().set("config-version", ++selectedVersion); + } if (getConfig().getInt("matcher.work-type") != 0 && GameVersion.get(ReflectFactory.getServerVersion()).name().contains("1_16")) { getLogger().warning("You are not using QS Matcher, it may meeting item comparing issue mentioned there: https://hub.spigotmc.org/jira/browse/SPIGOT-5063"); 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 31cf68776..9e8c27034 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java @@ -20,11 +20,9 @@ package org.maxgamer.quickshop.integration.griefprevention; import me.ryanhamshire.GriefPrevention.Claim; +import me.ryanhamshire.GriefPrevention.ClaimPermission; import me.ryanhamshire.GriefPrevention.GriefPrevention; -import me.ryanhamshire.GriefPrevention.events.ClaimDeletedEvent; -import me.ryanhamshire.GriefPrevention.events.ClaimExpirationEvent; -import me.ryanhamshire.GriefPrevention.events.ClaimModifiedEvent; -import me.ryanhamshire.GriefPrevention.events.TrustChangedEvent; +import me.ryanhamshire.GriefPrevention.events.*; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; @@ -39,6 +37,7 @@ import org.maxgamer.quickshop.integration.IntegrationStage; import org.maxgamer.quickshop.integration.QSIntegratedPlugin; import org.maxgamer.quickshop.shop.Shop; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -57,7 +56,9 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { private final boolean deleteOnClaimResized; - private final List createLimits = new ArrayList<>(3); + private final boolean deleteOnSubClaimCreated; + + private final Flag createLimit; private final List tradeLimits = new ArrayList<>(3); @@ -69,7 +70,8 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { this.deleteOnClaimUnclaimed = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-unclaimed"); this.deleteOnClaimExpired = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-expired"); this.deleteOnClaimResized = configurationSection.getBoolean("integration.griefprevention.delete-on-claim-resized"); - this.createLimits.addAll(toFlags(configurationSection.getStringList("integration.griefprevention.create"))); + this.deleteOnSubClaimCreated = configurationSection.getBoolean("integration.griefprevention.delete-on-subclaim-created"); + this.createLimit = Flag.getFlag(configurationSection.getString("integration.griefprevention.create")); this.tradeLimits.addAll(toFlags(configurationSection.getStringList("integration.griefprevention.trade"))); } @@ -90,7 +92,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { @Override public boolean canCreateShopHere(@NotNull Player player, @NotNull Location location) { - return checkPermission(player, location, createLimits); + return checkPermission(player, location, Arrays.asList(createLimit)); } @Override @@ -98,14 +100,20 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { return checkPermission(player, location, tradeLimits); } - // We will check if the shops belong to user/users whose permissions were changed. - // If so, we will delete them. + // We will check if the shop belongs to user whose permissions were changed. + // It will remove a shop if the shop owner no longer has permission to build a shop there. // We will not delete the shops of the claim owner. @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onClaimTrustChanged(TrustChangedEvent event) { if (!deleteOnClaimTrustChanged) { return; } + if (event.isGiven() && event.getClaimPermission() == null) { + return; + } + if (ClaimPermission.valueOf(createLimit.toString()).isGrantedBy(event.getClaimPermission())) { + return; + } for (Claim claim : event.getClaims()) { for (Chunk chunk : claim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); @@ -171,6 +179,30 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { } } + // Player can create subclaims inside a claim. + // So if a subclaim is created that will contain, initially, shops from others players, then we will remove them. + // Because they won't have, initially, permission to create a shop in that subclaim. + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onSubClaimCreated(ClaimCreatedEvent event) { + if (!deleteOnSubClaimCreated) { + return; + } + if (event.getClaim().parent != null) { + for (Chunk chunk : event.getClaim().getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (!shop.getOwner().equals(event.getClaim().getOwnerID()) && + event.getClaim().contains(shop.getLocation(), false, false)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Created) #" + shop.ownerName()); + shop.delete(); + } + } + } + } + } + } + // If it is the main claim, then we will delete all the shops that were inside of it. private void handleMainClaimUnclaimedOrExpired(Claim claim, String logMessage) { for (Chunk chunk : claim.getChunks()) { @@ -204,7 +236,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { } // If it is a main claim, then we will remove the shops if the main claim was resized (size was decreased). - // A shop will be removed if the old claim contain it but the new claim doesn't. + // A shop will be removed if the old claim contains it but the new claim doesn't. private void handleMainClaimResized(Claim oldClaim, Claim newClaim) { for (Chunk chunk : oldClaim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); @@ -274,17 +306,17 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { enum Flag { - BUILD { + Build { @Override boolean check(Claim claim, Player player) { return claim.allowBuild(player, Material.CHEST) == null; } - }, CONTAINER_ACCESS { + }, Inventory { @Override boolean check(Claim claim, Player player) { return claim.allowContainers(player) == null; } - }, ACCESS { + }, Access { @Override boolean check(Claim claim, Player player) { return claim.allowAccess(player) == null; @@ -292,9 +324,8 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { }; public static Flag getFlag(String flag) { - flag = flag.toUpperCase(); for (Flag value : Flag.values()) { - if (value.name().equals(flag)) { + if (value.name().equalsIgnoreCase(flag)) { return value; } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index e3a2d9f9e..e3395faff 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -670,29 +670,24 @@ integration: #GriefPrevention Integration griefprevention: enable: false - #Should we prevent the creation of a shop or trade with a shop outside GriefPrevetion's area? - whitelist-mode: false - #Which checks does a player need to pass to create a shop? - #You can use multiple checks at the same time. - #Priority: UP > DOWN - # + #Should we prevent the creation of a shop or trade with a shop outside GriefPrevention's area? + whitelist-mode: true + #Which check does a player need to pass to create a shop? #Available fields: - #BUILD = The player must have the ability to build in the target claim. - #CONTAINER_ACCESS = The player must be able to access containers. - #ACCESS = The Player must have the ability to access the target claim. - create: - - CONTAINER_ACCESS + #Build = The player must have the ability to build in the target claim. + #Inventory = The player must be able to access containers. + #Access = The Player must have the ability to access the target claim. + create: Inventory #Which checks does a player need to pass to trade with a shop? #You can use multiple checks at the same time. #Priority: UP > DOWN - # #Available fields: - #BUILD = The player must have the ability to build in the target claim. - #CONTAINER_ACCESS = The player must be able to access containers. - #ACCESS = The Player must have the ability to access the target claim. + #Build = The player must have the ability to build in the target claim. + #Inventory = The player must be able to access containers. + #Access = The Player must have the ability to access the target claim. trade: [ ] #Should QuickShop delete shops if the trust permission of the shop owner has been changed on the claim/subclaim? - #It will check if the shops belong to user/users whose permissions were changed and will delete them. + #It will remove a shop if the shop owner no longer has permission to build a shop there. #It will never remove a shop of the claim owner. delete-on-claim-trust-changed: true #Should QuickShop delete shops if the claim/subclaim has been unclaimed? @@ -708,6 +703,11 @@ integration: #It will remove a shop if the shop was outside the subclaim but now it is inside the subclaim. #It will never remove a shop of the claim owner when resizing a subclaim. delete-on-claim-resized: true + #Should Quickshop delete shops if a subclaim has been created? + #So if a subclaim is created that will contain, initially, shops from others players, then we will remove them. + #Because they won't have, initially, permission to create a shop in that subclaim. + #It will never remove a shop of the claim owner. + delete-on-subclaim-created: true #Residence Integration residence: enable: false From 5021aa7a1c4be04e49b01fa02e14f2bfca0162e3 Mon Sep 17 00:00:00 2001 From: 1171066 <1171066@isep.ipp.pt> Date: Wed, 28 Jul 2021 17:40:26 +0100 Subject: [PATCH 5/9] Fixed/Changed some things, in order for the pull request to be approved. --- .../org/maxgamer/quickshop/QuickShop.java | 24 ++++- .../GriefPreventionIntegration.java | 94 ++++++++++++------- src/main/resources/config.yml | 38 ++++---- 3 files changed, 96 insertions(+), 60 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 427c40b5b..265bcee14 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1756,7 +1756,7 @@ public class QuickShop extends JavaPlugin { if (selectedVersion == 115) { getConfig().set("integration.griefprevention.enable", false); getConfig().set("integration.griefprevention.whitelist-mode", false); - getConfig().set("integration.griefprevention.create", "Inventory"); + getConfig().set("integration.griefprevention.create", Collections.emptyList()); getConfig().set("integration.griefprevention.trade", Collections.emptyList()); getConfig().set("config-version", 116); selectedVersion = 116; @@ -1826,7 +1826,7 @@ public class QuickShop extends JavaPlugin { } if (selectedVersion == 128) { getConfig().set("shop.force-use-item-original-name", false); - getConfig().set("integration.griefprevention.delete-on-claim-trust-changed", false); + getConfig().set("integration.griefprevention.delete-on-untrusted", false); getConfig().set("config-version", ++selectedVersion); } @@ -1852,7 +1852,7 @@ public class QuickShop extends JavaPlugin { getConfig().set("config-version", ++selectedVersion); } if (selectedVersion == 133) { - getConfig().set("integration.griefprevention.delete-on-claim-unclaimed", false); + getConfig().set("integration.griefprevention.delete-on-unclaim", false); getConfig().set("integration.griefprevention.delete-on-claim-expired", false); getConfig().set("config-version", ++selectedVersion); } @@ -1868,8 +1868,22 @@ public class QuickShop extends JavaPlugin { getConfig().set("shop.use-global-virtual-item-queue", null); getConfig().set("config-version", ++selectedVersion); } - if(selectedVersion == 137) { - getConfig().set("integration.griefprevention.delete-on-subclaim-created", true); + if (selectedVersion == 137) { + getConfig().set("integration.griefprevention.create", null); + getConfig().set("integration.griefprevention.create", "INVENTORY"); + + getConfig().set("integration.griefprevention.trade", null); + getConfig().set("integration.griefprevention.trade", Collections.emptyList()); + + boolean oldValueUntrusted = getConfig().getBoolean("integration.griefprevention.delete-on-untrusted", false); + getConfig().set("integration.griefprevention.delete-on-untrusted", null); + getConfig().set("integration.griefprevention.delete-on-claim-trust-changed", oldValueUntrusted); + + boolean oldValueUnclaim = getConfig().getBoolean("integration.griefprevention.delete-on-unclaim", false); + getConfig().set("integration.griefprevention.delete-on-unclaim", null); + getConfig().set("integration.griefprevention.delete-on-claim-unclaimed", oldValueUnclaim); + + getConfig().set("integration.griefprevention.delete-on-subclaim-created", false); getConfig().set("config-version", ++selectedVersion); } 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 9e8c27034..d7b6ff11e 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/griefprevention/GriefPreventionIntegration.java @@ -22,7 +22,11 @@ package org.maxgamer.quickshop.integration.griefprevention; import me.ryanhamshire.GriefPrevention.Claim; import me.ryanhamshire.GriefPrevention.ClaimPermission; import me.ryanhamshire.GriefPrevention.GriefPrevention; -import me.ryanhamshire.GriefPrevention.events.*; +import me.ryanhamshire.GriefPrevention.events.TrustChangedEvent; +import me.ryanhamshire.GriefPrevention.events.ClaimDeletedEvent; +import me.ryanhamshire.GriefPrevention.events.ClaimExpirationEvent; +import me.ryanhamshire.GriefPrevention.events.ClaimModifiedEvent; +import me.ryanhamshire.GriefPrevention.events.ClaimCreatedEvent; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; @@ -37,7 +41,7 @@ import org.maxgamer.quickshop.integration.IntegrationStage; import org.maxgamer.quickshop.integration.QSIntegratedPlugin; import org.maxgamer.quickshop.shop.Shop; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -92,7 +96,7 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { @Override public boolean canCreateShopHere(@NotNull Player player, @NotNull Location location) { - return checkPermission(player, location, Arrays.asList(createLimit)); + return checkPermission(player, location, Collections.singletonList(createLimit)); } @Override @@ -111,29 +115,32 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { if (event.isGiven() && event.getClaimPermission() == null) { return; } - if (ClaimPermission.valueOf(createLimit.toString()).isGrantedBy(event.getClaimPermission())) { + if (createLimit.toClaimPermission().isGrantedBy(event.getClaimPermission())) { return; } for (Claim claim : event.getClaims()) { for (Chunk chunk : claim.getChunks()) { Map shops = plugin.getShopManager().getShops(chunk); - if (shops != null) { - for (Shop shop : shops.values()) { - if (!shop.getOwner().equals(claim.getOwnerID())) { - Claim shopClaim = griefPrevention.dataStore.getClaimAt(shop.getLocation(), false, false, null); - if (shopClaim != null && shopClaim.getID().equals(claim.getID())) { - if (event.getIdentifier().equals(shop.getOwner().toString())) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); - shop.delete(); - } else if (event.getIdentifier().contains(shop.getOwner().toString())) { - plugin.log("[SHOP DELETE] GP Integration: Group delete (Claim/Subclaim Trust Changed)#" + shop.ownerName()); - shop.delete(); - } else if ("all".equals(event.getIdentifier()) || "public".equals(event.getIdentifier())) { - plugin.log("[SHOP DELETE] GP Integration: All/Public delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); - shop.delete(); - } - } - } + if (shops == null) { + continue; + } + for (Shop shop : shops.values()) { + if (shop.getOwner().equals(claim.getOwnerID())) { + continue; + } + Claim shopClaim = griefPrevention.dataStore.getClaimAt(shop.getLocation(), false, false, null); + if (shopClaim == null || !shopClaim.getID().equals(claim.getID())) { + continue; + } + if (event.getIdentifier().equals(shop.getOwner().toString())) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); + shop.delete(); + } else if (event.getIdentifier().contains(shop.getOwner().toString())) { + plugin.log("[SHOP DELETE] GP Integration: Group delete (Claim/Subclaim Trust Changed)#" + shop.ownerName()); + shop.delete(); + } else if ("all".equals(event.getIdentifier()) || "public".equals(event.getIdentifier())) { + plugin.log("[SHOP DELETE] GP Integration: All/Public delete (Claim/Subclaim Trust Changed) #" + shop.ownerName()); + shop.delete(); } } } @@ -187,16 +194,17 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { if (!deleteOnSubClaimCreated) { return; } - if (event.getClaim().parent != null) { - for (Chunk chunk : event.getClaim().getChunks()) { - Map shops = plugin.getShopManager().getShops(chunk); - if (shops != null) { - for (Shop shop : shops.values()) { - if (!shop.getOwner().equals(event.getClaim().getOwnerID()) && - event.getClaim().contains(shop.getLocation(), false, false)) { - plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Created) #" + shop.ownerName()); - shop.delete(); - } + if(event.getClaim().parent == null) { + return; + } + for (Chunk chunk : event.getClaim().getChunks()) { + Map shops = plugin.getShopManager().getShops(chunk); + if (shops != null) { + for (Shop shop : shops.values()) { + if (!shop.getOwner().equals(event.getClaim().getOwnerID()) && + event.getClaim().contains(shop.getLocation(), false, false)) { + plugin.log("[SHOP DELETE] GP Integration: Single delete (SubClaim Created) #" + shop.ownerName()); + shop.delete(); } } } @@ -306,23 +314,39 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { enum Flag { - Build { + BUILD { @Override boolean check(Claim claim, Player player) { return claim.allowBuild(player, Material.CHEST) == null; } - }, Inventory { + @Override + ClaimPermission toClaimPermission() { + return ClaimPermission.Build; + } + }, INVENTORY { @Override boolean check(Claim claim, Player player) { return claim.allowContainers(player) == null; } - }, Access { + @Override + ClaimPermission toClaimPermission() { + return ClaimPermission.Inventory; + } + }, ACCESS { @Override boolean check(Claim claim, Player player) { return claim.allowAccess(player) == null; } + @Override + ClaimPermission toClaimPermission() { + return ClaimPermission.Access; + } }; + abstract boolean check(Claim claim, Player player); + + abstract ClaimPermission toClaimPermission(); + public static Flag getFlag(String flag) { for (Flag value : Flag.values()) { if (value.name().equalsIgnoreCase(flag)) { @@ -331,8 +355,6 @@ public class GriefPreventionIntegration extends QSIntegratedPlugin { } return null; } - - abstract boolean check(Claim claim, Player player); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ffb44e614..3a0179d56 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -22,7 +22,7 @@ # TO EDIT QUICKSHOP'S CONFIGURATION, USE THE "config.yml" FILE! #Do not touch this if you don't know what you're doing! -config-version: 137 +config-version: 138 #Select the language you want to use, (e.g de), use only supported language codes from the list below. #If you use a not existant/not supported language, then QuickShop will use en_US. @@ -667,39 +667,39 @@ integration: whitelist-mode: true #Which check does a player need to pass to create a shop? #Available fields: - #Build = The player must have the ability to build in the target claim. - #Inventory = The player must be able to access containers. - #Access = The Player must have the ability to access the target claim. - create: Inventory + #BUILD = The player must have the ability to build in the target claim. + #INVENTORY = The player must be able to access containers. + #ACCESS = The Player must have the ability to access the target claim. + create: INVENTORY #Which checks does a player need to pass to trade with a shop? #You can use multiple checks at the same time. #Priority: UP > DOWN #Available fields: - #Build = The player must have the ability to build in the target claim. - #Inventory = The player must be able to access containers. - #Access = The Player must have the ability to access the target claim. + #BUILD = The player must have the ability to build in the target claim. + #INVENTORY = The player must be able to access containers. + #ACCESS = The Player must have the ability to access the target claim. trade: [ ] #Should QuickShop delete shops if the trust permission of the shop owner has been changed on the claim/subclaim? - #It will remove a shop if the shop owner no longer has permission to build a shop there. - #It will never remove a shop of the claim owner. + #Removes a shop if the shop owner no longer has permission to build a shop there. + #Never removes a shop of the claim owner. delete-on-claim-trust-changed: true #Should QuickShop delete shops if the claim/subclaim has been unclaimed? - #It will remove all the shops that were inside the claim/subclaim that was unclaimed. - #It will never remove a shop of the claim owner when unclaiming a subclaim. + #Removes all the shops that were inside the claim/subclaim that was unclaimed. + #Never removes a shop of the claim owner when unclaiming a subclaim. delete-on-claim-unclaimed: true #Should QuickShop delete shops if the claim has been expired? - #It will remove all the shops that were inside the claim. + #Removes all the shops that were inside the claim. delete-on-claim-expired: true #Should QuickShop delete shops if claim/subclaim has been resized? - #It will remove a shop that the old claim contains but the new claim doesn't. - #It will remove a shop if the shop was inside the subclaim but now it is outside the subclaim. - #It will remove a shop if the shop was outside the subclaim but now it is inside the subclaim. - #It will never remove a shop of the claim owner when resizing a subclaim. + #Removes a shop that the old claim contains but the new claim doesn't. + #Removes a shop if the shop was inside the subclaim but now it is outside the subclaim. + #Removes a shop if the shop was outside the subclaim but now it is inside the subclaim. + #Never removes a shop of the claim owner when resizing a subclaim. delete-on-claim-resized: true #Should Quickshop delete shops if a subclaim has been created? - #So if a subclaim is created that will contain, initially, shops from others players, then we will remove them. + #If a subclaim is created that will contain, initially, shops from others players, then we will remove them. #Because they won't have, initially, permission to create a shop in that subclaim. - #It will never remove a shop of the claim owner. + #Never removes a shop of the claim owner. delete-on-subclaim-created: true #Residence Integration residence: From 9d869ed98819b88bb683cd1fd32e4d2f96fc145b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Jul 2021 10:14:15 +0000 Subject: [PATCH 6/9] Bump LandsAPI from 5.12.2 to 5.12.7 Bumps [LandsAPI](https://github.com/Angeschossen/LandsAPI) from 5.12.2 to 5.12.7. - [Release notes](https://github.com/Angeschossen/LandsAPI/releases) - [Commits](https://github.com/Angeschossen/LandsAPI/compare/5.12.2...5.12.7) --- updated-dependencies: - dependency-name: com.github.angeschossen:LandsAPI dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index afd13c4c9..a89fab02a 100644 --- a/pom.xml +++ b/pom.xml @@ -558,7 +558,7 @@ com.github.angeschossen LandsAPI - 5.12.2 + 5.12.7 provided From 302847fe81800211d9f5d4d4addccea7f90485c4 Mon Sep 17 00:00:00 2001 From: 1171066 <1171066@isep.ipp.pt> Date: Fri, 30 Jul 2021 13:45:03 +0100 Subject: [PATCH 7/9] Added whitelist-mode option to Towny Integration in the config file --- src/main/java/org/maxgamer/quickshop/QuickShop.java | 4 ++++ .../quickshop/integration/towny/TownyIntegration.java | 5 +++++ src/main/resources/config.yml | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 265bcee14..2ee4e28bb 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1886,6 +1886,10 @@ public class QuickShop extends JavaPlugin { getConfig().set("integration.griefprevention.delete-on-subclaim-created", false); getConfig().set("config-version", ++selectedVersion); } + if (selectedVersion == 138) { + getConfig().set("integration.towny.whitelist-mode", true); + getConfig().set("config-version", ++selectedVersion); + } if (getConfig().getInt("matcher.work-type") != 0 && GameVersion.get(ReflectFactory.getServerVersion()).name().contains("1_16")) { getLogger().warning("You are not using QS Matcher, it may meeting item comparing issue mentioned there: https://hub.spigotmc.org/jira/browse/SPIGOT-5063"); diff --git a/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java b/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java index 3630b962b..e30685a73 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java @@ -58,6 +58,7 @@ public class TownyIntegration extends QSIntegratedPlugin implements Listener { private final boolean deleteShopOnLeave; private final boolean deleteShopOnPlotClear; private boolean isNewVersion; + private boolean whiteList; public TownyIntegration(QuickShop plugin) { @@ -67,6 +68,7 @@ public class TownyIntegration extends QSIntegratedPlugin implements Listener { ignoreDisabledWorlds = plugin.getConfig().getBoolean("integration.towny.ignore-disabled-worlds"); deleteShopOnLeave = plugin.getConfig().getBoolean("integration.towny.delete-shop-on-resident-leave"); deleteShopOnPlotClear = plugin.getConfig().getBoolean("integration.towny.delete-shop-on-plot-clear"); + whiteList = plugin.getConfig().getBoolean("integration.towny.whitelist-mode"); //Testing if there have new method try { Town.class.getDeclaredMethod("getHomeblockWorld"); @@ -185,6 +187,9 @@ public class TownyIntegration extends QSIntegratedPlugin implements Listener { Util.debugLog("This world disabled Towny."); return true; } + if (!whiteList && !ShopPlotUtil.isShopPlot(location)) { + return true; + } for (TownyFlags flag : flags) { switch (flag) { case OWN: diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3a0179d56..af73e4f2b 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -22,7 +22,7 @@ # TO EDIT QUICKSHOP'S CONFIGURATION, USE THE "config.yml" FILE! #Do not touch this if you don't know what you're doing! -config-version: 138 +config-version: 139 #Select the language you want to use, (e.g de), use only supported language codes from the list below. #If you use a not existant/not supported language, then QuickShop will use en_US. @@ -600,6 +600,8 @@ integration: trade: [] delete-shop-on-resident-leave: false delete-shop-on-plot-clear: true + #Should we prevent the creation of a shop or trade with a shop outside Towny's area + whitelist-mode: true #WorldGuard Integration #CHANGES REQUIRE A SERVER RESTART! #CHANGES REQUIRE A SERVER RESTART! From 3b09bed7eb0dbc60b1fc59db0b72b29a2f31a611 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Sun, 1 Aug 2021 06:20:45 +0800 Subject: [PATCH 8/9] New translations messages.json (Spanish) --- src/main/resources/lang/es-ES/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/lang/es-ES/messages.json b/src/main/resources/lang/es-ES/messages.json index 04a3f45f7..ca6cd5542 100644 --- a/src/main/resources/lang/es-ES/messages.json +++ b/src/main/resources/lang/es-ES/messages.json @@ -5,7 +5,7 @@ "translation-version": "&c&lVersión soportada: &b&lReremake", "translation-contributors": "Contribuidores: Timtower, Netherfoam, KaiNoMood, Mgazul, JackTheChicken y Andre_601", "translation-country": "&c&lZona de idioma: &b&lEspañol (es_ES)", - "language-version": "59", + "language-version": "\"file-test\": \"This is a test text file. We use it to test if the messages.json is broken. You can fill it with any easter-eggs you like here :)\",\n \"translation-author\": \"Translator: Ghost_chu, Andre_601\",\n \"translation-version\": \"Support Version: Reremake\",\n \"translation-contributors\": \"Contributors: Timtower, Netherfoam, KaiNoMood, Mgazul, JackTheChicken and Andre_601\",\n \"translation-country\": \"Language Zone: English (en_US)\",\n \"language-version\": \"58\",\n \"not-looking-at-shop\": \"&cCould not find a QuickShop. You need to look at one.\",\n \"no-anythings-in-your-hand\": \"&cThere is nothing in your hand.\",\n \"no-permission\": \"&cYou do not have permission to do that.\",\n \"integrations-check-failed-create\": \"&cIntegration {0} denied the shop-creation\",\n \"integrations-check-failed-trade\": \"&cIntegration {0} denied the Shop trading\",\n \"3rd-plugin-build-check-failed\": \"&c3rd party plugin &l{0}&r&c denied the permission checks, did you have permission set up in there?\",\n \"no-creative-break\": \"&cYou cannot break other players shops in creative mode, switch to survival mode or try to use the supertool {0} instead.\",\n \"trading-in-creative-mode-is-disabled\": \"&cYou cannot trade with this shop while being in creative mode.\",\n \"supertool-is-disabled\": \"&cSupertool is disabled. Cannot break any shops.\",\n \"no-double-chests\": \"&cYou cannot create the double chest shop.\",\n \"not-managed-shop\": \"&cYou are not the owner or moderator of this Shop\",\n \"shop-already-owned\": \"&cThis is already a shop.\",\n \"chest-was-removed\": \"&cThe chest was removed.\",\n \"price-too-cheap\": \"&cPrice must be greater than &e${0}\",\n \"no-price-change\": \"&cThis wouldn't result in a price change!\",\n \"you-cant-afford-a-new-shop\": \"&cIt costs {0} to create a new shop.\",\n \"player-bought-from-your-store-tax\": \"&c{0} purchased {1} {2} from your shop, and you earned {3} ({4} in taxes).\",\n \"you-cant-afford-to-change-price\": \"&cIt costs {0} to change the price in your shop.\",\n \"success-created-shop\": \"&cShop created.\",\n \"success-removed-shop\": \"&aShop removed.\",\n \"shops-arent-locked\": \"&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!\",\n \"shop-creation-cancelled\": \"&cShop creation cancelled.\",\n \"shop-purchase-cancelled\": \"&cShop purchase cancelled.\",\n \"shop-stock-too-low\": \"&cThe shop only has {0} {1} left!\",\n \"you-cant-afford-to-buy\": \"&cIt costs {0}, but you only have {1}\",\n \"negative-amount\": \"&cYou can't trade negative amounts\",\n \"not-a-number\": \"&cYou can only input a number, your input was {0}.\",\n \"exceeded-maximum\": \"&cThe value exceeded the maximum value in Java.\",\n \"not-a-integer\": \"&cYou must input a integer, your input was {0}.\",\n \"player-bought-from-your-store\": \"&c{0} purchased {1} {2} from your shop, and you earned {3}.\",\n \"shop-out-of-stock\": \"&5Your shop at {0}, {1}, {2} has run out of {3}!\",\n \"shop-has-no-space\": \"&cThe shop only has room for {0} more {1}.\",\n \"you-dont-have-that-many-items\": \"&cYou only have {0} {1}.\",\n \"the-owner-cant-afford-to-buy-from-you\": \"&cThis costs {0}, but the shop-owner only has {1}\",\n \"player-sold-to-your-store\": \"&a{0} sold {1} {2} to your shop.\",\n \"shop-out-of-space\": \"&5Your shop at {0}, {1}, {2} is now full.\",\n \"fee-charged-for-price-change\": \"&aYou paid &c{0}&a to change the price.\",\n \"price-is-now\": \"&aThe new price of the shop is &e{0}\",\n \"thats-not-a-number\": \"&cInvalid number\",\n \"forbidden-vanilla-behavior\": \"&cThe operation is forbidden due to it not being consisten with vanilla behaviour\",\n \"no-price-given\": \"&cPlease give a valid price.\",\n \"average-price-nearby\": \"&aNearby average price: &e{0}\",\n \"shop-has-changed\": \"&cThe shop you tried to use has changed since you clicked it!\",\n \"shop-not-exist\": \"&cThere is no shop.\",\n \"nearby-shop-this-way\": \"&aShop is {0} blocks away from you.\",\n \"nearby-shop-header\": \"&aNearby Shop matching &b{0}&a:\",\n \"nearby-shop-entry\": \"&a- Info:{0} &aPrice:&b{1} &ax:&b{2} &ay:&b{3} &az:&b{4} &adistance: &b{5} &ablock(s)\",\n \"no-nearby-shop\": \"&cNo nearby shop matching {0}.\",\n \"buying-more-than-selling\": \"&cWARNING: You are buying items for more than you are selling them!\",\n \"not-enough-space\": \"&cYou only have room for {0} more!\",\n \"refill-success\": \"&aRefill successful\",\n \"empty-success\": \"&aEmptying shop successful\",\n \"admin-shop\": \"AdminShop\",\n \"unknown-owner\": \"Unknown\",\n \"owner-bypass-check\": \"&eBypassed all checks. Trade successful! (You are now the shop owner!)\",\n \"reached-maximum-can-create\": \"&cYou already created a maximum of {0}/{1} shops!\",\n \"restricted-prices\": \"&cRestricted price for {0}: Min {1}, max {2}\",\n \"no-enough-money-to-keep-shops\": \"&cYou didn't have enough money to keep your shops! All shops have been removed...\",\n \"nothing-to-flush\": \"&aYou have no new shop messages.\",\n \"break-shop-use-supertool\": \"&eYou can break the shop by using the SuperTool.\",\n \"failed-to-put-sign\": \"&cNot enough space around the shop to place the info sign.\",\n \"failed-to-paste\": \"&cFailed to upload the data to Pastebin. Check your internet connection and try again. (See console for details)\",\n \"warn-to-paste\": \"&eCollecting data and uploading it to Pastebin, this may take a while. &c&lWarning:&c The data is kept public for one week! It may leak your server configuration and other sensitive information. Make sure you only send it to <rusted staff/developers.\",\n \"price-too-high\": \"&cThe shop price is too high! You cannot create one with a price higher than {0}.\",\n \"you-cant-create-shop-in-there\": \"&cYou don't have permission to create a shop at this location.\",\n \"unknown-player\": \"&cTarget player doesn't exist, please check the username you typed.\",\n \"shop-staff-cleared\": \"&aSuccessfully removed all staff members from your shop.\",\n \"shop-staff-added\": \"&aSuccessfully added {0} as a staff member for your shop.\",\n \"shop-staff-deleted\": \"&aSuccessfully removed {0} as a staff member for your shop.\",\n \"no-permission-build\": \"&cYou cannot build a shop here.\",\n \"success-change-owner-to-server\": \"&aSuccessfully set the shop owner to Server.\",\n \"flush-finished\": \"&aSuccessfully flushed the messages.\",\n \"purchase-failed\": \"&cPurchase failed: Internal Error. Please contact the Server Administrator.\",\n \"no-pending-action\": \"&cYou do not have any pending actions\",\n \"permission-denied-3rd-party\": \"&cPermission denied: 3rd Party Plugin [{0}].\",\n \"shops-removed-in-world\": \"&eTotal &b{0}&e shops has been deleted in world &b{1}&e.\",\n \"world-not-exists\": \"&cThe world &e{0}&c doesn't exist\",\n \"menu\": {\n \"successful-purchase\": \"&aSuccessfully purchased:\",\n \"successfully-sold\": \"&aSuccessfully sold:\",\n \"item-name-and-price\": \"&e{0} {1} &afor &e{2}\",\n \"sell-tax\": \"&aYou paid &e{0} &ain taxes.\",\n \"sell-tax-self\": \"&aYou didn't pay taxes because you own this shop.\",\n \"enchants\": \"&5Enchantments\",\n \"stored-enchants\": \"&5Stored Enchantments\",\n \"shop-information\": \"&aShop Information:\",\n \"owner\": \"&aOwner: {0}\",\n \"item\": \"&aItem: &e{0}\",\n \"item-holochat-error\": \"&c[Error]\",\n \"preview\": \"&b[Item Preview]\",\n \"space\": \"&aSpace: &e{0}\",\n \"stock\": \"&aStock &e{0}\",\n \"price-per\": \"&aPrice per &e{0} &a- &e{1}\",\n \"price-per-stack\": \"&aPrice per &e{2}x {0} - {1}\",\n \"total-value-of-chest\": \"&aTotal value of chest: &e{0}\",\n \"damage-percent-remaining\": \"&e{0}% &aremaining.\",\n \"this-shop-is-buying\": \"&aThis shop is &dBUYING&a items.\",\n \"this-shop-is-selling\": \"&aThis shop is &bSELLING&a items.\",\n \"shop-stack\": \"&aAmount of bulk: &e{0}\",\n \"effects\": \"&aEffects\"\n },\n \"bypassing-lock\": \"&cBypassing a QuickShop lock!\",\n \"that-is-locked\": \"&cThis shop is locked.\",\n \"how-many-buy\": \"&aEnter in chat, how many you wish to &bBUY&a. You can buy &e{0}&a. Enter &ball&a to buy them all.\",\n \"how-many-sell\": \"&aEnter in chat, how much you wish to &dSELL&a. You have &e{0}&a available. Enter &ball&a in chat, to sell all.\",\n \"not-allowed-to-create\": \"&cYou may not create a shop here.\",\n \"blacklisted-item\": \"&cYou cannot sell this item because it is on the blacklist\",\n \"how-much-to-trade-for\": \"&aEnter in chat, how much you wish to trade &e{1}x {0}&a for.\",\n \"command\": {\n \"toggle-unlimited\": {\n \"unlimited\": \"&aShop is now unlimited\",\n \"limited\": \"&aShop is now limited\"\n },\n \"transfer-success\": \"&aTransferred &e{0} &ashop(s) to &e{1}\",\n \"transfer-success-other\": \"&aTransferred &e{0} {1}&a's shop(s) to &e{2}\",\n \"some-shops-removed\": \"&e{0} &ashop(s) removed\",\n \"no-owner-given\": \"&cNo owner provided\",\n \"new-owner\": \"&aNew owner: &e{0}\",\n \"now-buying\": \"&aNow &dBUYING &e{0}\",\n \"now-selling\": \"&aNow &bSELLING &e{0}\",\n \"cleaning\": \"&aRemoving shops without any stock...\",\n \"reloading\": \"&aReloading...\",\n \"cleaned\": \"&aRemoved &e{0}&a shops.\",\n \"no-type-given\": \"&cUsage: /qs find \",\n \"no-world-given\": \"&cPlease specify a world name\",\n \"bulk-size-not-set\": \"&cUsage: /qs size \",\n \"bulk-size-now\": \"&aNow trading &e{0}x {1}\",\n \"invalid-bulk-amount\": \"&cThe given value {0} is larger than max stack size or lower than one\",\n \"no-trade-item\": \"&aPlease hold a trade item to change in main hand\",\n \"trade-item-now\": \"&aNow trading &e{0}x {1}\",\n \"no-amount-given\": \"&cNo amount provided. Use &a/qs refill &c\",\n \"now-debuging\": \"&aSuccessfully enabled developer mode. Reloading QuickShop...\",\n \"now-nolonger-debuging\": \"&aSuccessfully disabled Developer mode. Reloading QuickShop...\",\n \"wrong-args\": \"&cInvalid argument. Use &l/qs help &cto see a list of commands.\",\n \"description\": {\n \"title\": \"&aQuickShop help\",\n \"unlimited\": \"&eGives a shop unlimited stock.\",\n \"setowner\": \"&eChanges the ownership of a shop.\",\n \"owner\": \"&eChanges the ownership of a shop.\",\n \"buy\": \"&eChanges a shop to &dBUY&e mode\",\n \"sell\": \"&eChanges a shop to &bSELL&e mode\",\n \"price\": \"&eChanges the buy/sell price of a shop\",\n \"clean\": \"&eRemoves all (loaded) shops without any stock\",\n \"find\": \"&eLocates the nearest shop of a specific type.\",\n \"reload\": \"&eReloads the config.yml of QuickShop\",\n \"refill\": \"&eAdds a given number of items to a shop\",\n \"empty\": \"&eRemoves all items from a shop\",\n \"debug\": \"&eEnables Developer mode\",\n \"create\": \"&eCreates a new shop from the targeted chest\",\n \"fetchmessage\": \"&eShow unread shop messages\",\n \"info\": \"&eShow QuickShop statistics\",\n \"paste\": \"&eUploads server data to Pastebin\",\n \"staff\": \"&eManage your shop staff\",\n \"remove\": \"&eRemoves the shop you're looking at\",\n \"amount\": \"&eTo set item amount (Useful when having chat issues)\",\n \"about\": \"&eShows QuickShop info\",\n \"help\": \"&eShows QuickShop help\",\n \"item\": \"&eChange shop item of a shop\",\n \"size\": \"&eChange per bulk amount of a shop\",\n \"supercreate\": \"&eCreate a shop while bypassing all protection checks\",\n \"language\": \"&eChange the currently used language\",\n \"removeall\": \"&eRemove ALL shops of a specified player\",\n \"transfer\": \"&eTransfer someone's ALL shops to other\",\n \"removeworld\": \"&eRemove ALL shops in a specified world\",\n \"currency\": \"&eSet or remove the currency setting of the shop\",\n \"ban\": \"&eBan a player from the shop\",\n \"unban\": \"&eUnban a player from the shop\",\n \"freeze\": \"&eDisable or Enable shop trading\",\n \"lock\": \"&eSwitch the shop's lock status\"\n },\n \"disabled\": \"&cThis command is disabled: &e{0}\",\n \"feature-not-enabled\": \"This feature is not enabled in the config file.\"\n },\n \"signs\": {\n \"selling\": \"Selling {0}\",\n \"stack-selling\": \"Selling {0}\",\n \"header\": \"{1}{0}\",\n \"buying\": \"Buying {0}\",\n \"stack-buying\": \"Buying {0}\",\n \"item\": \"{0}\",\n \"price\": \"{0} each\",\n \"stack-price\": \"{0} per {1}x {2}\",\n \"unlimited\": \"Unlimited\",\n \"status-available\": \"&a\",\n \"status-unavailable\": \"&c\",\n \"out-of-stock\": \"Out of Stock\",\n \"out-of-space\": \"Out of Space\",\n \"freeze\": \"Trading disabled\"\n },\n \"controlpanel\": {\n \"setowner\": \"&aOwner: &b{0} &e[&d&lChange&e]\",\n \"infomation\": \"&aShop Control panel:\",\n \"setowner-hover\": \"&eClick to switch owner.\",\n \"unlimited\": \"&aUnlimited: {0} &e[&d&lChange&e]\",\n \"unlimited-hover\": \"&eClick to toggle if the shop is unlimited.\",\n \"mode-selling\": \"&aShop mode: &bSelling &e[&d&lChange&e]\",\n \"mode-selling-hover\": \"&eClick to change the shop to BUY mode.\",\n \"mode-buying\": \"&aShop mode: &bBuying &e[&d&lChange&e]\",\n \"mode-buying-hover\": \"&eClick to change the shop to SELL mode.\",\n \"price\": \"&aPrice: &b{0} &e[&d&lChange&e]\",\n \"price-hover\": \"&eClick to set a new price for the item.\",\n \"refill\": \"&aRefill: Refill the items &e[&d&lOK&e]\",\n \"refill-hover\": \"&eClick to refill the shop.\",\n \"empty\": \"&aEmpty: Remove all items &e[&d&lOK&e]\",\n \"empty-hover\": \"&eClick to clear the inventory of the shop.\",\n \"remove\": \"&c&l[Remove Shop]\",\n \"remove-hover\": \"&eClick to remove this shop.\",\n \"stack\": \"&aPer bulk amount: &b{0} &e[&d&lChange&e]\",\n \"stack-hover\": \"&eClick to set the amount of item per bulk. Set to 1 for normal behaviour.\",\n \"item\": \"&aShop Item: {0} &e[&d&lChange&e]\",\n \"item-hover\": \"&eClick to change shop Item\",\n \"currency\": \"&aCurrency: &b{0} &e[&d&lSet&e]\",\n \"currency-hover\": \"&eClick to set or remove the currency that this shop is using\",\n \"lock\": \"&eShop lock: &b{0} &e[&d&lToggle&e]\",\n \"lock-hover\": \"&eEnable/Disable the shop's lock protection.\",\n \"freeze\": \"&eFreeze mode: &b{0} &e[&d&lToggle&e]\",\n \"freeze-hover\": \"&eToggle the shop's freeze status.\"\n },\n \"tableformat\": {\n \"full_line\": \"+---------------------------------------------------+\",\n \"left_half_line\": \"+--------------------\",\n \"right_half_line\": \"--------------------+\",\n \"left_begin\": \"| \"\n },\n \"booleanformat\": {\n \"success\": \"&a✔\",\n \"failed\": \"&c✘\"\n },\n \"tabcomplete\": {\n \"price\": \"[price]\",\n \"range\": \"[range]\",\n \"amount\": \"[amount]\",\n \"currency\": \"[currency name]\",\n \"item\": \"[item]\"\n },\n \"updatenotify\": {\n \"buttontitle\": \"[Update Now]\",\n \"onekeybuttontitle\": \"[OneKey Update]\",\n \"list\": [\n \"{0} was released. You are still using {1}!\",\n \"Boom! New update {0} incoming. Update!\",\n \"Surprise! {0} came out. You are on {1}\",\n \"Looks like you need to update. {0} was released!\",\n \"Ooops! {0} was now released. You are on {1}!\",\n \"I swear, QS has been updated to {0}. Why have you not updated yet?\",\n \"Fixing and re... Sorry, but {0} was released!\",\n \"Err! Nope. This is not an error. {0} has been released!\",\n \"OMG! {0} came out! Why are you still using {1}?\",\n \"Todays News: QuickShop has been updated to {0}!\",\n \"Plugin k.i.a. You should update to {0}!\",\n \"Update {0} ignited. Save update!\",\n \"There is an update available Commander. {0} has just came out!\",\n \"Look my style---{0} updated. You're still using {1}\",\n \"Ahhhhhhh! New update {0}! Update!\",\n \"What do you think? {0} has been released! Update!\",\n \"Doctor, QuickShop has a new update {0}! You should update~\",\n \"Ko~ko~da~yo~ QuickShop has a new update {0} ~\"\n ],\n \"remote-disable-warning\": \"&cThis version of QuickShop is marked as disabled by the remote server, which means this version may have serious problem, get details from our SpigotMC page: {0}. This warning will continue to appear until you switch to a stable version, but it will not affect your server's performance.\",\n \"label\": {\n \"unstable\": \"[Unstable]\",\n \"stable\": \"[Stable]\",\n \"lts\": \"[LTS]\",\n \"qualityverifyed\": \"[Quality]\",\n \"github\": \"[GitHub]\",\n \"spigotmc\": \"[SpigotMC]\",\n \"bukkitdev\": \"[BukkitDev]\",\n \"master\": \"[Master]\"\n }\n },\n \"shop-removed-cause-ongoing-fee\": \"&cYour shop at {0} was removed because you didn't have enough money to keep it!\",\n \"digits-reach-the-limit\": \"&cYou have reached the limits of decimals in the price.\",\n \"complete\": \"&aComplete!\",\n \"quickshop-gui-preview\": \"QuickShop GUI Item Preview\",\n \"shops-recovering\": \"Recovering shops from backup...\",\n \"shops-backingup\": \"Creating Shop-backup from database...\",\n \"saved-to-path\": \"The Backup was saved to {0}.\",\n \"backup-failed\": \"Cannot backup the database. Check the console for details.\",\n \"translate-not-completed-yet-click\": \"The translation of the language {0} was not completed yet by {1}. Do you want to help us improving the translation? Click here!\",\n \"translate-not-completed-yet-url\": \"The translation of the language {0} was not completed yet by {1}. Do you want to help us improving the translation? Browse: {2}\",\n \"language-info-panel\": {\n \"name\": \"Language: \",\n \"code\": \"Code: \",\n \"progress\": \"Progress: \",\n \"help\": \"Help us: \",\n \"translate-on-crowdin\": \"[Translate on Crowdin]\"\n },\n \"shop-now-freezed\": \"&aYou have frozen the shop. Nobody can trade with this shop now!\",\n \"shop-nolonger-freezed\": \"&aYou unfroze the shop. It's back to normal now!\",\n \"shop-cannot-trade-when-freezing\": \"&cYou cannot trade with this shop because it is frozen.\",\n \"shop-freezed-at-location\": \"&eYour shop {0} at {1} got frozen!\",\n \"denied-put-in-item\": \"&cYou cannot put this item into your shop!\",\n \"how-many-buy-stack\": \"&eEnter in chat, how many bulks you wish to &bBUY&a. There are &e{0}&a items in each bulk and you can buy &e{1}&a bulks. Enter &ball&a in chat to buy all.\",\n \"how-many-sell-stack\": \"&aEnter in chat, how many bulk you wish to &dSELL&a. There are &e{0}&a items per bulk and you have &e{1}&a bulks available. Enter &ball&a in chat to sell all.\",\n \"language\": {\n \"name\": \"&eName: &6{0}\",\n \"code\": \"&eCode: &6{0}\",\n \"translate-progress\": \"&eTranslation Progress: &b{0}%\",\n \"approval-progress\": \"&eApproval Progress: &b{0}%\",\n \"qa-issues\": \"&eQuality assurance issues: &b{0}%\",\n \"help-us\": \"&a[Help us improve the translation quality]\"\n },\n \"currency-not-exists\": \"&cCannot find the currency that you want to set. Maybe the spelling is wrong or that currency isn't available in this world.\",\n \"currency-set\": \"&aShop currency successfully set to {0}.\",\n \"currency-unset\": \"&aShop currency removed successfully. Using default settings now.\",\n \"currency-not-support\": \"&cThe economy plugin doesn't support the multi-economy feature.\",\n \"item-not-exist\": \"&cThe item &e{0} &cdoes not exist, please check your spelling.\",\n \"backup-success\": \"&aBackup successfull.\",\n \"console-only\": \"&cThis command can only be executed by Console.\",\n \"console-only-danger\": \"&cThis is a dangerous command, so that only the Console can execute it.\",\n \"clean-warning\": \"&eThis command will purge &call &eshops if the shop is damaged, was created in not allowed worlds, is selling/buying not allowed items or &c&lEXISTS IN A UNLOADED WORLD&e. Make sure to create a full backup of your shop data first and use &b/qs cleanghost confirm &eto continue.\",\n \"shop-creation-failed\": \"&cShop creation failed, please contact with server administrator.\",\n \"shop-owner-self-trade\": \"&eYou trade with your own shop, so you might not gain any balance.\",\n \"chest-title\": \"QuickShop Store\",\n \"command-type-mismatch\": \"&cThis command can only be executed by &b{0}.\",\n \"unlimited-shop-owner-changed\": \"&eThe unlimited Shop Owner has been changed to {0}.\",\n \"unlimited-shop-owner-keeped\": \"&eAttention: The Shop Owner is still an unlimited Shop Owner, and you have to re-set the new Shop Owner by yourself.\",\n \"server-crash-warning\": \"&cServer may crash after execute /qs reload command if you replace/delete QuickShop plugin Jar file while server running.\"", "not-looking-at-shop": "&cNo se pudo encontrar ninguna QuickShop. Tienes que mirar hacia una.", "no-anythings-in-your-hand": "&cNo hay nada en tu mano.", "no-permission": "&cNo tienes permiso para hacer eso.", From 911d74c6aeef6ca9dda4023321c241fe9b503668 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Sun, 1 Aug 2021 07:19:44 +0800 Subject: [PATCH 9/9] New translations messages.json (Spanish) --- src/main/resources/lang/es-ES/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/lang/es-ES/messages.json b/src/main/resources/lang/es-ES/messages.json index ca6cd5542..7738f4910 100644 --- a/src/main/resources/lang/es-ES/messages.json +++ b/src/main/resources/lang/es-ES/messages.json @@ -115,7 +115,7 @@ "blacklisted-item": "&cNo puedes vender esto porque está en la lista negra", "how-much-to-trade-for": "&aIngresa en el chat, por cuánto deseas intercambiar &e{1}x {0}&a.", "command": { - "format": "&a/{0} {1} &e- {2}", + "format": "{\n \"break-shop-use-supertool\": \"§ePuede romper la tienda usando la SuperTool.\",\n \"fee-charged-for-price-change\": \"§aTu pagaste §c{0}§a para cambiar el precio.\",\n \"not-allowed-to-create\": \"§cNo puedes crear una tienda aquí.\",\n \"how-much-to-trade-for\": \"§aIngrese en el chat, cuánto desea intercambiar §e{1}x {0}§a for.\",\n \"shops-backingup\": \"Crear copia de seguridad de la tienda a partir de la base de datos...\",\n \"_comment\": \"Edite este archivo después del formato con el formateador json\",\n \"unlimited-shop-owner-changed\": \"§eEl dueño de la tienda ilimitado ha sido cambiado a {0}.\",\n \"thats-not-a-number\": \"§cNúmero invalido\",\n \"console-only-danger\": \"§cThis is a dangerous command, so that only the Console can execute it.\",\n \"not-a-number\": \"§cYou can only input a number, your input was {0}.\",\n \"shop-removed-cause-ongoing-fee\": \"§cYour shop at {0} was removed because you didn't have enough money to keep it!\",\n \"tabcomplete\": {\n \"amount\": \"[amount]\",\n \"item\": \"[item]\",\n \"price\": \"[price]\",\n \"range\": \"[range]\",\n \"currency\": \"[currency name]\"\n },\n \"blacklisted-item\": \"§cYou cannot sell this item because it is on the blacklist\",\n \"command-type-mismatch\": \"§cThis command can only be executed by §b{0}.\",\n \"server-crash-warning\": \"§cServer may crash after execute /qs reload command if you replace/delete QuickShop plugin Jar file while server running.\",\n \"you-cant-afford-to-change-price\": \"§cIt costs {0} to change the price in your shop.\",\n \"forbidden-vanilla-behavior\": \"§cThe operation is forbidden due to it not being consisten with vanilla behaviour\",\n \"average-price-nearby\": \"§aNearby average price: §e{0}\",\n \"digits-reach-the-limit\": \"§cYou have reached the limits of decimals in the price.\",\n \"currency-unset\": \"§aShop currency removed successfully. Using default settings now.\",\n \"you-cant-create-shop-in-there\": \"§cYou don't have permission to create a shop at this location.\",\n \"no-pending-action\": \"§cYou do not have any pending actions\",\n \"refill-success\": \"§aRefill successful\",\n \"failed-to-paste\": \"§cFailed to upload the data to Pastebin. Check your internet connection and try again. (See console for details)\",\n \"how-many-buy-stack\": \"§eEnter in chat, how many bulks you wish to §bBUY§a. There are §e{0}§a items in each bulk and you can buy §e{1}§a bulks. Enter §ball§a in chat to buy all.\",\n \"language-name\": \"en-US\",\n \"exceeded-maximum\": \"§cThe value exceeded the maximum value in Java.\",\n \"unlimited-shop-owner-keeped\": \"§eAttention: The Shop Owner is still an unlimited Shop Owner, and you have to re-set the new Shop Owner by yourself.\",\n \"no-enough-money-to-keep-shops\": \"§cYou didn't have enough money to keep your shops! All shops have been removed...\",\n \"3rd-plugin-build-check-failed\": \"§c3rd party plugin §l{0}§r§c denied the permission checks, did you have permission set up in there?\",\n \"not-a-integer\": \"§cYou must input a integer, your input was {0}.\",\n \"translation-country\": \"Language Zone: English (en_US)\",\n \"buying-more-than-selling\": \"§cWARNING: You are buying items for more than you are selling them!\",\n \"purchase-failed\": \"§cPurchase failed: Internal Error. Please contact the Server Administrator.\",\n \"denied-put-in-item\": \"§cYou cannot put this item into your shop!\",\n \"shop-has-changed\": \"§cThe shop you tried to use has changed since you clicked it!\",\n \"flush-finished\": \"§aSuccessfully flushed the messages.\",\n \"no-price-given\": \"§cPlease give a valid price.\",\n \"shop-already-owned\": \"§cThis is already a shop.\",\n \"backup-success\": \"§aBackup successfull.\",\n \"not-looking-at-shop\": \"§cCould not find a QuickShop. You need to look at one.\",\n \"you-cant-afford-a-new-shop\": \"§cIt costs {0} to create a new shop.\",\n \"success-created-shop\": \"§cShop created.\",\n \"shop-creation-cancelled\": \"§cShop creation cancelled.\",\n \"shop-owner-self-trade\": \"§eYou trade with your own shop, so you might not gain any balance.\",\n \"player-bought-from-your-store-tax\": \"§c{0} purchased {1} {2} from your shop, and you earned {3} ({4} in taxes).\",\n \"not-enough-space\": \"§cYou only have room for {0} more!\",\n \"shop-staff-added\": \"§aSuccessfully added {0} as a staff member for your shop.\",\n \"shops-recovering\": \"Recovering shops from backup...\",\n \"menu\": {\n \"sell-tax\": \"§aYou paid §e{0} §ain taxes.\",\n \"owner\": \"§aOwner: {0}\",\n \"preview\": \"§b[Item Preview]\",\n \"enchants\": \"§5Enchantments\",\n \"sell-tax-self\": \"§aYou didn't pay taxes because you own this shop.\",\n \"shop-information\": \"§aShop Information:\",\n \"item\": \"§aItem: §e{0}\",\n \"price-per\": \"§aPrice per §e{0} §a- §e{1}\",\n \"item-name-and-price\": \"§e{0} {1} §afor §e{2}\",\n \"successful-purchase\": \"§aSuccessfully purchased:\",\n \"price-per-stack\": \"§aPrice per §e{2}x {0} - {1}\",\n \"stored-enchants\": \"§5Stored Enchantments\",\n \"item-holochat-error\": \"§c[Error]\",\n \"this-shop-is-selling\": \"§aThis shop is §bSELLING§a items.\",\n \"shop-stack\": \"§aAmount of bulk: §e{0}\",\n \"space\": \"§aSpace: §e{0}\",\n \"effects\": \"§aEffects\",\n \"damage-percent-remaining\": \"§e{0}% §aremaining.\",\n \"stock\": \"§aStock §e{0}\",\n \"this-shop-is-buying\": \"§aThis shop is §dBUYING§a items.\",\n \"successfully-sold\": \"§aSuccessfully sold:\",\n \"total-value-of-chest\": \"§aTotal value of chest: §e{0}\"\n },\n \"currency-not-exists\": \"§cCannot find the currency that you want to set. Maybe the spelling is wrong or that currency isn't available in this world.\",\n \"no-nearby-shop\": \"§cNo nearby shop matching {0}.\",\n \"translation-author\": \"Translator: Ghost_chu, Andre_601\",\n \"integrations-check-failed-trade\": \"§cIntegration {0} denied the Shop trading\",\n \"success-change-owner-to-server\": \"§aSuccessfully set the shop owner to Server.\",\n \"permission-denied-3rd-party\": \"§cPermission denied: 3rd Party Plugin [{0}].\",\n \"you-dont-have-that-many-items\": \"§cYou only have {0} {1}.\",\n \"complete\": \"§aComplete!\",\n \"translate-not-completed-yet-url\": \"The translation of the language {0} was not completed yet by {1}. Do you want to help us improving the translation? Browse: {2}\",\n \"success-removed-shop\": \"§aShop removed.\",\n \"currency-set\": \"§aShop currency successfully set to {0}.\",\n \"nothing-to-flush\": \"§aYou have no new shop messages.\",\n \"no-price-change\": \"§cThis wouldn't result in a price change!\",\n \"file-test\": \"This is a test text file. We use it to test if the messages.json is broken. You can fill it with any easter-eggs you like here :)\",\n \"unknown-player\": \"§cTarget player doesn't exist, please check the username you typed.\",\n \"language\": {\n \"qa-issues\": \"§eQuality assurance issues: §b{0}%\",\n \"code\": \"§eCode: §6{0}\",\n \"approval-progress\": \"§eApproval Progress: §b{0}%\",\n \"translate-progress\": \"§eTranslation Progress: §b{0}%\",\n \"name\": \"§eName: §6{0}\",\n \"help-us\": \"§a[Help us improve the translation quality]\"\n },\n \"warn-to-paste\": \"§eCollecting data and uploading it to Pastebin, this may take a while. §c§lWarning:§c The data is kept public for one week! It may leak your server configuration and other sensitive information. Make sure you only send it to §ltrusted staff/developers.\",\n \"how-many-sell-stack\": \"§aEnter in chat, how many bulk you wish to §dSELL§a. There are §e{0}§a items per bulk and you have §e{1}§a bulks available. Enter §ball§a in chat to sell all.\",\n \"updatenotify\": {\n \"buttontitle\": \"[Update Now]\",\n \"onekeybuttontitle\": \"[OneKey Update]\",\n \"label\": {\n \"unstable\": \"[Unstable]\",\n \"github\": \"[GitHub]\",\n \"stable\": \"[Stable]\",\n \"lts\": \"[LTS]\",\n \"spigotmc\": \"[SpigotMC]\",\n \"qualityverifyed\": \"[Quality]\",\n \"bukkitdev\": \"[BukkitDev]\",\n \"master\": \"[Master]\"\n },\n \"list\": [\n \"{0} was released. You are still using {1}!\",\n \"Boom! New update {0} incoming. Update!\",\n \"Surprise! {0} came out. You are on {1}\",\n \"Looks like you need to update. {0} was released!\",\n \"Ooops! {0} was now released. You are on {1}!\",\n \"I swear, QS has been updated to {0}. Why have you not updated yet?\",\n \"Fixing and re... Sorry, but {0} was released!\",\n \"Err! Nope. This is not an error. {0} has been released!\",\n \"OMG! {0} came out! Why are you still using {1}?\",\n \"Todays News: QuickShop has been updated to {0}!\",\n \"Plugin k.i.a. You should update to {0}!\",\n \"Update {0} ignited. Save update!\",\n \"There is an update available Commander. {0} has just came out!\",\n \"Look my style---{0} updated. You're still using {1}\",\n \"Ahhhhhhh! New update {0}! Update!\",\n \"What do you think? {0} has been released! Update!\",\n \"Doctor, QuickShop has a new update {0}! You should update~\",\n \"Ko~ko~da~yo~ QuickShop has a new update {0} ~\"\n ],\n \"remote-disable-warning\": \"§cThis version of QuickShop is marked as disabled by the remote server, which means this version may have serious problem, get details from our SpigotMC page: {0}. This warning will continue to appear until you switch to a stable version, but it will not affect your server's performance.\"\n },\n \"nearby-shop-entry\": \"§a- Info:{0} §aPrice:§b{1} §ax:§b{2} §ay:§b{3} §az:§b{4} §adistance: §b{5} §ablock(s)\",\n \"chest-title\": \"QuickShop Store\",\n \"console-only\": \"§cThis command can only be executed by Console.\",\n \"failed-to-put-sign\": \"§cNot enough space around the shop to place the info sign.\",\n \"shop-nolonger-freezed\": \"§aYou unfroze the shop. It's back to normal now!\",\n \"no-permission-build\": \"§cYou cannot build a shop here.\",\n \"tableformat\": {\n \"left_half_line\": \"+--------------------\",\n \"right_half_line\": \"--------------------+\",\n \"full_line\": \"+---------------------------------------------------+\",\n \"left_begin\": \"| \"\n },\n \"quickshop-gui-preview\": \"QuickShop GUI Item Preview\",\n \"translate-not-completed-yet-click\": \"The translation of the language {0} was not completed yet by {1}. Do you want to help us improving the translation? Click here!\",\n \"player-bought-from-your-store\": \"§c{0} purchased {1} {2} from your shop, and you earned {3}.\",\n \"reached-maximum-can-create\": \"§cYou already created a maximum of {0}/{1} shops!\",\n \"translation-version\": \"Support Version: Reremake\",\n \"no-double-chests\": \"§cYou cannot create the double chest shop.\",\n \"price-too-cheap\": \"§cPrice must be greater than §e${0}\",\n \"shop-not-exist\": \"§cThere is no shop.\",\n \"clean-warning\": \"§eThis command will purge §call §eshops if the shop is damaged, was created in not allowed worlds, is selling/buying not allowed items or §c§lEXISTS IN A UNLOADED WORLD§e. Make sure to create a full backup of your shop data first and use §b/qs cleanghost confirm §eto continue.\",\n \"shop-purchase-cancelled\": \"§cShop purchase cancelled.\",\n \"bypassing-lock\": \"§cBypassing a QuickShop lock!\",\n \"saved-to-path\": \"The Backup was saved to {0}.\",\n \"shop-now-freezed\": \"§aYou have frozen the shop. Nobody can trade with this shop now!\",\n \"price-is-now\": \"§aThe new price of the shop is §e{0}\",\n \"shops-arent-locked\": \"§cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!\",\n \"that-is-locked\": \"§cThis shop is locked.\",\n \"shop-has-no-space\": \"§cThe shop only has room for {0} more {1}.\",\n \"shop-stock-too-low\": \"§cThe shop only has {0} {1} left!\",\n \"world-not-exists\": \"§cThe world §e{0}§c doesn't exist\",\n \"how-many-sell\": \"§aEnter in chat, how much you wish to §dSELL§a. You have §e{0}§a available. Enter §ball§a in chat, to sell all.\",\n \"shop-freezed-at-location\": \"§eYour shop {0} at {1} got frozen!\",\n \"translation-contributors\": \"Contributors: Timtower, Netherfoam, KaiNoMood, Mgazul, JackTheChicken and Andre_601\",\n \"empty-success\": \"§aEmptying shop successful\",\n \"supertool-is-disabled\": \"§cSupertool is disabled. Cannot break any shops.\",\n \"unknown-owner\": \"Unknown\",\n \"restricted-prices\": \"§cRestricted price for {0}: Min {1}, max {2}\",\n \"nearby-shop-this-way\": \"§aShop is {0} blocks away from you.\",\n \"owner-bypass-check\": \"§eBypassed all checks. Trade successful! (You are now the shop owner!)\",\n \"signs\": {\n \"item\": \"{0}\",\n \"out-of-space\": \"Out of Space\",\n \"unlimited\": \"Unlimited\",\n \"stack-selling\": \"Selling {0}\",\n \"stack-price\": \"{0} per {1}x {2}\",\n \"status-unavailable\": \"§c\",\n \"out-of-stock\": \"Out of Stock\",\n \"stack-buying\": \"Buying {0}\",\n \"freeze\": \"Trading disabled\",\n \"price\": \"{0} each\",\n \"buying\": \"Buying {0}\",\n \"header\": \"{1}{0}\",\n \"selling\": \"Selling {0}\",\n \"status-available\": \"§a\"\n },\n \"negative-amount\": \"§cYou can't trade negative amounts\",\n \"shop-staff-deleted\": \"§aSuccessfully removed {0} as a staff member for your shop.\",\n \"nearby-shop-header\": \"§aNearby Shop matching §b{0}§a:\",\n \"backup-failed\": \"Cannot backup the database. Check the console for details.\",\n \"shop-staff-cleared\": \"§aSuccessfully removed all staff members from your shop.\",\n \"price-too-high\": \"§cThe shop price is too high! You cannot create one with a price higher than {0}.\",\n \"player-sold-to-your-store\": \"§a{0} sold {1} {2} to your shop.\",\n \"shop-out-of-stock\": \"§5Your shop at {0}, {1}, {2} has run out of {3}!\",\n \"how-many-buy\": \"§aEnter in chat, how many you wish to §bBUY§a. You can buy §e{0}§a. Enter §ball§a to buy them all.\",\n \"language-info-panel\": {\n \"help\": \"Help us: \",\n \"code\": \"Code: \",\n \"name\": \"Language: \",\n \"progress\": \"Progress: \",\n \"translate-on-crowdin\": \"[Translate on Crowdin]\"\n },\n \"item-not-exist\": \"§cThe item §e{0} §cdoes not exist, please check your spelling.\",\n \"shop-creation-failed\": \"§cShop creation failed, please contact with server administrator.\",\n \"no-creative-break\": \"§cYou cannot break other players shops in creative mode, switch to survival mode or try to use the supertool {0} instead.\",\n \"booleanformat\": {\n \"success\": \"§a✔\",\n \"failed\": \"§c✘\"\n },\n \"controlpanel\": {\n \"stack\": \"§aPer bulk amount: §b{0} §e[§d§lChange§e]\",\n \"price-hover\": \"§eClick to set a new price for the item.\",\n \"remove\": \"§c§l[Remove Shop]\",\n \"mode-buying-hover\": \"§eClick to change the shop to SELL mode.\",\n \"empty\": \"§aEmpty: Remove all items §e[§d§lOK§e]\",\n \"stack-hover\": \"§eClick to set the amount of item per bulk. Set to 1 for normal behaviour.\",\n \"setowner\": \"§aOwner: §b{0} §e[§d§lChange§e]\",\n \"freeze\": \"§eFreeze mode: §b{0} §e[§d§lToggle§e]\",\n \"price\": \"§aPrice: §b{0} §e[§d§lChange§e]\",\n \"currency-hover\": \"§eClick to set or remove the currency that this shop is using\",\n \"lock\": \"§eShop lock: §b{0} §e[§d§lToggle§e]\",\n \"mode-selling\": \"§aShop mode: §bSelling §e[§d§lChange§e]\",\n \"currency\": \"§aCurrency: §b{0} §e[§d§lSet§e]\",\n \"setowner-hover\": \"§eClick to switch owner.\",\n \"mode-buying\": \"§aShop mode: §bBuying §e[§d§lChange§e]\",\n \"item\": \"§aShop Item: {0} §e[§d§lChange§e]\",\n \"unlimited\": \"§aUnlimited: {0} §e[§d§lChange§e]\",\n \"unlimited-hover\": \"§eClick to toggle if the shop is unlimited.\",\n \"refill-hover\": \"§eClick to refill the shop.\",\n \"remove-hover\": \"§eClick to remove this shop.\",\n \"refill\": \"§aRefill: Refill the items §e[§d§lOK§e]\",\n \"freeze-hover\": \"§eToggle the shop's freeze status.\",\n \"lock-hover\": \"§eEnable/Disable the shop's lock protection.\",\n \"item-hover\": \"§eClick to change shop Item\",\n \"infomation\": \"§aShop Control panel:\",\n \"mode-selling-hover\": \"§eClick to change the shop to BUY mode.\",\n \"empty-hover\": \"§eClick to clear the inventory of the shop.\"\n },\n \"command\": {\n \"reloading\": \"§aReloading...\",\n \"description\": {\n \"buy\": \"§eChanges a shop to §dBUY§e mode\",\n \"about\": \"§eShows QuickShop info\",\n \"language\": \"§eChange the currently used language\",\n \"paste\": \"§eUploads server data to Pastebin\",\n \"title\": \"§aQuickShop help\",\n \"remove\": \"§eRemoves the shop you're looking at\",\n \"ban\": \"§eBan a player from the shop\",\n \"empty\": \"§eRemoves all items from a shop\",\n \"setowner\": \"§eChanges the ownership of a shop.\",\n \"reload\": \"§eReloads the config.yml of QuickShop\",\n \"freeze\": \"§eDisable or Enable shop trading\",\n \"price\": \"§eChanges the buy/sell price of a shop\",\n \"find\": \"§eLocates the nearest shop of a specific type.\",\n \"create\": \"§eCreates a new shop from the targeted chest\",\n \"lock\": \"§eSwitch the shop's lock status\",\n \"currency\": \"§eSet or remove the currency setting of the shop\",\n \"removeworld\": \"§eRemove ALL shops in a specified world\",\n \"info\": \"§eShow QuickShop statistics\",\n \"owner\": \"§eChanges the ownership of a shop.\",\n \"amount\": \"§eTo set item amount (Useful when having chat issues)\",\n \"item\": \"§eChange shop item of a shop\",\n \"debug\": \"§eEnables Developer mode\",\n \"unlimited\": \"§eGives a shop unlimited stock.\",\n \"sell\": \"§eChanges a shop to §bSELL§e mode\",\n \"fetchmessage\": \"§eShow unread shop messages\",\n \"staff\": \"§eManage your shop staff\",\n \"clean\": \"§eRemoves all (loaded) shops without any stock\",\n \"refill\": \"§eAdds a given number of items to a shop\",\n \"help\": \"§eShows QuickShop help\",\n \"removeall\": \"§eRemove ALL shops of a specified player\",\n \"unban\": \"§eUnban a player from the shop\",\n \"transfer\": \"§eTransfer someone's ALL shops to other\",\n \"size\": \"§eChange per bulk amount of a shop\",\n \"supercreate\": \"§eCreate a shop while bypassing all protection checks\"\n },\n \"bulk-size-not-set\": \"§cUsage: /qs size \",\n \"no-type-given\": \"§cUsage: /qs find \",\n \"feature-not-enabled\": \"This feature is not enabled in the config file.\",\n \"now-debuging\": \"§aSuccessfully enabled developer mode. Reloading QuickShop...\",\n \"no-amount-given\": \"§cNo amount provided. Use §a/qs refill §c\",\n \"no-owner-given\": \"§cNo owner provided\",\n \"disabled\": \"§cThis command is disabled: §e{0}\",\n \"bulk-size-now\": \"§aNow trading §e{0}x {1}\",\n \"cleaning\": \"§aRemoving shops without any stock...\",\n \"now-nolonger-debuging\": \"§aSuccessfully disabled Developer mode. Reloading QuickShop...\",\n \"toggle-unlimited\": {\n \"limited\": \"§aShop is now limited\",\n \"unlimited\": \"§aShop is now unlimited\"\n },\n \"transfer-success-other\": \"§aTransferred §e{0} {1}§a's shop(s) to §e{2}\",\n \"no-trade-item\": \"§aPlease hold a trade item to change in main hand\",\n \"wrong-args\": \"§cInvalid argument. Use §l/qs help §cto see a list of commands.\",\n \"some-shops-removed\": \"§e{0} §ashop(s) removed\",\n \"new-owner\": \"§aNew owner: §e{0}\",\n \"transfer-success\": \"§aTransferred §e{0} §ashop(s) to §e{1}\",\n \"now-buying\": \"§aNow §dBUYING §e{0}\",\n \"now-selling\": \"§aNow §bSELLING §e{0}\",\n \"cleaned\": \"§aRemoved §e{0}§a shops.\",\n \"trade-item-now\": \"§aNow trading §e{0}x {1}\",\n \"no-world-given\": \"§cPlease specify a world name\",\n \"invalid-bulk-amount\": \"§cThe given value {0} is larger than max stack size or lower than one\"\n },\n \"currency-not-support\": \"§cThe economy plugin doesn't support the multi-economy feature.\",\n \"trading-in-creative-mode-is-disabled\": \"§cYou cannot trade with this shop while being in creative mode.\",\n \"the-owner-cant-afford-to-buy-from-you\": \"§cThis costs {0}, but the shop-owner only has {1}\",\n \"integrations-check-failed-create\": \"§cIntegration {0} denied the shop-creation\",\n \"shop-out-of-space\": \"§5Your shop at {0}, {1}, {2} is now full.\",\n \"admin-shop\": \"AdminShop\",\n \"no-anythings-in-your-hand\": \"§cThere is nothing in your hand.\",\n \"no-permission\": \"§cYou do not have permission to do that.\",\n \"chest-was-removed\": \"§cThe chest was removed.\",\n \"you-cant-afford-to-buy\": \"§cIt costs {0}, but you only have {1}\",\n \"shops-removed-in-world\": \"§eTotal §b{0}§e shops has been deleted in world §b{1}§e.\",\n \"language-version\": 58,\n \"not-managed-shop\": \"§cYou are not the owner or moderator of this Shop\",\n \"shop-cannot-trade-when-freezing\": \"§cYou cannot trade with this shop because it is frozen.\"\n}", "format-disabled": "&c/{0} {1} &7- {2}", "toggle-unlimited": { "unlimited": "&aLa tienda ahora es ilimitada.",