From 1becd6b450d8ff0efe44946748021cd480d5c5fe Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:37:42 +0800 Subject: [PATCH 1/5] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/de-DE/messages.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index 168e5b5f9e..04ec14b9ef 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -92,7 +92,7 @@ player-bought-from-your-store-tax: {0} hat {1} {2} von deinem Shop gekauf not-enough-space: Du hast nur Platz für {0} weitere! shop-name-success: Shopname erfolgreich geändert zu {0}. shop-staff-added: {0} wurde erfolgreich als Shopmitarbeiter zu deinem Shop hinzugefügt. -shop-staff-empty: This shop have no staff members. +shop-staff-empty: Dieser Shop hat keine Mitarbeiter. shops-recovering: Stelle Shops von Backups wieder her... virtual-player-component-hover: "Dies ist ein virtueller Spieler.\nBezieht sich auf ein Systemkonto mit dem selben Namen.\nUUID: {0}\nBenutzername: {1}\nAngezeigt als: {2}" real-player-component-hover: "Dies ist ein echter existierender Spieler.\nUUID: {0}\nBenutzername: {1}\nAngezeigt als: {2}\nWenn du ein virtuelles Systemkonto mit demselben Namen verwenden willst, füge \"[]\" an beiden enden des Namens hinzu: [{1}]." @@ -287,7 +287,7 @@ unknown-owner: Unbekannt restricted-prices: 'Eingeschränkter Preis für {0}: Mindestens {1}, maximal {2}' nearby-shop-this-way: Shop ist {0} Blöcke von dir entfernt. owner-bypass-check: Alle Prüfungen wurden umgangen. Handel erfolgreich! (Sie sind jetzt der Besitzer des Ladens!) -april-rick-and-roll-easter-egg: "Click here to acquire your time limited rewards that provided by QuickShop-Hikari developer!" +april-rick-and-roll-easter-egg: "Klicke hier um eine limitierte Belohnung von den QuickShop-Hikari Entwicklern zu erhalten!" signs: item-right: '' out-of-space: Kein Platz @@ -445,8 +445,8 @@ command: benefit: Einstellungen zum aufteilen von Vorteilen zwischen Schobeigentümer und anderen Spielern tag: Shop-Tags hinzufügen, entfernen oder abfragen suggestprice: Empfiehlt einen Preis für den angesehenen Shop, basierend auf anderen Shops - history: View the history transactions of a shop - sign: Change the sign material of a shop + history: Zeige den Transaktionsverlauf eines Shops + sign: Ändere das Material des Schildes eines Shops bulk-size-not-set: 'Verwendung: /qs size ' no-type-given: 'Verwendung: /qs find ' feature-not-enabled: Dieses Feature ist nicht in der Config Datei aktiviert. From 843bf7b040dcb888c5114ade16ae4b9579ab433c Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Sat, 13 Apr 2024 17:08:20 +0800 Subject: [PATCH 2/5] always returns -1 for unlimited shop --- .../com/ghostchu/quickshop/shop/ContainerShop.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java index 63ce4706a2..f8afbff1dd 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java @@ -584,10 +584,10 @@ public void setPrice(double price) { */ @Override public int getRemainingSpace() { + if (this.unlimited) { + return -1; + } if (Bukkit.isPrimaryThread()) { - if (this.unlimited) { - return -1; - } if (this.getInventory() == null) { Log.debug("Failed to calc RemainingSpace for shop " + this + ": Inventory null."); return 0; @@ -608,10 +608,10 @@ public int getRemainingSpace() { */ @Override public int getRemainingStock() { + if (this.unlimited) { + return -1; + } if (Bukkit.isPrimaryThread()) { - if (this.unlimited) { - return -1; - } if (this.getInventory() == null) { Log.debug("Failed to calc RemainingStock for shop " + this + ": Inventory null."); return 0; From cf910e65f1e22f4abe1d36fa9907789ba519ad4a Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Wed, 17 Apr 2024 12:58:56 +0800 Subject: [PATCH 3/5] Fix startup error without ProtocolLib --- .../src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java index aee5cc3dcf..d9737464b2 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java @@ -5,7 +5,7 @@ import com.alessiodp.libby.LibraryManager; import com.alessiodp.libby.logging.adapters.JDKLogAdapter; import com.alessiodp.libby.logging.adapters.LogAdapter; -import com.comphenix.protocol.utility.Util; +import com.ghostchu.quickshop.common.util.CommonUtil; import com.ghostchu.quickshop.common.util.GeoUtil; import com.ghostchu.quickshop.platform.Platform; import com.ghostchu.quickshop.platform.paper.PaperPlatform; @@ -181,7 +181,7 @@ private void loadLibraries(LibraryManager manager) { testClass = cases[1]; } if (testClass != null) { - if (Util.classExists(testClass) && Boolean.parseBoolean(System.getProperty("com.ghostchu.quickshop.QuickShopBukkit.reuseDependencies", "false"))) { + if (CommonUtil.isClassAvailable(testClass) && Boolean.parseBoolean(System.getProperty("com.ghostchu.quickshop.QuickShopBukkit.reuseDependencies", "false"))) { skipped++; continue; } From 241634746252fb4ea31e6cae709f0e5f7376fd8b Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Wed, 17 Apr 2024 13:11:34 +0800 Subject: [PATCH 4/5] Don't load other world shops while specific world loading --- .../ghostchu/quickshop/api/database/DatabaseHelper.java | 2 ++ .../quickshop/database/SimpleDatabaseHelperV2.java | 9 ++++++++- .../java/com/ghostchu/quickshop/shop/ShopLoader.java | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/database/DatabaseHelper.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/database/DatabaseHelper.java index f4a659ba28..4527401058 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/database/DatabaseHelper.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/database/DatabaseHelper.java @@ -114,6 +114,8 @@ public interface DatabaseHelper { @NotNull List listShops(boolean deleteIfCorrupt); + @NotNull List listShops(@Nullable String worldFilter, boolean deleteIfCorrupt); + @NotNull List listShopsTaggedBy(@NotNull UUID tagger, @NotNull String tag); @NotNull List listTags(@NotNull UUID tagger); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/database/SimpleDatabaseHelperV2.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/database/SimpleDatabaseHelperV2.java index 472a1147be..9317b9c214 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/database/SimpleDatabaseHelperV2.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/database/SimpleDatabaseHelperV2.java @@ -432,6 +432,10 @@ public void insertTransactionRecord(@Nullable UUID from, @Nullable UUID to, doub @Override public @NotNull List listShops(boolean deleteIfCorrupt) { + return listShops(null, deleteIfCorrupt); + } + @Override + public @NotNull List listShops(@Nullable String worldFilter, boolean deleteIfCorrupt) { List shopRecords = new ArrayList<>(); String SQL = "SELECT * FROM " + DataTables.DATA.getName() + " INNER JOIN " + DataTables.SHOPS.getName() @@ -441,11 +445,14 @@ public void insertTransactionRecord(@Nullable UUID from, @Nullable UUID to, doub try (SQLQuery query = manager.createQuery().withPreparedSQL(SQL).execute()) { ResultSet rs = query.getResultSet(); while (rs.next()) { + String world = rs.getString("world"); + if (worldFilter != null && !worldFilter.equals(world)) { + continue; + } long shopId = rs.getLong("shop"); int x = rs.getInt("x"); int y = rs.getInt("y"); int z = rs.getInt("z"); - String world = rs.getString("world"); DataRecord dataRecord = new SimpleDataRecord(plugin.getPlayerFinder(), rs); InfoRecord infoRecord = new ShopInfo(shopId, world, x, y, z); shopRecords.add(new ShopRecord(dataRecord, infoRecord)); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ShopLoader.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ShopLoader.java index fbf72851fa..022dc0b9c9 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ShopLoader.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ShopLoader.java @@ -82,7 +82,7 @@ public void loadShops(@Nullable String worldName) { boolean deleteCorruptShops = plugin.getConfig().getBoolean("debug.delete-corrupt-shops", false); plugin.logger().info("Loading shops from database..."); Timer dbFetchTimer = new Timer(true); - List records = plugin.getDatabaseHelper().listShops(deleteCorruptShops); + List records = plugin.getDatabaseHelper().listShops(worldName, deleteCorruptShops); plugin.logger().info("Used {}ms to fetch {} shops from database.", dbFetchTimer.stopAndGetTimePassed(), records.size()); plugin.logger().info("Loading shops into memory..."); Timer shopTotalTimer = new Timer(true); From 2ff499ac8eeea4cf992369b1ce9a6e701e4138f6 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Wed, 17 Apr 2024 13:13:45 +0800 Subject: [PATCH 5/5] Bump version --- .run/quickshop-hikari update version.run.xml | 2 +- addon/bluemap/pom.xml | 2 +- addon/discordsrv/pom.xml | 2 +- addon/discount/pom.xml | 2 +- addon/displaycontrol/pom.xml | 2 +- addon/dynmap/pom.xml | 2 +- addon/limited/pom.xml | 2 +- addon/list/pom.xml | 2 +- addon/plan/pom.xml | 2 +- addon/reremake-migrator/pom.xml | 2 +- addon/shopitemonly/pom.xml | 2 +- compatibility/advancedregionmarket/pom.xml | 2 +- compatibility/angelchest/pom.xml | 2 +- compatibility/bentobox/pom.xml | 2 +- compatibility/bungeecord-geyser/pom.xml | 2 +- compatibility/bungeecord/pom.xml | 2 +- compatibility/chestprotect/pom.xml | 2 +- compatibility/clearlag/pom.xml | 2 +- compatibility/common/pom.xml | 2 +- compatibility/ecoenchants/pom.xml | 2 +- compatibility/elitemobs/pom.xml | 2 +- compatibility/griefprevention/pom.xml | 2 +- compatibility/itemsadder/pom.xml | 2 +- compatibility/lands/pom.xml | 2 +- compatibility/openinv/pom.xml | 2 +- compatibility/plotsquared/pom.xml | 2 +- compatibility/reforges/pom.xml | 2 +- compatibility/residence/pom.xml | 2 +- compatibility/slimefun/pom.xml | 2 +- compatibility/superiorskyblock/pom.xml | 2 +- compatibility/towny/pom.xml | 2 +- compatibility/velocity/pom.xml | 2 +- compatibility/voidchest/pom.xml | 2 +- compatibility/worldedit/pom.xml | 2 +- compatibility/worldguard/pom.xml | 2 +- platform/quickshop-platform-interface/pom.xml | 2 +- platform/quickshop-platform-paper/pom.xml | 2 +- platform/quickshop-platform-spigot-abstract/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_18_R1/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_18_R2/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_19_R1/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_19_R2/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_19_R3/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_20_R1/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_20_R2/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_20_R3/pom.xml | 2 +- pom.xml | 2 +- quickshop-api/pom.xml | 2 +- quickshop-bukkit/pom.xml | 2 +- quickshop-common/pom.xml | 2 +- 50 files changed, 50 insertions(+), 50 deletions(-) diff --git a/.run/quickshop-hikari update version.run.xml b/.run/quickshop-hikari update version.run.xml index 0ee3b31802..6eebdcdf6e 100644 --- a/.run/quickshop-hikari update version.run.xml +++ b/.run/quickshop-hikari update version.run.xml @@ -13,7 +13,7 @@