From d5775615d705ac76a6fbf73c27468975deb6a6e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:38:37 +0000 Subject: [PATCH 01/81] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- compatibility/common/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compatibility/common/pom.xml b/compatibility/common/pom.xml index 78bc66a1af..a4d122275f 100644 --- a/compatibility/common/pom.xml +++ b/compatibility/common/pom.xml @@ -27,7 +27,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 org.apache.maven.plugins diff --git a/pom.xml b/pom.xml index fabeea9b4d..39aa5c22a9 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 ${java.version} ${java.version} From 7c9f46793acfccefe6dc4b89631beea647480174 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:38:50 +0000 Subject: [PATCH 02/81] Bump org.projectlombok:lombok from 1.18.30 to 1.18.32 Bumps [org.projectlombok:lombok](https://github.com/projectlombok/lombok) from 1.18.30 to 1.18.32. - [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown) - [Commits](https://github.com/projectlombok/lombok/compare/v1.18.30...v1.18.32) --- updated-dependencies: - dependency-name: org.projectlombok:lombok 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 fabeea9b4d..ecd2a94c79 100644 --- a/pom.xml +++ b/pom.xml @@ -321,7 +321,7 @@ org.projectlombok lombok - 1.18.30 + 1.18.32 provided From 1169be9e052e248a956a72f4ce0e19a920400a82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:18:53 +0000 Subject: [PATCH 03/81] Bump net.tnemc:EconomyCore from 0.1.2.8-Release-1 to 0.1.2.9-Release-1 Bumps net.tnemc:EconomyCore from 0.1.2.8-Release-1 to 0.1.2.9-Release-1. --- updated-dependencies: - dependency-name: net.tnemc:EconomyCore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- quickshop-bukkit/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 289246062a..88240bb889 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -175,7 +175,7 @@ net.tnemc EconomyCore - 0.1.2.8-Release-1 + 0.1.2.9-Release-1 provided From 86c86d7349659b0a4aedb15c2b4791ab765d82da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:19:21 +0000 Subject: [PATCH 04/81] Bump net.kyori:adventure-text-serializer-ansi from 4.15.0 to 4.16.0 Bumps [net.kyori:adventure-text-serializer-ansi](https://github.com/KyoriPowered/adventure) from 4.15.0 to 4.16.0. - [Release notes](https://github.com/KyoriPowered/adventure/releases) - [Commits](https://github.com/KyoriPowered/adventure/compare/v4.15.0...v4.16.0) --- updated-dependencies: - dependency-name: net.kyori:adventure-text-serializer-ansi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- quickshop-common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index 0ecfe2e524..f31292ab89 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -136,7 +136,7 @@ net.kyori adventure-text-serializer-ansi compile - 4.15.0 + 4.16.0 net.kyori From 7777993bc349701696e3f476e1793acc397c7699 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:19:34 +0000 Subject: [PATCH 05/81] Bump net.kyori:adventure-text-logger-slf4j from 4.15.0 to 4.16.0 Bumps [net.kyori:adventure-text-logger-slf4j](https://github.com/KyoriPowered/adventure) from 4.15.0 to 4.16.0. - [Release notes](https://github.com/KyoriPowered/adventure/releases) - [Commits](https://github.com/KyoriPowered/adventure/compare/v4.15.0...v4.16.0) --- updated-dependencies: - dependency-name: net.kyori:adventure-text-logger-slf4j dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- quickshop-common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index 0ecfe2e524..dcae25c7a3 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -124,7 +124,7 @@ net.kyori adventure-text-logger-slf4j compile - 4.15.0 + 4.16.0 net.kyori From 8598147b04e7fcfe97986ab09b1959257a021098 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:19:53 +0000 Subject: [PATCH 06/81] Bump net.kyori:adventure-text-serializer-gson-legacy-impl Bumps [net.kyori:adventure-text-serializer-gson-legacy-impl](https://github.com/KyoriPowered/adventure) from 4.15.0 to 4.16.0. - [Release notes](https://github.com/KyoriPowered/adventure/releases) - [Commits](https://github.com/KyoriPowered/adventure/compare/v4.15.0...v4.16.0) --- updated-dependencies: - dependency-name: net.kyori:adventure-text-serializer-gson-legacy-impl dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- quickshop-common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index 0ecfe2e524..fd7241ffff 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -148,7 +148,7 @@ net.kyori adventure-text-serializer-gson-legacy-impl compile - 4.15.0 + 4.16.0 net.kyori From 1151055d33f5a69868ca13ba53a8a4ed151ee6e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:19:29 +0000 Subject: [PATCH 07/81] Bump com.willfp:eco from 6.69.0 to 6.69.2 Bumps com.willfp:eco from 6.69.0 to 6.69.2. --- updated-dependencies: - dependency-name: com.willfp:eco dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- compatibility/ecoenchants/pom.xml | 2 +- compatibility/reforges/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compatibility/ecoenchants/pom.xml b/compatibility/ecoenchants/pom.xml index 00a2c219a7..9a2a907dbf 100644 --- a/compatibility/ecoenchants/pom.xml +++ b/compatibility/ecoenchants/pom.xml @@ -75,7 +75,7 @@ com.willfp eco - 6.69.0 + 6.69.2 provided diff --git a/compatibility/reforges/pom.xml b/compatibility/reforges/pom.xml index 43b6dca9b2..b49917ff78 100644 --- a/compatibility/reforges/pom.xml +++ b/compatibility/reforges/pom.xml @@ -75,7 +75,7 @@ com.willfp eco - 6.69.0 + 6.69.2 provided From 324dd0c49ab4e4caa06bc75ccfea6928d3070fd5 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Thu, 25 Apr 2024 01:37:57 +0800 Subject: [PATCH 08/81] Initial 1.20.5 update (incomplete, un-tested) --- .../pom.xml | 123 ++++++++++++++++++ .../spigot/v1_20_4/Spigot1205Platform.java | 110 ++++++++++++++++ pom.xml | 1 + .../ghostchu/quickshop/api/GameVersion.java | 1 + quickshop-bukkit/pom.xml | 6 + .../ghostchu/quickshop/QuickShopBukkit.java | 2 + 6 files changed, 243 insertions(+) create mode 100644 platform/quickshop-platform-spigot-v1_20_R4/pom.xml create mode 100644 platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml new file mode 100644 index 0000000000..5ef760a98f --- /dev/null +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -0,0 +1,123 @@ + + + + 4.0.0 + + + com.ghostchu + quickshop-hikari + 6.1.0.2 + ../../pom.xml + + + quickshop-platform-spigot-v1_20_R4 + jar + + quickshop-platform-spigot-v1_20_R4 + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + net.md-5 + specialsource-maven-plugin + 2.0.2 + + + package + + remap + + remap-obf + + org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:txt:maps-mojang + true + org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-mojang + + true + remapped-obf + + + + package + + remap + + remap-spigot + + + ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar + + org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:csrg:maps-spigot + org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-obf + + + + + + + + + src/main/resources + true + + + + + + + nms-repo + https://repo.codemc.io/repository/nms/ + + + CodeMC + https://repo.codemc.io/repository/maven-public/ + + + + + + com.ghostchu + quickshop-platform-interface + ${parent.version} + compile + + + com.ghostchu + quickshop-platform-spigot-abstract + ${parent.version} + compile + + + org.spigotmc + spigot + 1.20.5-R0.1-SNAPSHOT + remapped-mojang + provided + + + org.spigotmc + spigot-api + 1.20.5-R0.1-SNAPSHOT + provided + + + de.tr7zw + item-nbt-api-plugin + 2.12.3 + provided + + + * + * + + + + + diff --git a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java new file mode 100644 index 0000000000..2148769408 --- /dev/null +++ b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java @@ -0,0 +1,110 @@ +package com.ghostchu.quickshop.platform.spigot.v1_20_4; + +import com.ghostchu.quickshop.platform.Platform; +import com.ghostchu.quickshop.platform.Util; +import com.ghostchu.quickshop.platform.spigot.AbstractSpigotPlatform; +import net.kyori.adventure.key.Key; +import net.kyori.adventure.nbt.api.BinaryTagHolder; +import net.kyori.adventure.text.event.HoverEvent; +import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.Tag; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.command.Command; +import org.bukkit.craftbukkit.v1_20_R4.CraftServer; +import org.bukkit.craftbukkit.v1_20_R4.enchantments.CraftEnchantment; +import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_20_R4.potion.CraftPotionEffectType; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.EntityType; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionEffectTypeWrapper; +import org.jetbrains.annotations.NotNull; + +public class Spigot1205Platform extends AbstractSpigotPlatform implements Platform { + + public Spigot1205Platform(@NotNull Plugin plugin) { + super(plugin); + } + + @Override + public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { + NamespacedKey namespacedKey = stack.getType().getKey(); + Key key = Key.key(namespacedKey.toString()); + RegistryAccess access = ((CraftServer) Bukkit.getServer()).getServer().registryAccess(); + Tag tag = CraftItemStack.asNMSCopy(stack).save(access); + BinaryTagHolder holder; + if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { + holder = BinaryTagHolder.binaryTagHolder(tag.toString()); + } else { + //noinspection UnstableApiUsage + holder = BinaryTagHolder.of(tag.toString()); + } + return HoverEvent.showItem(key, stack.getAmount(), holder); + } + + @Override + public @NotNull String getMinecraftVersion() { + try { + return ((CraftServer) Bukkit.getServer()).getServer().getServerVersion(); + } catch (Exception e) { + return super.getMinecraftVersion(); + } + } + + @Override + public void registerCommand(@NotNull String prefix, @NotNull Command command) { + ((CraftServer) Bukkit.getServer()).getCommandMap().register(prefix, command); + command.register(((CraftServer) Bukkit.getServer()).getCommandMap()); + ((CraftServer) Bukkit.getServer()).syncCommands(); + } + + @Override + public @NotNull String getTranslationKey(@NotNull Material material) { + if (material.isBlock()) { + return postProcessingTranslationKey(Bukkit.getUnsafe().getBlockTranslationKey(material)); + } else { + return postProcessingTranslationKey(Bukkit.getUnsafe().getItemTranslationKey(material)); + } + } + + + private String postProcessingTranslationKey(String key) { + return this.translationMapping.getOrDefault(key, key); + } + + @Override + public @NotNull String getTranslationKey(@NotNull EntityType type) { + //noinspection deprecation + return postProcessingTranslationKey(Bukkit.getUnsafe().getTranslationKey(type)); +// Optional> op = net.minecraft.world.entity.EntityType.byString(type.getKey().toString()); +// if (op.isPresent()) { +// return postProcessingTranslationKey(op.get().getDescriptionId()); +// } else { +// return postProcessingTranslationKey("entity." + type.getKey()); +// } + } + + @Override + public @NotNull String getTranslationKey(@NotNull PotionEffectType potionEffectType) { + if (potionEffectType instanceof PotionEffectTypeWrapper wrapper) { + potionEffectType = wrapper.getType(); + } + CraftPotionEffectType craftPotionEffectType = (CraftPotionEffectType) potionEffectType; + return postProcessingTranslationKey(craftPotionEffectType.getHandle().getDescriptionId()); + } + + @Override + public @NotNull String getTranslationKey(@NotNull Enchantment enchantment) { + CraftEnchantment craftEnchantment = (CraftEnchantment) enchantment; + return postProcessingTranslationKey(craftEnchantment.getHandle().getDescriptionId()); + } + + @Override + public @NotNull String getTranslationKey(@NotNull ItemStack stack) { + return postProcessingTranslationKey(stack.getTranslationKey()); + } +} diff --git a/pom.xml b/pom.xml index 6acfcb6153..623436c8db 100644 --- a/pom.xml +++ b/pom.xml @@ -357,6 +357,7 @@ platform/quickshop-platform-spigot-v1_20_R1 platform/quickshop-platform-spigot-v1_20_R2 platform/quickshop-platform-spigot-v1_20_R3 + platform/quickshop-platform-spigot-v1_20_R4 platform/quickshop-platform-paper quickshop-bukkit compatibility/common diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java index 0ba40fea78..5097235e04 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java @@ -48,6 +48,7 @@ public enum GameVersion { v1_20_R1(true, true, true, true, true, true), v1_20_R2(true, false, true, true, true, true), v1_20_R3(true, false, true, true, true, true), + v1_20_R4(true, false, true, true, true, true), UNKNOWN(true, false, false, true, true, true); /** * CoreSupports - Check does QuickShop most features supports this server version diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 2dd3086874..ffb4427b11 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -121,6 +121,12 @@ ${parent.version} compile + + com.ghostchu + quickshop-platform-spigot-v1_20_R4 + ${parent.version} + compile + com.ghostchu quickshop-platform-paper 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 9070e88c99..88a8e92bf8 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShopBukkit.java @@ -18,6 +18,7 @@ import com.ghostchu.quickshop.platform.spigot.v1_20_1.Spigot1201Platform; import com.ghostchu.quickshop.platform.spigot.v1_20_2.Spigot1202Platform; import com.ghostchu.quickshop.platform.spigot.v1_20_3.Spigot1203Platform; +import com.ghostchu.quickshop.platform.spigot.v1_20_4.Spigot1205Platform; import com.ghostchu.quickshop.util.PackageUtil; import com.vdurmont.semver4j.Semver; import io.papermc.lib.PaperLib; @@ -256,6 +257,7 @@ private void loadPlatform() throws Exception { case "v1_20_R1" -> new Spigot1201Platform(this); case "v1_20_R2" -> new Spigot1202Platform(this); case "v1_20_R3" -> new Spigot1203Platform(this); + case "v1_20_R4" -> new Spigot1205Platform(this); default -> { bootstrapLogger.warning("This server running " + internalNMSVersion + " not supported by Hikari. (Try update? or Use Paper's fork to get cross-platform compatibility.)"); Bukkit.getPluginManager().disablePlugin(this); From 4f32ba7d111768a3baa998edc0cf394747a372aa Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Thu, 25 Apr 2024 04:17:18 +0800 Subject: [PATCH 09/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/it-IT/messages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index c17d75a36e..d476896807 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -92,9 +92,9 @@ player-bought-from-your-store-tax: {0} ha acquistato {1} {2} dal tuo nego not-enough-space: Hai spazio solo per altri {0}! shop-name-success: Impostato con successo il nome del negozio a {0}. shop-staff-added: Aggiunto con successo {0} come membro dello staff per il tuo negozio. -shop-staff-empty: This shop have no staff members. +shop-staff-empty: Questo negozio non ha membri dello staff. shops-recovering: Recupero negozi dal backup... -virtual-player-component-hover: "This is a virtual player.\nRefers to a system account of this name with the same name.\nUUID: {0}\nUsername: {1}\nDisplay as: {2}" +virtual-player-component-hover: "Questo è un giocatore virtuale.\nSi riferisce a un account di sistema con lo stesso nome.\nUUUID: {0}\nNome utente: {1}\nMostra come: {2}" real-player-component-hover: "This is a real exists player.\nUUID: {0}\nUsername: {1}\nDisplay as: {2}\nIf you wish to use a virtual system account with the same name, add \"[]\" to the both side of the username: [{1}]." menu: sell-tax: Hai pagato {0} tasse incluse. From f9095bfe2b5282af1fbc1f6dfd5bffcc5f747c62 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 13:45:51 +0800 Subject: [PATCH 10/81] backup database before run on 1.20.5 --- .../database/SimpleDatabaseHelperV2.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 9317b9c214..bef71bfd9f 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 @@ -31,6 +31,8 @@ import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; +import java.io.File; +import java.io.IOException; import java.sql.*; import java.util.Date; import java.util.*; @@ -49,7 +51,7 @@ public class SimpleDatabaseHelperV2 implements DatabaseHelper { @NotNull private final String prefix; - private final int LATEST_DATABASE_VERSION = 15; + private final int LATEST_DATABASE_VERSION = 16; public SimpleDatabaseHelperV2(@NotNull QuickShop plugin, @NotNull SQLManager manager, @NotNull String prefix) throws Exception { this.plugin = plugin; @@ -829,6 +831,14 @@ public boolean hasTable(@NotNull String table) throws SQLException { return match; } + private void makeBackup() { + File backupFile = new File(new File(plugin.getDataFolder(), "backup"), System.currentTimeMillis() + "-I-told-you-backup-database-before-1.20.5-upgrade.zip"); + try { + new DatabaseIOUtil(this).exportTables(backupFile); + } catch (SQLException | IOException e) { + plugin.logger().warn("Failed to backup database", e); + } + } static class DatabaseUpgrade { private final SimpleDatabaseHelperV2 parent; @@ -895,6 +905,11 @@ public void upgrade() { parent.performLogPurchasesIndex(); currentDatabaseVersion = 15; } + if (currentDatabaseVersion == 15) { + logger.info("Data upgrading: Just create a backup to avoid of somebody forget to backup database while upgrading to 1.20.5..."); + parent.makeBackup(); + currentDatabaseVersion = 16; + } parent.setDatabaseVersion(currentDatabaseVersion).join(); } From b44c5f2aca6f95dffb78dc8cd13c83ac5912a64a Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 14:13:08 +0800 Subject: [PATCH 11/81] fix remapping with wrong mapping file --- platform/quickshop-platform-spigot-v1_20_R4/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index 5ef760a98f..8915e7f9c2 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -36,9 +36,9 @@ remap-obf - org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:txt:maps-mojang + org.spigotmc:minecraft-server:1.20.5-R0.1-SNAPSHOT:txt:maps-mojang true - org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-mojang + org.spigotmc:spigot:1.20.5-R0.1-SNAPSHOT:jar:remapped-mojang true remapped-obf @@ -54,8 +54,8 @@ ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar - org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:csrg:maps-spigot - org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-obf + org.spigotmc:minecraft-server:1.20.5-R0.1-SNAPSHOT:csrg:maps-spigot + org.spigotmc:spigot:1.20.5-R0.1-SNAPSHOT:jar:remapped-obf From e8796707fe5a0917f859f6164b77b15fcc06bbb6 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 14:14:57 +0800 Subject: [PATCH 12/81] bump dependencies index --- .../src/main/resources/libraries.maven | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/quickshop-bukkit/src/main/resources/libraries.maven b/quickshop-bukkit/src/main/resources/libraries.maven index a767cda3c1..94e99d2965 100644 --- a/quickshop-bukkit/src/main/resources/libraries.maven +++ b/quickshop-bukkit/src/main/resources/libraries.maven @@ -1,6 +1,6 @@ +org.slf4j:slf4j-jdk14:2.0.12@org.slf4j.jul.JDK14LoggerAdapter org.apache.commons:commons-lang3:3.14.0@org.apache.commons.lang3.StringUtils org.apache.commons:commons-compress:1.25.0@org.apache.commons.compress.archivers.zip.ZipFile -org.slf4j:slf4j-jdk14:2.0.12@org.slf4j.jul.JDK14LoggerAdapter com.google.code.gson:gson:2.10.1@com.google.gson.Gson com.google.guava:guava:33.1.0-jre com.rollbar:rollbar-java:1.9.0@com.rollbar.notifier.Rollbar @@ -11,23 +11,23 @@ net.sourceforge.csvjdbc:csvjdbc:1.0.42@org.relique.jdbc.csv.CsvDriver org.dom4j:dom4j:2.1.4@org.dom4j.io.SAXReader com.vdurmont:semver4j:3.1.0@com.vdurmont.semver4j.Semver com.ghostchu.crowdin:crowdinota:1.0.3@com.ghostchu.crowdin.CrowdinOTA -net.kyori:adventure-api:4.15.0@net.kyori.adventure.Adventure -net.kyori:adventure-key:4.15.0@net.kyori.adventure.key.Key -net.kyori:adventure-nbt:4.15.0@net.kyori.adventure.nbt.CompoundBinaryTag +net.kyori:adventure-api:4.16.0@net.kyori.adventure.Adventure +net.kyori:adventure-key:4.16.0@net.kyori.adventure.key.Key +net.kyori:adventure-nbt:4.16.0@net.kyori.adventure.nbt.CompoundBinaryTag net.kyori:adventure-platform-api:4.3.2@net.kyori.adventure.platform.AudienceProvider net.kyori:adventure-platform-bukkit:4.3.2@net.kyori.adventure.platform.bukkit.BukkitAudiences net.kyori:adventure-platform-facet:4.3.2@net.kyori.adventure.platform.facet.FacetAudience net.kyori:adventure-platform-viaversion:4.3.2@net.kyori.adventure.platform.viaversion.ViaFacet -net.kyori:adventure-serializer-configurate4:4.15.0@net.kyori.adventure.serializer.configurate4.KeySerializer -net.kyori:adventure-text-logger-slf4j:4.15.0@net.kyori.adventure.text.logger.slf4j.ComponentLogger -net.kyori:adventure-text-minimessage:4.15.0@net.kyori.adventure.text.minimessage.MiniMessage -net.kyori:adventure-text-serializer-ansi:4.15.0@net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer +net.kyori:adventure-serializer-configurate4:4.16.0@net.kyori.adventure.serializer.configurate4.KeySerializer +net.kyori:adventure-text-logger-slf4j:4.16.0@net.kyori.adventure.text.logger.slf4j.ComponentLogger +net.kyori:adventure-text-minimessage:4.16.0@net.kyori.adventure.text.minimessage.MiniMessage +net.kyori:adventure-text-serializer-ansi:4.16.0@net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer net.kyori:adventure-text-serializer-bungeecord:4.3.2@net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer -net.kyori:adventure-text-serializer-gson-legacy-impl:4.15.0@net.kyori.adventure.text.serializer.gson.legacyimpl.NBTLegacyHoverEventSerializer -net.kyori:adventure-text-serializer-json:4.15.0@net.kyori.adventure.text.serializer.json.JSONComponentSerializer -net.kyori:adventure-text-serializer-json-legacy-impl:4.15.0@net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer -net.kyori:adventure-text-serializer-legacy:4.15.0@net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer -net.kyori:adventure-text-serializer-plain:4.15.0@net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer +net.kyori:adventure-text-serializer-gson-legacy-impl:4.16.0@net.kyori.adventure.text.serializer.gson.legacyimpl.NBTLegacyHoverEventSerializer +net.kyori:adventure-text-serializer-json:4.16.0@net.kyori.adventure.text.serializer.json.JSONComponentSerializer +net.kyori:adventure-text-serializer-json-legacy-impl:4.16.0@net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer +net.kyori:adventure-text-serializer-legacy:4.16.0@net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer +net.kyori:adventure-text-serializer-plain:4.16.0@net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer net.kyori:examination-api:1.3.0@net.kyori.examination.Examinable net.kyori:examination-string:1.3.0@net.kyori.examination.string.StringExaminer com.github.stefvanschie.inventoryframework:IF:0.10.13@com.github.stefvanschie.inventoryframework.gui.GuiItem \ No newline at end of file From 770301e31c93029abe800713ad62b256f92b1fc0 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 14:27:09 +0800 Subject: [PATCH 13/81] WIP: 1.20.5 support, basically working but virtual display not working at all --- .../virtual/VirtualDisplayItemManager.java | 1 + .../virtual/packetfactory/v1_20_R4.java | 213 ++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java index d76ce426b8..94c88dcacc 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java @@ -58,6 +58,7 @@ public void load() { case v1_19_R1 -> new v1_19_R1(plugin, this); case v1_19_R2, v1_19_R3, v1_20_R1 -> new v1_19_R2_TO_v1_20_R1(plugin, this); case v1_20_R2, v1_20_R3 -> new v1_20_R2(plugin, this); + case v1_20_R4 -> new v1_20_R4(plugin, this); default -> throw new IllegalStateException("Unsupported Virtual Display Minecraft version: " + plugin.getGameVersion()); }; diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java new file mode 100644 index 0000000000..a870683a76 --- /dev/null +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java @@ -0,0 +1,213 @@ +package com.ghostchu.quickshop.shop.display.virtual.packetfactory; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.events.ListenerPriority; +import com.comphenix.protocol.events.PacketAdapter; +import com.comphenix.protocol.events.PacketContainer; +import com.comphenix.protocol.events.PacketEvent; +import com.comphenix.protocol.reflect.StructureModifier; +import com.comphenix.protocol.utility.MinecraftVersion; +import com.comphenix.protocol.wrappers.*; +import com.ghostchu.quickshop.QuickShop; +import com.ghostchu.quickshop.shop.SimpleShopChunk; +import com.ghostchu.quickshop.shop.display.virtual.VirtualDisplayItem; +import com.ghostchu.quickshop.shop.display.virtual.VirtualDisplayItemManager; +import com.ghostchu.quickshop.util.Util; +import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +public class v1_20_R4 implements VirtualDisplayPacketFactory { + private final QuickShop plugin; + private final VirtualDisplayItemManager manager; + + public v1_20_R4(QuickShop plugin, VirtualDisplayItemManager manager) { + this.plugin = plugin; + this.manager = manager; + } + + @Override + public @Nullable Throwable testFakeItem() { + try { + createFakeItemSpawnPacket(0, new Location(Bukkit.getServer().getWorlds().get(0), 0, 0, 0)); + createFakeItemMetaPacket(0, new ItemStack(Material.values()[0])); + createFakeItemVelocityPacket(0); + createFakeItemDestroyPacket(0); + return null; + } catch (Exception throwable) { + return throwable; + } + } + + @Override + public @NotNull PacketContainer createFakeItemSpawnPacket(int entityID, @NotNull Location displayLocation) { + //First, create a new packet to spawn item + PacketContainer fakeItemPacket = manager.getProtocolManager().createPacket(PacketType.Play.Server.SPAWN_ENTITY); + //and add data based on packet class in NMS (global scope variable) + //Reference: https://wiki.vg/Protocol#Spawn_Object + fakeItemPacket.getIntegers() + //Entity ID + .write(0, entityID); + //Velocity x + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.DROPPED_ITEM); + //UUID + fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); + //Location + fakeItemPacket.getDoubles() + //X + .write(0, displayLocation.getX()) + //Y + .write(1, displayLocation.getY()) + //Z + .write(2, displayLocation.getZ()); + return fakeItemPacket; + } + + @Override + public @NotNull PacketContainer createFakeItemMetaPacket(int entityID, @NotNull ItemStack itemStack) { + //Next, create a new packet to update item data (default is empty) + PacketContainer fakeItemMetaPacket = manager.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA); + //Entity ID + fakeItemMetaPacket.getIntegers().write(0, entityID); + + //List Type are more complex + //Create a DataWatcher + WrappedDataWatcher wpw = new WrappedDataWatcher(); + //https://wiki.vg/index.php?title=Entity_metadata#Entity + if (plugin.getConfig().getBoolean("shop.display-item-use-name")) { + String itemName = GsonComponentSerializer.gson().serialize(Util.getItemStackName(itemStack)); + wpw.setObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true), Optional.of(WrappedChatComponent.fromJson(itemName).getHandle())); + wpw.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true); + } + + //Must in the certain slot:https://wiki.vg/Entity_metadata#Item + wpw.setObject(8, WrappedDataWatcher.Registry.getItemStackSerializer(false), itemStack); + //Add it + //For 1.19.2+, we need to use DataValue instead of WatchableObject + //Check for new version protocolLib + try { + Class.forName("com.comphenix.protocol.wrappers.WrappedDataValue"); + } catch (ClassNotFoundException e) { + throw new RuntimeException("Unable to initialize packet, ProtocolLib update needed", e); + } + //Convert List to List + List wrappedWatchableObjects = wpw.getWatchableObjects(); + List wrappedDataValues = new java.util.LinkedList<>(); + for (WrappedWatchableObject wrappedWatchableObject : wrappedWatchableObjects) { + WrappedDataWatcher.WrappedDataWatcherObject watchableObject = wrappedWatchableObject.getWatcherObject(); + wrappedDataValues.add(new WrappedDataValue(watchableObject.getIndex(), watchableObject.getSerializer(), wrappedWatchableObject.getRawValue())); + } + fakeItemMetaPacket.getDataValueCollectionModifier().write(0, wrappedDataValues); + return fakeItemMetaPacket; + } + + @Override + public @NotNull PacketContainer createFakeItemVelocityPacket(int entityID) { + //And, create a entity velocity packet to make it at a proper location (otherwise it will fly randomly) + PacketContainer fakeItemVelocityPacket = manager.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_VELOCITY); + fakeItemVelocityPacket.getIntegers() + //Entity ID + .write(0, entityID) + //Velocity x + .write(1, 0) + //Velocity y + .write(2, 0) + //Velocity z + .write(3, 0); + return fakeItemVelocityPacket; + } + + @Override + public @NotNull PacketContainer createFakeItemDestroyPacket(int entityID) { + //Also make a DestroyPacket to remove it + PacketContainer fakeItemDestroyPacket = manager.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_DESTROY); + MinecraftVersion minecraftVersion = manager.getProtocolManager().getMinecraftVersion(); + //On 1.17.1 (may be 1.17.1+? it's enough, Mojang, stop the changes), we need add the int list + //Entity to remove + try { + fakeItemDestroyPacket.getIntLists().write(0, Collections.singletonList(entityID)); + } catch (NoSuchMethodError e) { + throw new IllegalStateException("Unable to initialize packet, ProtocolLib update needed", e); + } + // } + return fakeItemDestroyPacket; + } + + @Override + public @NotNull PacketAdapter getChunkSendPacketAdapter() { + return new PacketAdapter(plugin.getJavaPlugin(), ListenerPriority.HIGH, PacketType.Play.Server.MAP_CHUNK) { + @Override + public void onPacketSending(@NotNull PacketEvent event) { + Player player = event.getPlayer(); + if (player == null || !player.isOnline()) { + return; + } + if (player.getClass().getName().contains("TemporaryPlayer")) { + return; + } + StructureModifier integerStructureModifier = event.getPacket().getIntegers(); + //chunk x + int x = integerStructureModifier.read(0); + //chunk z + int z = integerStructureModifier.read(1); + + manager.getChunksMapping().computeIfPresent(new SimpleShopChunk(player.getWorld().getName(), x, z), (chunkLoc, targetList) -> { + for (VirtualDisplayItem target : targetList) { + if (!target.isSpawned()) { + continue; + } + if (target.isApplicableForPlayer(player)) { // TODO: Refactor with better way + target.getPacketSenders().add(player.getUniqueId()); + target.sendDestroyItem(player); + target.sendFakeItem(player); + } + } + return targetList; + }); + } + }; + } + + @Override + public @NotNull PacketAdapter getChunkUnloadPacketAdapter() { + return new PacketAdapter(plugin.getJavaPlugin(), ListenerPriority.HIGH, PacketType.Play.Server.UNLOAD_CHUNK) { + @Override + public void onPacketSending(@NotNull PacketEvent event) { + Player player = event.getPlayer(); + if (player == null || !player.isOnline()) { + return; + } + if (player.getClass().getName().contains("TemporaryPlayer")) { + return; + } + StructureModifier intPairStructureModifier = event.getPacket().getChunkCoordIntPairs(); + ChunkCoordIntPair pair = intPairStructureModifier.read(0); + //chunk x + int x = pair.getChunkX(); + //chunk z + int z = pair.getChunkZ(); + manager.getChunksMapping().computeIfPresent(new SimpleShopChunk(player.getWorld().getName(), x, z), (chunkLoc, targetList) -> { + for (VirtualDisplayItem target : targetList) { + if (!target.isSpawned()) { + continue; + } + target.sendDestroyItem(player); + target.getPacketSenders().remove(player.getUniqueId()); + } + return targetList; + }); + } + }; + } +} From c391ac8ae09a811a7c3fcdd06f86e4f329170b33 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 14:30:43 +0800 Subject: [PATCH 14/81] Fixed version checker --- .../quickshop/util/updater/NexusManager.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java index 8308412c85..f10a1e8603 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java @@ -4,6 +4,7 @@ import com.ghostchu.quickshop.util.logger.Log; import com.ghostchu.quickshop.util.paste.item.SubPasteItem; import com.ghostchu.quickshop.util.paste.util.HTMLTable; +import com.vdurmont.semver4j.Semver; import kong.unirest.HttpResponse; import kong.unirest.Unirest; import kong.unirest.UnirestException; @@ -57,7 +58,16 @@ public boolean isLatest() { cachedResult = true; return true; } - this.cachedResult = plugin.getVersion().equals(cachedMetadata.getReleaseVersion()); + Semver localVer = plugin.getSemVersion(); + Semver remoteReleaseVer = new Semver(cachedMetadata.getReleaseVersion()); + Semver remoteLatestVer = new Semver(cachedMetadata.getLatestVersion()); + Semver selectedRemoteVer; + if (remoteReleaseVer.isGreaterThan(remoteLatestVer)) { + selectedRemoteVer = remoteReleaseVer; + } else { + selectedRemoteVer = remoteLatestVer; + } + this.cachedResult = selectedRemoteVer.isGreaterThan(localVer); return this.cachedResult; } From 40c7c3d3d2c3fd42ea58a44e2832b739cf67c201 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 14:35:49 +0800 Subject: [PATCH 15/81] bump CI pipe up to Java 21 and MC 1.20.5 --- .github/workflows/maven.yml | 4 ++-- .github/workflows/mc-publish.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5bf292b644..fa233a4a69 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: 'maven' - name: Build with Maven diff --git a/.github/workflows/mc-publish.yml b/.github/workflows/mc-publish.yml index e38c46d32a..c52e8ebac8 100644 --- a/.github/workflows/mc-publish.yml +++ b/.github/workflows/mc-publish.yml @@ -18,10 +18,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: maven - name: Build with Maven @@ -43,7 +43,7 @@ jobs: paper purpur game-versions: | - >=1.18.2 <=1.20.4 + >=1.18.2 <=1.20.5 game-version-filter: releases java: | 17 From d2222711bb1ee86a44095f0e371501493c0bf919 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 29 Apr 2024 19:12:16 +0800 Subject: [PATCH 16/81] compile with slf4j together --- pom.xml | 1 + quickshop-bukkit/src/main/resources/libraries.maven | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 894300723a..4a6a0d7b44 100644 --- a/pom.xml +++ b/pom.xml @@ -122,6 +122,7 @@ io.vertx:vertx-core:* io.vertx:vertx-web:* org.eclipse.aether:*:* + org.slf4j:slf4j-jdk14:* diff --git a/quickshop-bukkit/src/main/resources/libraries.maven b/quickshop-bukkit/src/main/resources/libraries.maven index 94e99d2965..c91ebbd95f 100644 --- a/quickshop-bukkit/src/main/resources/libraries.maven +++ b/quickshop-bukkit/src/main/resources/libraries.maven @@ -1,4 +1,3 @@ -org.slf4j:slf4j-jdk14:2.0.12@org.slf4j.jul.JDK14LoggerAdapter org.apache.commons:commons-lang3:3.14.0@org.apache.commons.lang3.StringUtils org.apache.commons:commons-compress:1.25.0@org.apache.commons.compress.archivers.zip.ZipFile com.google.code.gson:gson:2.10.1@com.google.gson.Gson From 7cf108909d497cc94fd29617e08175865c830149 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:47:31 +0000 Subject: [PATCH 17/81] Bump com.willfp:Reforges from 6.56.0 to 6.57.1 Bumps com.willfp:Reforges from 6.56.0 to 6.57.1. --- updated-dependencies: - dependency-name: com.willfp:Reforges dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- compatibility/reforges/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility/reforges/pom.xml b/compatibility/reforges/pom.xml index 62c505693a..b2f28da1c2 100644 --- a/compatibility/reforges/pom.xml +++ b/compatibility/reforges/pom.xml @@ -69,7 +69,7 @@ com.willfp Reforges - 6.56.0 + 6.57.1 provided From 486864767b04436822b50cc1e8cc0a8cf81d8756 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:47:49 +0000 Subject: [PATCH 18/81] Bump com.willfp:EcoEnchants from 12.3.5 to 12.5.1 Bumps com.willfp:EcoEnchants from 12.3.5 to 12.5.1. --- updated-dependencies: - dependency-name: com.willfp:EcoEnchants dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- compatibility/ecoenchants/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility/ecoenchants/pom.xml b/compatibility/ecoenchants/pom.xml index 03d75e7f82..f318d4794d 100644 --- a/compatibility/ecoenchants/pom.xml +++ b/compatibility/ecoenchants/pom.xml @@ -69,7 +69,7 @@ com.willfp EcoEnchants - 12.3.5 + 12.5.1 provided From b6ae9e7fa9027f5b8783f20ff06ea430caa5f632 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:48:01 +0000 Subject: [PATCH 19/81] Bump com.github.angeschossen:LandsAPI from 6.44.14 to 7.0.2 Bumps [com.github.angeschossen:LandsAPI](https://github.com/Angeschossen/LandsAPI) from 6.44.14 to 7.0.2. - [Release notes](https://github.com/Angeschossen/LandsAPI/releases) - [Commits](https://github.com/Angeschossen/LandsAPI/compare/6.44.14...7.0.2) --- updated-dependencies: - dependency-name: com.github.angeschossen:LandsAPI dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- compatibility/lands/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility/lands/pom.xml b/compatibility/lands/pom.xml index 5477cc0756..ce272ad91f 100644 --- a/compatibility/lands/pom.xml +++ b/compatibility/lands/pom.xml @@ -68,7 +68,7 @@ com.github.angeschossen LandsAPI - 6.44.14 + 7.0.2 provided From eb9aed114c723a5d3a88c2ad21a6b9021628642f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:48:59 +0000 Subject: [PATCH 20/81] Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.2 to 3.5.3 Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/apache/maven-shade-plugin/releases) - [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.2...maven-shade-plugin-3.5.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-shade-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- addon/reremake-migrator/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addon/reremake-migrator/pom.xml b/addon/reremake-migrator/pom.xml index 4ce96ef4a3..d0bb639842 100644 --- a/addon/reremake-migrator/pom.xml +++ b/addon/reremake-migrator/pom.xml @@ -46,7 +46,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.2 + 3.5.3 package diff --git a/pom.xml b/pom.xml index 4a6a0d7b44..aad9d2de13 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.2 + 3.5.3 package From 5e6bb4e3f479c4cca6f0c368eef4cf549a5f52b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:49:26 +0000 Subject: [PATCH 21/81] Bump net.md-5:specialsource-maven-plugin from 2.0.2 to 2.0.3 Bumps [net.md-5:specialsource-maven-plugin](https://github.com/agaricusb/SpecialSourceMP) from 2.0.2 to 2.0.3. - [Commits](https://github.com/agaricusb/SpecialSourceMP/compare/specialsource-maven-plugin-2.0.2...specialsource-maven-plugin-2.0.3) --- updated-dependencies: - dependency-name: net.md-5:specialsource-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- 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 +- platform/quickshop-platform-spigot-v1_20_R4/pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/quickshop-platform-spigot-v1_18_R1/pom.xml b/platform/quickshop-platform-spigot-v1_18_R1/pom.xml index c048f97ad3..b107d6bb81 100644 --- a/platform/quickshop-platform-spigot-v1_18_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_18_R1/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_18_R2/pom.xml b/platform/quickshop-platform-spigot-v1_18_R2/pom.xml index 2e5796fc0b..a2aa821d0c 100644 --- a/platform/quickshop-platform-spigot-v1_18_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_18_R2/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_19_R1/pom.xml b/platform/quickshop-platform-spigot-v1_19_R1/pom.xml index e7a57ad70d..85d97edf3d 100644 --- a/platform/quickshop-platform-spigot-v1_19_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R1/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_19_R2/pom.xml b/platform/quickshop-platform-spigot-v1_19_R2/pom.xml index cfae126f04..ad4610e749 100644 --- a/platform/quickshop-platform-spigot-v1_19_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R2/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_19_R3/pom.xml b/platform/quickshop-platform-spigot-v1_19_R3/pom.xml index 71220b55df..571819daac 100644 --- a/platform/quickshop-platform-spigot-v1_19_R3/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R3/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_20_R1/pom.xml b/platform/quickshop-platform-spigot-v1_20_R1/pom.xml index 0f8aa31aee..d485c2eff4 100644 --- a/platform/quickshop-platform-spigot-v1_20_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R1/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_20_R2/pom.xml b/platform/quickshop-platform-spigot-v1_20_R2/pom.xml index f7f88e6d0e..414156ede2 100644 --- a/platform/quickshop-platform-spigot-v1_20_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R2/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_20_R3/pom.xml b/platform/quickshop-platform-spigot-v1_20_R3/pom.xml index 441bcd1ea5..e057aeae16 100644 --- a/platform/quickshop-platform-spigot-v1_20_R3/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R3/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index 8915e7f9c2..6ae501553f 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -27,7 +27,7 @@ net.md-5 specialsource-maven-plugin - 2.0.2 + 2.0.3 package From 2212c3a2428757cd6753e48b67751c522a3eab83 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 30 Apr 2024 11:38:00 +0800 Subject: [PATCH 22/81] Fix QUser hashCode method & Benefit command --- .../quickshop/command/subcommand/SubCommand_Benefit.java | 2 +- .../src/main/java/com/ghostchu/quickshop/obj/QUserImpl.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Benefit.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Benefit.java index a039a7e8db..e0d69d6933 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Benefit.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Benefit.java @@ -147,7 +147,7 @@ private void queryBenefit(Player sender, Shop shop, @NotNull CommandParser parse Util.asyncThreadRun(() -> { for (Map.Entry entry : shop.getShopBenefit().getRegistry().entrySet()) { String v = MsgUtil.decimalFormat(entry.getValue() * 100); - plugin.text().of(sender, "benefit-query-list", entry.getKey().getDisplay(), entry.getKey(), v + "%").send(); + plugin.text().of(sender, "benefit-query-list", entry.getKey().getDisplay(), v + "%").send(); } }); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/obj/QUserImpl.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/obj/QUserImpl.java index 980d01ef66..ca810a24ec 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/obj/QUserImpl.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/obj/QUserImpl.java @@ -310,6 +310,11 @@ public static QUser createSync(@NotNull PlayerFinder finder, @NotNull CommandSen return createSync(finder, sender, QuickExecutor.getPrimaryProfileIoExecutor()); } + @Override + public int hashCode() { + return Objects.hash(username, uniqueId, realPlayer); + } + @Override public boolean equals(Object obj) { if (obj instanceof QUser qUser) { From 10d02700e017c4b302fbfd5b606f154d314a9f19 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Fri, 3 May 2024 11:48:36 +0800 Subject: [PATCH 23/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/zh-TW/messages.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 6f868350c4..43d005dcfd 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -92,7 +92,7 @@ player-bought-from-your-store-tax: {0} 從你的商店購買了 {1} 個 { not-enough-space: 你只剩下 {0} 格空間可以裝東西! shop-name-success: 成功地將商店名稱設定為 {0}。 shop-staff-added: 已成功地新增員工 {0} 到你的商店。 -shop-staff-empty: This shop have no staff members. +shop-staff-empty: 此商店沒有任何員工 shops-recovering: 正在嘗試從備份檔案中還原所有商店…… virtual-player-component-hover: "這是一個虛擬玩家。\n引用具有相同名稱的此名稱的系統帳戶。\nUUID: {0}\n使用者名稱: {1}\n顯示為: {2}" real-player-component-hover: "這是一個真實存在的玩家。\nUUID: {0}\n使用者名稱: {1}\n顯示為: {2}\n如果要使用同名的虛擬系統帳戶,請添加 \"[]\" 到使用者名的兩側: [{1}]." @@ -373,7 +373,7 @@ controlpanel: empty-hover: 點擊清除商店內庫存。 toggledisplay: '商店懸浮物品顯示:{0} [切換]' history: '歷史: [查看]' - history-hover: Click to view shop history logs + history-hover: 點擊來去查閱商店銷售紀錄 timeunit: behind: 後面 week: "{0} 星期" @@ -1282,7 +1282,7 @@ addon: player: 玩家 item: 物品 amount: 數量 - balance: 餘額 + balance: 花費 balance-after-tax: 餘額(稅後) account: 你的帳戶餘額 taxes: 稅金 @@ -1518,26 +1518,26 @@ history: header-icon-description: - "類型:{0}" - "擁有者:{1}" - - "Item: {2}" + - "商品:{2}" - "Price: {3} x{4}" - - "Location: {5}" + - "商店位置:{5}" log-icon-title: "Time: {0}" log-icon-description: - - "Purchaser: {0}" + - "買家:{0}" - "Item: {1} x{2}" - - "Balance: {3}" - - "Tax: {4}" + - "花費:{3}" + - "税:{4}" query-icon: "Please wait, querying..." - previous-page: "<< Previous Page" - next-page: "Next Page >>" - current-page: "Page {0}" + previous-page: "上一頁" + next-page: "下一頁" + current-page: "第{0}頁" summary-icon-title: "Shop Summary" recent-purchases: "Recent {0} purchases: {1}" recent-purchase-balance: "Recent {0} turnover: {1}" total-purchases: "Total purchases: {0}" total-balances: "Total turnover: {0}" total-unique-purchasers: "Total unique purchasers: {0}" - top-n-valuable-customers-title: "Top {0} valuable customers" + top-n-valuable-customers-title: "消費次數排行榜TOP{0}" top-n-valuable-customers-entry: "- {0} {1}" no-result: "No result" about: From 2401d1df0a2ce561985747fa3e22f0abb4ec7b54 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Fri, 3 May 2024 12:56:43 +0800 Subject: [PATCH 24/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/zh-TW/messages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 43d005dcfd..2b60f38ab9 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -455,7 +455,7 @@ command: benefit: 設定商店擁有者和其他玩家之間的利益分配 tag: 新增、刪除或查詢商店標籤 suggestprice: Suggest a recommend price for looking shop, based on other shops - history: View the history transactions of a shop + history: 查看商店的歷史交易記錄 sign: 變更商店告示牌材質 bulk-size-not-set: '用法:/quickshop size \' no-type-given: '用法:/quickshop find \' @@ -1519,9 +1519,9 @@ history: - "類型:{0}" - "擁有者:{1}" - "商品:{2}" - - "Price: {3} x{4}" + - "價格:{3}{4}" - "商店位置:{5}" - log-icon-title: "Time: {0}" + log-icon-title: "消費時間:{0}" log-icon-description: - "買家:{0}" - "Item: {1} x{2}" From b3991d793501e932fb8eff4d8d6bf2873d76c224 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 17:53:09 +0000 Subject: [PATCH 25/81] Bump com.palmergames.bukkit.towny:towny from 0.100.2.0 to 0.100.2.7 Bumps [com.palmergames.bukkit.towny:towny](https://github.com/TownyAdvanced/Towny) from 0.100.2.0 to 0.100.2.7. - [Release notes](https://github.com/TownyAdvanced/Towny/releases) - [Commits](https://github.com/TownyAdvanced/Towny/compare/0.100.2.0...0.100.2.7) --- updated-dependencies: - dependency-name: com.palmergames.bukkit.towny:towny dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- compatibility/towny/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility/towny/pom.xml b/compatibility/towny/pom.xml index f5e822345d..8240fc427c 100644 --- a/compatibility/towny/pom.xml +++ b/compatibility/towny/pom.xml @@ -62,7 +62,7 @@ com.palmergames.bukkit.towny towny - 0.100.2.0 + 0.100.2.7 provided From e02b4cfc7d0b08c789118997942c388c1df60997 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Sun, 5 May 2024 14:41:02 +0800 Subject: [PATCH 26/81] Fix translation key --- .../spigot/v1_20_4/Spigot1205Platform.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java index 2148769408..8fa20e0518 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java @@ -13,15 +13,12 @@ import org.bukkit.NamespacedKey; import org.bukkit.command.Command; import org.bukkit.craftbukkit.v1_20_R4.CraftServer; -import org.bukkit.craftbukkit.v1_20_R4.enchantments.CraftEnchantment; import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftItemStack; -import org.bukkit.craftbukkit.v1_20_R4.potion.CraftPotionEffectType; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionEffectTypeWrapper; import org.jetbrains.annotations.NotNull; public class Spigot1205Platform extends AbstractSpigotPlatform implements Platform { @@ -64,11 +61,7 @@ public void registerCommand(@NotNull String prefix, @NotNull Command command) { @Override public @NotNull String getTranslationKey(@NotNull Material material) { - if (material.isBlock()) { - return postProcessingTranslationKey(Bukkit.getUnsafe().getBlockTranslationKey(material)); - } else { - return postProcessingTranslationKey(Bukkit.getUnsafe().getItemTranslationKey(material)); - } + return postProcessingTranslationKey(material.getTranslationKey()); } @@ -79,7 +72,7 @@ private String postProcessingTranslationKey(String key) { @Override public @NotNull String getTranslationKey(@NotNull EntityType type) { //noinspection deprecation - return postProcessingTranslationKey(Bukkit.getUnsafe().getTranslationKey(type)); + return postProcessingTranslationKey(type.getTranslationKey()); // Optional> op = net.minecraft.world.entity.EntityType.byString(type.getKey().toString()); // if (op.isPresent()) { // return postProcessingTranslationKey(op.get().getDescriptionId()); @@ -90,17 +83,12 @@ private String postProcessingTranslationKey(String key) { @Override public @NotNull String getTranslationKey(@NotNull PotionEffectType potionEffectType) { - if (potionEffectType instanceof PotionEffectTypeWrapper wrapper) { - potionEffectType = wrapper.getType(); - } - CraftPotionEffectType craftPotionEffectType = (CraftPotionEffectType) potionEffectType; - return postProcessingTranslationKey(craftPotionEffectType.getHandle().getDescriptionId()); + return postProcessingTranslationKey(potionEffectType.getTranslationKey()); } @Override public @NotNull String getTranslationKey(@NotNull Enchantment enchantment) { - CraftEnchantment craftEnchantment = (CraftEnchantment) enchantment; - return postProcessingTranslationKey(craftEnchantment.getHandle().getDescriptionId()); + return postProcessingTranslationKey(enchantment.getTranslationKey()); } @Override From 9148a340b671c53e9f6b55197cb35adbd64bcf77 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 18:27:30 +0800 Subject: [PATCH 27/81] Bump NBT-API version --- platform/quickshop-platform-interface/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/quickshop-platform-interface/pom.xml b/platform/quickshop-platform-interface/pom.xml index 6d29d03076..81339e7401 100644 --- a/platform/quickshop-platform-interface/pom.xml +++ b/platform/quickshop-platform-interface/pom.xml @@ -58,7 +58,7 @@ de.tr7zw item-nbt-api-plugin - 2.12.3 + 2.12.4 provided From 11d57c4a27fcaf54549df8db0bc3bf2155b08835 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 19:39:05 +0800 Subject: [PATCH 28/81] General cleanup --- .run/quickshop-hikari update version.run.xml | 34 ------------- 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 | 4 +- addon/shopitemonly/pom.xml | 2 +- addon/webui/pom.xml | 2 +- compatibility/advancedchests/pom.xml | 4 +- compatibility/advancedregionmarket/pom.xml | 4 +- compatibility/angelchest/pom.xml | 4 +- compatibility/bentobox/pom.xml | 4 +- compatibility/chestprotect/pom.xml | 4 +- compatibility/clearlag/pom.xml | 6 +-- compatibility/common/pom.xml | 2 +- compatibility/ecoenchants/pom.xml | 4 +- compatibility/elitemobs/pom.xml | 4 +- compatibility/griefprevention/pom.xml | 4 +- compatibility/itemsadder/pom.xml | 4 +- compatibility/lands/pom.xml | 4 +- compatibility/nocheatplus/pom.xml | 4 +- compatibility/nova/pom.xml | 6 +-- compatibility/openinv/pom.xml | 4 +- compatibility/plotsquared/pom.xml | 11 +++-- compatibility/reforges/pom.xml | 4 +- compatibility/residence/pom.xml | 8 +-- compatibility/slimefun/pom.xml | 4 +- compatibility/superiorskyblock/pom.xml | 4 +- compatibility/towny/pom.xml | 4 +- compatibility/voidchest/pom.xml | 4 +- compatibility/worldedit/pom.xml | 4 +- compatibility/worldguard/pom.xml | 4 +- platform/quickshop-platform-interface/pom.xml | 2 +- platform/quickshop-platform-paper/pom.xml | 2 +- .../pom.xml | 5 +- .../pom.xml | 15 +----- .../pom.xml | 15 +----- .../pom.xml | 15 +----- .../pom.xml | 22 ++------- .../pom.xml | 21 +------- .../pom.xml | 27 +--------- .../pom.xml | 27 +--------- .../pom.xml | 27 +--------- .../pom.xml | 27 +--------- pom.xml | 16 +++--- quickshop-api/pom.xml | 2 +- quickshop-bukkit/pom.xml | 49 ++++++++++++++----- 51 files changed, 139 insertions(+), 300 deletions(-) delete mode 100644 .run/quickshop-hikari update version.run.xml diff --git a/.run/quickshop-hikari update version.run.xml b/.run/quickshop-hikari update version.run.xml deleted file mode 100644 index df94b41cf4..0000000000 --- a/.run/quickshop-hikari update version.run.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/addon/bluemap/pom.xml b/addon/bluemap/pom.xml index f762af068d..0e700f55dc 100644 --- a/addon/bluemap/pom.xml +++ b/addon/bluemap/pom.xml @@ -58,7 +58,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/discordsrv/pom.xml b/addon/discordsrv/pom.xml index 2132f5ab20..e5a4b93034 100644 --- a/addon/discordsrv/pom.xml +++ b/addon/discordsrv/pom.xml @@ -63,7 +63,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/discount/pom.xml b/addon/discount/pom.xml index 8b439996a7..f132b507d5 100644 --- a/addon/discount/pom.xml +++ b/addon/discount/pom.xml @@ -63,7 +63,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/displaycontrol/pom.xml b/addon/displaycontrol/pom.xml index c9b7d06a3a..597adfd3f5 100644 --- a/addon/displaycontrol/pom.xml +++ b/addon/displaycontrol/pom.xml @@ -63,7 +63,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/dynmap/pom.xml b/addon/dynmap/pom.xml index 40f052cfbd..9e5648c5c4 100644 --- a/addon/dynmap/pom.xml +++ b/addon/dynmap/pom.xml @@ -58,7 +58,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/limited/pom.xml b/addon/limited/pom.xml index 6499678b04..e49cdc4d6d 100644 --- a/addon/limited/pom.xml +++ b/addon/limited/pom.xml @@ -63,7 +63,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/list/pom.xml b/addon/list/pom.xml index b3381114cb..568648eaae 100644 --- a/addon/list/pom.xml +++ b/addon/list/pom.xml @@ -63,7 +63,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/plan/pom.xml b/addon/plan/pom.xml index 339c1bb8bc..8b5ea2a05f 100644 --- a/addon/plan/pom.xml +++ b/addon/plan/pom.xml @@ -58,7 +58,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/reremake-migrator/pom.xml b/addon/reremake-migrator/pom.xml index 4ce96ef4a3..0b475f3909 100644 --- a/addon/reremake-migrator/pom.xml +++ b/addon/reremake-migrator/pom.xml @@ -54,7 +54,7 @@ shade - ${name}-${version} + ${project.name}-${version} true false @@ -132,7 +132,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/shopitemonly/pom.xml b/addon/shopitemonly/pom.xml index 0ad073c768..55e59997c3 100644 --- a/addon/shopitemonly/pom.xml +++ b/addon/shopitemonly/pom.xml @@ -63,7 +63,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/addon/webui/pom.xml b/addon/webui/pom.xml index 22f1f3133b..c358f6ab5e 100644 --- a/addon/webui/pom.xml +++ b/addon/webui/pom.xml @@ -54,7 +54,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/advancedchests/pom.xml b/compatibility/advancedchests/pom.xml index 93927f9a47..55f966590f 100644 --- a/compatibility/advancedchests/pom.xml +++ b/compatibility/advancedchests/pom.xml @@ -62,13 +62,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/advancedregionmarket/pom.xml b/compatibility/advancedregionmarket/pom.xml index 8e88318611..7b151ce8f0 100644 --- a/compatibility/advancedregionmarket/pom.xml +++ b/compatibility/advancedregionmarket/pom.xml @@ -58,13 +58,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/angelchest/pom.xml b/compatibility/angelchest/pom.xml index c8a13c1dc9..320532ac52 100644 --- a/compatibility/angelchest/pom.xml +++ b/compatibility/angelchest/pom.xml @@ -56,13 +56,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/bentobox/pom.xml b/compatibility/bentobox/pom.xml index ff7a7aca1b..c709c313f2 100644 --- a/compatibility/bentobox/pom.xml +++ b/compatibility/bentobox/pom.xml @@ -64,13 +64,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/chestprotect/pom.xml b/compatibility/chestprotect/pom.xml index 953da142da..87545a77f3 100644 --- a/compatibility/chestprotect/pom.xml +++ b/compatibility/chestprotect/pom.xml @@ -57,13 +57,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/clearlag/pom.xml b/compatibility/clearlag/pom.xml index 6278b4b139..2cda686d36 100644 --- a/compatibility/clearlag/pom.xml +++ b/compatibility/clearlag/pom.xml @@ -50,13 +50,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided @@ -64,7 +64,7 @@ clearlag 3.2.2 system - ${basedir}/lib/Clearlag-3.2.2.jar + ${project.basedir}/lib/Clearlag-3.2.2.jar diff --git a/compatibility/common/pom.xml b/compatibility/common/pom.xml index e1596fd219..3885bf9061 100644 --- a/compatibility/common/pom.xml +++ b/compatibility/common/pom.xml @@ -50,7 +50,7 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/ecoenchants/pom.xml b/compatibility/ecoenchants/pom.xml index 03d75e7f82..dee59e840b 100644 --- a/compatibility/ecoenchants/pom.xml +++ b/compatibility/ecoenchants/pom.xml @@ -57,13 +57,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/elitemobs/pom.xml b/compatibility/elitemobs/pom.xml index cf5f4e111b..111885b523 100644 --- a/compatibility/elitemobs/pom.xml +++ b/compatibility/elitemobs/pom.xml @@ -61,13 +61,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/griefprevention/pom.xml b/compatibility/griefprevention/pom.xml index b09b93f690..5577021642 100644 --- a/compatibility/griefprevention/pom.xml +++ b/compatibility/griefprevention/pom.xml @@ -56,13 +56,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/itemsadder/pom.xml b/compatibility/itemsadder/pom.xml index edf0019a84..0a3ea89b1f 100644 --- a/compatibility/itemsadder/pom.xml +++ b/compatibility/itemsadder/pom.xml @@ -57,13 +57,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/lands/pom.xml b/compatibility/lands/pom.xml index 5477cc0756..790b833126 100644 --- a/compatibility/lands/pom.xml +++ b/compatibility/lands/pom.xml @@ -56,13 +56,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/nocheatplus/pom.xml b/compatibility/nocheatplus/pom.xml index 46c37ab3e1..76f80f8f6d 100644 --- a/compatibility/nocheatplus/pom.xml +++ b/compatibility/nocheatplus/pom.xml @@ -54,13 +54,13 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile diff --git a/compatibility/nova/pom.xml b/compatibility/nova/pom.xml index 7cfb770309..d59b549d3d 100644 --- a/compatibility/nova/pom.xml +++ b/compatibility/nova/pom.xml @@ -49,13 +49,13 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile @@ -63,7 +63,7 @@ Nova 0.8.6 system - ${basedir}/lib/Nova-0.8.6.jar + ${project.basedir}/lib/Nova-0.8.6.jar diff --git a/compatibility/openinv/pom.xml b/compatibility/openinv/pom.xml index d4c2355c3f..929ae706be 100644 --- a/compatibility/openinv/pom.xml +++ b/compatibility/openinv/pom.xml @@ -62,13 +62,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/plotsquared/pom.xml b/compatibility/plotsquared/pom.xml index 20f430ca79..ce05ea9ca6 100644 --- a/compatibility/plotsquared/pom.xml +++ b/compatibility/plotsquared/pom.xml @@ -57,10 +57,11 @@ org.spigotmc spigot-api + - com.plotsquared - PlotSquared-Bukkit - 6.11.1 + com.intellectualsites.plotsquared + plotsquared-bukkit + 7.3.8 provided @@ -84,13 +85,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/reforges/pom.xml b/compatibility/reforges/pom.xml index 62c505693a..bb68a2780d 100644 --- a/compatibility/reforges/pom.xml +++ b/compatibility/reforges/pom.xml @@ -57,13 +57,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/residence/pom.xml b/compatibility/residence/pom.xml index 8a8f3a4514..21a2393dfc 100644 --- a/compatibility/residence/pom.xml +++ b/compatibility/residence/pom.xml @@ -49,13 +49,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided @@ -63,14 +63,14 @@ Residence 5.0.1.7 system - ${basedir}/lib/Residence5.0.1.7.jar + ${project.basedir}/lib/Residence5.0.1.7.jar zrips.cmilib CMILib 1.2.2.0 system - ${basedir}/lib/CMILib1.2.2.0.jar + ${project.basedir}/lib/CMILib1.2.2.0.jar diff --git a/compatibility/slimefun/pom.xml b/compatibility/slimefun/pom.xml index 597d3dd1f0..05344096cf 100644 --- a/compatibility/slimefun/pom.xml +++ b/compatibility/slimefun/pom.xml @@ -57,13 +57,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/superiorskyblock/pom.xml b/compatibility/superiorskyblock/pom.xml index 1c78fbe90a..ff8336349f 100644 --- a/compatibility/superiorskyblock/pom.xml +++ b/compatibility/superiorskyblock/pom.xml @@ -57,13 +57,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/towny/pom.xml b/compatibility/towny/pom.xml index f5e822345d..10bd75552d 100644 --- a/compatibility/towny/pom.xml +++ b/compatibility/towny/pom.xml @@ -68,13 +68,13 @@ com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile diff --git a/compatibility/voidchest/pom.xml b/compatibility/voidchest/pom.xml index 7761479673..33dfd7d427 100644 --- a/compatibility/voidchest/pom.xml +++ b/compatibility/voidchest/pom.xml @@ -58,13 +58,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/worldedit/pom.xml b/compatibility/worldedit/pom.xml index 70ed7ae13a..6375f0dad2 100644 --- a/compatibility/worldedit/pom.xml +++ b/compatibility/worldedit/pom.xml @@ -68,13 +68,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/compatibility/worldguard/pom.xml b/compatibility/worldguard/pom.xml index 0688fec203..1674006686 100644 --- a/compatibility/worldguard/pom.xml +++ b/compatibility/worldguard/pom.xml @@ -62,13 +62,13 @@ com.ghostchu.quickshop.compatibility common - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-bukkit - ${parent.version} + ${project.parent.version} provided diff --git a/platform/quickshop-platform-interface/pom.xml b/platform/quickshop-platform-interface/pom.xml index 81339e7401..a526aa70a8 100644 --- a/platform/quickshop-platform-interface/pom.xml +++ b/platform/quickshop-platform-interface/pom.xml @@ -52,7 +52,7 @@ com.ghostchu quickshop-common - ${parent.version} + ${project.parent.version} compile diff --git a/platform/quickshop-platform-paper/pom.xml b/platform/quickshop-platform-paper/pom.xml index 62cf3328d2..3e60e55a20 100644 --- a/platform/quickshop-platform-paper/pom.xml +++ b/platform/quickshop-platform-paper/pom.xml @@ -49,7 +49,7 @@ com.ghostchu quickshop-platform-interface - ${parent.version} + ${project.parent.version} compile diff --git a/platform/quickshop-platform-spigot-abstract/pom.xml b/platform/quickshop-platform-spigot-abstract/pom.xml index caeb24d0eb..94efa8807f 100644 --- a/platform/quickshop-platform-spigot-abstract/pom.xml +++ b/platform/quickshop-platform-spigot-abstract/pom.xml @@ -47,12 +47,13 @@ com.ghostchu quickshop-platform-interface - ${parent.version} + ${project.parent.version} compile org.spigotmc spigot-api + true @@ -60,12 +61,14 @@ commons-lang 2.6 compile + true de.tr7zw item-nbt-api-plugin 2.12.3 provided + true * diff --git a/platform/quickshop-platform-spigot-v1_18_R1/pom.xml b/platform/quickshop-platform-spigot-v1_18_R1/pom.xml index c048f97ad3..9d4d28bf6d 100644 --- a/platform/quickshop-platform-spigot-v1_18_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_18_R1/pom.xml @@ -85,7 +85,7 @@ com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -94,18 +94,7 @@ 1.18.1-R0.1-SNAPSHOT remapped-mojang provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_18_R2/pom.xml b/platform/quickshop-platform-spigot-v1_18_R2/pom.xml index 2e5796fc0b..0050bf1027 100644 --- a/platform/quickshop-platform-spigot-v1_18_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_18_R2/pom.xml @@ -85,7 +85,7 @@ com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -94,18 +94,7 @@ 1.18.2-R0.1-SNAPSHOT remapped-mojang provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_19_R1/pom.xml b/platform/quickshop-platform-spigot-v1_19_R1/pom.xml index e7a57ad70d..e7b93299e8 100644 --- a/platform/quickshop-platform-spigot-v1_19_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R1/pom.xml @@ -85,7 +85,7 @@ com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -94,18 +94,7 @@ 1.19.1-R0.1-SNAPSHOT remapped-mojang provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_19_R2/pom.xml b/platform/quickshop-platform-spigot-v1_19_R2/pom.xml index cfae126f04..ff54d0589c 100644 --- a/platform/quickshop-platform-spigot-v1_19_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R2/pom.xml @@ -82,17 +82,12 @@ - - com.ghostchu - quickshop-platform-interface - ${parent.version} - compile - com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile + true org.spigotmc @@ -100,18 +95,7 @@ 1.19.3-R0.1-SNAPSHOT remapped-mojang provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_19_R3/pom.xml b/platform/quickshop-platform-spigot-v1_19_R3/pom.xml index 71220b55df..f796b99ade 100644 --- a/platform/quickshop-platform-spigot-v1_19_R3/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R3/pom.xml @@ -82,16 +82,10 @@ - - com.ghostchu - quickshop-platform-interface - ${parent.version} - compile - com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -100,18 +94,7 @@ 1.19.4-R0.1-SNAPSHOT remapped-mojang provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_20_R1/pom.xml b/platform/quickshop-platform-spigot-v1_20_R1/pom.xml index 0f8aa31aee..a89a357524 100644 --- a/platform/quickshop-platform-spigot-v1_20_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R1/pom.xml @@ -82,16 +82,10 @@ - - com.ghostchu - quickshop-platform-interface - ${parent.version} - compile - com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -100,24 +94,7 @@ 1.20.1-R0.1-SNAPSHOT remapped-mojang provided - - - org.spigotmc - spigot-api - 1.20.1-R0.1-SNAPSHOT - provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_20_R2/pom.xml b/platform/quickshop-platform-spigot-v1_20_R2/pom.xml index f7f88e6d0e..b32f69cec4 100644 --- a/platform/quickshop-platform-spigot-v1_20_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R2/pom.xml @@ -82,16 +82,10 @@ - - com.ghostchu - quickshop-platform-interface - ${parent.version} - compile - com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -100,24 +94,7 @@ 1.20.2-R0.1-SNAPSHOT remapped-mojang provided - - - org.spigotmc - spigot-api - 1.20.2-R0.1-SNAPSHOT - provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_20_R3/pom.xml b/platform/quickshop-platform-spigot-v1_20_R3/pom.xml index 441bcd1ea5..3eaec22776 100644 --- a/platform/quickshop-platform-spigot-v1_20_R3/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R3/pom.xml @@ -82,16 +82,10 @@ - - com.ghostchu - quickshop-platform-interface - ${parent.version} - compile - com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -100,24 +94,7 @@ 1.20.4-R0.1-SNAPSHOT remapped-mojang provided - - - org.spigotmc - spigot-api - 1.20.4-R0.1-SNAPSHOT - provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index 8915e7f9c2..d53d99dca5 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -82,16 +82,10 @@ - - com.ghostchu - quickshop-platform-interface - ${parent.version} - compile - com.ghostchu quickshop-platform-spigot-abstract - ${parent.version} + ${project.parent.version} compile @@ -100,24 +94,7 @@ 1.20.5-R0.1-SNAPSHOT remapped-mojang provided - - - org.spigotmc - spigot-api - 1.20.5-R0.1-SNAPSHOT - provided - - - de.tr7zw - item-nbt-api-plugin - 2.12.3 - provided - - - * - * - - + true diff --git a/pom.xml b/pom.xml index 4a6a0d7b44..551156ea5c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom quickshop-hikari Another QuickShop fork - https://github.com/${developer}/${artifactId} + https://github.com/${developer}/${project.artifactId} 17 @@ -37,14 +37,14 @@ - scm:git:git@github.com:${developer}/${artifactId}.git - scm:git:git@github.com:${developer}/${artifactId}.git - https://github.com/${developer}/${artifactId} + scm:git:git@github.com:${developer}/${project.artifactId}.git + scm:git:git@github.com:${developer}/${project.artifactId}.git + https://github.com/${developer}/${project.artifactId} HEAD - https://github.com/${developer}/${name}/issues + https://github.com/${developer}/${project.name}/issues GitHub Issues @@ -61,7 +61,7 @@ GitHub Actions - https://github.com/${developer}/${artifactId}/actions/workflows/maven.yml + https://github.com/${developer}/${project.artifactId}/actions/workflows/maven.yml @@ -95,7 +95,7 @@ shade - ${name}-${version} + ${project.name}-${version} true false @@ -280,7 +280,7 @@ copy-resources - ${basedir}/target/extra-resources + ${project.basedir}/target/extra-resources src/main/resources diff --git a/quickshop-api/pom.xml b/quickshop-api/pom.xml index 30829acf1a..6885f97835 100644 --- a/quickshop-api/pom.xml +++ b/quickshop-api/pom.xml @@ -20,7 +20,7 @@ com.ghostchu quickshop-common - ${parent.version} + ${project.parent.version} compile diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 5bc94982f8..474fc96064 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -70,74 +70,85 @@ com.ghostchu quickshop-api - ${parent.version} + ${project.parent.version} compile com.ghostchu quickshop-platform-spigot-v1_18_R1 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_18_R2 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_19_R1 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_19_R2 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_19_R3 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_20_R1 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_20_R2 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_20_R3 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-spigot-v1_20_R4 - ${parent.version} + ${project.parent.version} compile + true com.ghostchu quickshop-platform-paper - ${parent.version} + ${project.parent.version} compile + true com.comphenix.protocol ProtocolLib 5.0.0-SNAPSHOT provided + true @@ -151,6 +162,7 @@ * + true @@ -164,6 +176,7 @@ * + true me.xanium @@ -177,6 +190,7 @@ * + true net.tnemc @@ -189,6 +203,7 @@ * + true io.papermc @@ -208,6 +223,7 @@ * + true @@ -215,12 +231,14 @@ h2 2.1.214 provided + true com.konghq unirest-java 3.14.5 provided + true @@ -228,6 +246,7 @@ csvjdbc 1.0.42 provided + true @@ -235,6 +254,7 @@ dom4j 2.1.4 provided + true net.essentialsx @@ -259,18 +279,21 @@ org.checkerframework + true com.ghostchu.crowdin crowdinota 1.0.3 provided + true org.bstats bstats-bukkit 3.0.2 compile + true com.rollbar @@ -283,6 +306,7 @@ slf4j-api + true su.nightexpress.core @@ -290,6 +314,7 @@ 2.5.1 system ${project.basedir}/lib/nightcore-2.5.1.jar + true su.nightexpress.coinsengine @@ -297,12 +322,14 @@ 2.2.0.1 system ${project.basedir}/lib/CoinsEngine-2.2.0.1.jar + true me.lokka30 treasury-api 2.0.1 provided + true From 05fa324bb3861bf3bf79a915244fca2f5b81c939 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 21:15:27 +0800 Subject: [PATCH 29/81] POM cleanup --- addon/bluemap/pom.xml | 6 + addon/list/pom.xml | 13 -- addon/plan/pom.xml | 10 ++ addon/shopitemonly/pom.xml | 13 -- compatibility/advancedregionmarket/pom.xml | 22 +++ compatibility/bentobox/pom.xml | 6 + compatibility/ecoenchants/pom.xml | 30 ++++ compatibility/elitemobs/pom.xml | 26 ++++ .../nova/src/main/resources/plugin.yml | 4 +- compatibility/plotsquared/pom.xml | 128 ++++++++++++++++++ compatibility/worldedit/pom.xml | 60 ++++++++ compatibility/worldguard/pom.xml | 42 ++++++ .../pom.xml | 1 - quickshop-bukkit/pom.xml | 34 +++++ quickshop-common/pom.xml | 32 +---- 15 files changed, 368 insertions(+), 59 deletions(-) diff --git a/addon/bluemap/pom.xml b/addon/bluemap/pom.xml index 0e700f55dc..5563f05806 100644 --- a/addon/bluemap/pom.xml +++ b/addon/bluemap/pom.xml @@ -73,6 +73,12 @@ BlueMapAPI 2.7.0 provided + + + gson + com.google.code.gson + + diff --git a/addon/list/pom.xml b/addon/list/pom.xml index 568648eaae..eed08e7776 100644 --- a/addon/list/pom.xml +++ b/addon/list/pom.xml @@ -66,18 +66,5 @@ ${project.parent.version} provided - - - org.apache.commons - commons-lang3 - 3.14.0 - provided - - - - - - - diff --git a/addon/plan/pom.xml b/addon/plan/pom.xml index 8b5ea2a05f..d8d493a7a2 100644 --- a/addon/plan/pom.xml +++ b/addon/plan/pom.xml @@ -66,6 +66,16 @@ Plan 5.6.2820 provided + + + dagger + com.google.dagger + + + javax.inject + javax.inject + + com.github.juliomarcopineda diff --git a/addon/shopitemonly/pom.xml b/addon/shopitemonly/pom.xml index 55e59997c3..6199acb5fb 100644 --- a/addon/shopitemonly/pom.xml +++ b/addon/shopitemonly/pom.xml @@ -66,18 +66,5 @@ ${project.parent.version} provided - - - org.apache.commons - commons-lang3 - 3.14.0 - provided - - - - - - - diff --git a/compatibility/advancedregionmarket/pom.xml b/compatibility/advancedregionmarket/pom.xml index 7b151ce8f0..f79eec45dd 100644 --- a/compatibility/advancedregionmarket/pom.xml +++ b/compatibility/advancedregionmarket/pom.xml @@ -72,6 +72,28 @@ advanced-region-market 3.5.4 provided + + + mc1-14adapter + com.github.alex9849.advanced-region-market + + + mc1-20adapter + com.github.alex9849.advanced-region-market + + + placeholder-api-addon + com.github.alex9849.advanced-region-market + + + we7adapter + com.github.alex9849.advanced-region-market + + + wg7adapter + com.github.alex9849.advanced-region-market + + diff --git a/compatibility/bentobox/pom.xml b/compatibility/bentobox/pom.xml index c709c313f2..b005d742a6 100644 --- a/compatibility/bentobox/pom.xml +++ b/compatibility/bentobox/pom.xml @@ -78,6 +78,12 @@ bentobox 1.24.1 provided + + + org.eclipse.jdt.annotation + org.eclipse.jdt + + diff --git a/compatibility/ecoenchants/pom.xml b/compatibility/ecoenchants/pom.xml index dee59e840b..d0696b0cd7 100644 --- a/compatibility/ecoenchants/pom.xml +++ b/compatibility/ecoenchants/pom.xml @@ -77,6 +77,36 @@ eco 6.69.2 provided + + + maven-artifact + org.apache.maven + + + caffeine + com.github.ben-manes.caffeine + + + adventure-api + net.kyori + + + adventure-text-serializer-gson + net.kyori + + + adventure-text-serializer-legacy + net.kyori + + + kotlin-stdlib + org.jetbrains.kotlin + + + kotlinx-coroutines-core-jvm + org.jetbrains.kotlinx + + diff --git a/compatibility/elitemobs/pom.xml b/compatibility/elitemobs/pom.xml index 111885b523..661943102d 100644 --- a/compatibility/elitemobs/pom.xml +++ b/compatibility/elitemobs/pom.xml @@ -75,6 +75,32 @@ EliteMobs 8.2.0-SNAPSHOT provided + + + cloud.commandframework + cloud-paper + + + cloud.commandframework + cloud-minecraft-extras + + + io.leangen.geantyref + geantyref + + + org.reflections + reflections + + + commons-io + commons-io + + + net.kyori + * + + diff --git a/compatibility/nova/src/main/resources/plugin.yml b/compatibility/nova/src/main/resources/plugin.yml index 30864faefc..a789abdede 100644 --- a/compatibility/nova/src/main/resources/plugin.yml +++ b/compatibility/nova/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ -name: qscompat-${artifactId} +name: qscompat-${project.artifactId} version: '${project.version}' -main: com.ghostchu.quickshop.compatibility.${artifactId}.Main +main: com.ghostchu.quickshop.compatibility.${project.artifactId}.Main api-version: 1.18 depend: [ Nova, QuickShop-Hikari ] diff --git a/compatibility/plotsquared/pom.xml b/compatibility/plotsquared/pom.xml index ce05ea9ca6..9d2e0fd2c0 100644 --- a/compatibility/plotsquared/pom.xml +++ b/compatibility/plotsquared/pom.xml @@ -68,6 +68,78 @@ SquirrelID com.github.EngineHub + + Arkitektonika-Client + com.intellectualsites.arkitektonika + + + Paster + com.intellectualsites.paster + + + ServerLib + dev.notmyfault.serverlib + + + squirrelid + org.enginehub + + + adventure-platform-bukkit + net.kyori + + + paperlib + io.papermc + + + bstats-bukkit + org.bstats + + + PRTree + com.intellectualsites.prtree + + + adventure-api + net.kyori + + + adventure-text-minimessage + net.kyori + + + aopalliance + aopalliance + + + checker-qual + org.checkerframework + + + cloud-services + cloud.commandframework + + + guice-assistedinject + com.google.inject.extensions + + + spotbugs-annotations + com.github.spotbugs + + + log4j-api + org.apache.logging.log4j + + + gson + com.google.code.gson + + + snakeyaml + org.yaml + @@ -80,6 +152,62 @@ org.bstats * + + fastutil + it.unimi.dsi + + + paperlib + io.papermc + + + antlr4 + org.antlr + + + antlr4-runtime + org.antlr + + + gson + com.google.code.gson + + + guava + com.google.guava + + + jchronic + com.sk89q + + + jlibnoise + com.sk89q.lib + + + lin-bus-format-snbt + org.enginehub.lin-bus.format + + + lin-bus-tree + org.enginehub.lin-bus + + + rhino-runtime + org.mozilla + + + paranamer + com.thoughtworks.paranamer + + + snakeyaml + org.yaml + + + log4j-api + org.apache.logging.log4j + diff --git a/compatibility/worldedit/pom.xml b/compatibility/worldedit/pom.xml index 6375f0dad2..2218a7fd2c 100644 --- a/compatibility/worldedit/pom.xml +++ b/compatibility/worldedit/pom.xml @@ -63,6 +63,66 @@ org.bstats * + + fastutil + it.unimi.dsi + + + paperlib + io.papermc + + + antlr4 + org.antlr + + + antlr4-runtime + org.antlr + + + gson + com.google.code.gson + + + guava + com.google.guava + + + jchronic + com.sk89q + + + jlibnoise + com.sk89q.lib + + + lin-bus-format-snbt + org.enginehub.lin-bus.format + + + lin-bus-tree + org.enginehub.lin-bus + + + log4j-api + org.apache.logging.log4j + + + paranamer + com.thoughtworks.paranamer + + + rhino-runtime + org.mozilla + + + snakeyaml + org.yaml + + + jsr305 + com.google.code.findbugs + diff --git a/compatibility/worldguard/pom.xml b/compatibility/worldguard/pom.xml index 1674006686..56c8593452 100644 --- a/compatibility/worldguard/pom.xml +++ b/compatibility/worldguard/pom.xml @@ -58,6 +58,48 @@ worldguard-bukkit 7.0.9 provided + + + flyway-core + org.flywaydb + + + snakeyaml + org.yaml + + + guava + com.google.guava + + + antlr4 + org.antlr + + + antlr4-runtime + org.antlr + + + fastutil + it.unimi.dsi + + + gson + com.google.code.gson + + + jsr305 + com.google.code.findbugs + + + log4j-api + org.apache.logging.log4j + + + rhino-runtime + org.mozilla + + com.ghostchu.quickshop.compatibility diff --git a/platform/quickshop-platform-spigot-abstract/pom.xml b/platform/quickshop-platform-spigot-abstract/pom.xml index 94efa8807f..c9628fb56a 100644 --- a/platform/quickshop-platform-spigot-abstract/pom.xml +++ b/platform/quickshop-platform-spigot-abstract/pom.xml @@ -68,7 +68,6 @@ item-nbt-api-plugin 2.12.3 provided - true * diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 474fc96064..75f679dc3d 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -331,5 +331,39 @@ provided true + + com.github.stefvanschie.inventoryframework + IF + 0.10.13 + compile + + + cc.carm.lib + easysql-hikaricp + compile + 0.4.7 + + + org.apache.commons + commons-compress + compile + 1.25.0 + + + org.slf4j + slf4j-jdk14 + 2.0.12 + compile + + + com.ghostchu.lib.unofficial.com.alessiodp.libby + libby-core + 2.0.2-SNAPSHOT + + + com.ghostchu.lib.unofficial.com.alessiodp.libby + libby-bukkit + 2.0.2-SNAPSHOT + diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index 2d0fc22365..99b2b01381 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -44,7 +44,7 @@ org.slf4j - slf4j-jdk14 + slf4j-api 2.0.12 compile @@ -62,16 +62,10 @@ cc.carm.lib - easysql-hikaricp + easysql-api compile 0.4.7 - - org.apache.commons - commons-compress - compile - 1.25.0 - net.kyori adventure-api @@ -114,12 +108,6 @@ compile 4.3.2 - - net.kyori - adventure-serializer-configurate4 - compile - 4.15.0 - net.kyori adventure-text-logger-slf4j @@ -186,22 +174,6 @@ compile 1.3.0 - - com.ghostchu.lib.unofficial.com.alessiodp.libby - libby-core - 2.0.2-SNAPSHOT - - - com.ghostchu.lib.unofficial.com.alessiodp.libby - libby-bukkit - 2.0.2-SNAPSHOT - - - com.github.stefvanschie.inventoryframework - IF - 0.10.13 - compile - com.vdurmont semver4j From 2791ed3718a7ea29335951f6a49c59929d0a678b Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 21:16:43 +0800 Subject: [PATCH 30/81] ItemDisplay, Spigot Translatable Components, Fix load-unload loop for chunk listener --- .../ghostchu/quickshop/platform/Platform.java | 4 +- .../platform/paper/PaperPlatform.java | 6 +- .../spigot/AbstractSpigotPlatform.java | 61 +++-- .../pom.xml | 12 + .../spigot/v1_20_4/Spigot1205Platform.java | 40 +++ .../event/ShopDisplayItemSafeGuardEvent.java | 8 +- .../com/ghostchu/quickshop/api/shop/Shop.java | 2 +- .../quickshop/api/shop/ShopManager.java | 10 + .../api/shop/display/DisplayType.java | 3 +- .../quickshop/listener/ChunkListener.java | 1 + .../quickshop/listener/WorldListener.java | 2 +- .../quickshop/shop/ContainerShop.java | 11 +- .../quickshop/shop/SimpleShopManager.java | 7 +- .../shop/display/AbstractDisplayItem.java | 4 +- .../display/DisplayEntityDisplayItem.java | 243 ++++++++++++++++++ .../shop/display/RealDisplayItem.java | 7 +- .../display/virtual/VirtualDisplayItem.java | 4 +- .../watcher/DisplayAutoDespawnWatcher.java | 2 +- 18 files changed, 375 insertions(+), 52 deletions(-) create mode 100644 quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/DisplayEntityDisplayItem.java diff --git a/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java b/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java index b22591962c..1ab4c0e320 100644 --- a/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java +++ b/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java @@ -11,8 +11,8 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -95,7 +95,7 @@ default String getItemShopId(@NotNull ItemStack stack) { void setDisplayName(@NotNull ItemStack stack, @Nullable Component component); - void setDisplayName(@NotNull Item stack, @Nullable Component component); + void setDisplayName(@NotNull Entity entity, @Nullable Component component); void setLines(@NotNull Sign sign, @NotNull List component); diff --git a/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java b/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java index 802425976f..7a2beef6bc 100644 --- a/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java +++ b/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java @@ -11,6 +11,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Item; import org.bukkit.entity.Player; @@ -181,11 +182,10 @@ public void setDisplayName(@NotNull ItemStack stack, @Nullable Component compone } @Override - public void setDisplayName(@NotNull Item stack, @Nullable Component component) { - stack.customName(component); + public void setDisplayName(@NotNull Entity entity, @Nullable Component component) { + entity.customName(component); } - @Override public void setLines(@NotNull Sign sign, @NotNull List component) { for (int i = 0; i < Math.min(component.size(), 4); i++) { diff --git a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java index 598ada0700..9e9a520a41 100644 --- a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java +++ b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java @@ -16,8 +16,8 @@ import org.bukkit.block.Sign; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -149,27 +149,44 @@ public void sendSignTextChange(@NotNull Player player, @NotNull Sign sign, boole //player.sendSignChange(sign.getLocation(), components.stream().map(com -> LegacyComponentSerializer.legacySection().serialize(com)).toArray(String[]::new)); } + + @Override + public void setLore(@NotNull ItemStack stack, @NotNull Collection components) { + NBT.modify(stack, nbt->{ + ReadWriteNBT display = nbt.getOrCreateCompound("display"); + if(components.isEmpty()){ + display.removeKey("Lore"); + }else{ + List gson = components.stream().map(c->GsonComponentSerializer.gson().serialize(c)).toList(); + ReadWriteNBTList list = display.getStringList("Lore"); + list.clear(); + list.addAll(gson); + } + }); + } + @Override public void setDisplayName(@NotNull ItemStack stack, @Nullable Component component) { - if (stack.getItemMeta() == null) { - return; - } - ItemMeta meta = stack.getItemMeta(); - if (component == null) { - meta.setDisplayName(null); - } else { - meta.setDisplayName(LegacyComponentSerializer.legacySection().serialize(component)); - } - stack.setItemMeta(meta); + NBT.modify(stack, nbt -> { + ReadWriteNBT display = nbt.getOrCreateCompound("display"); + if (component == null) { + display.removeKey("Name"); + } else { + display.setString("Name", GsonComponentSerializer.gson().serialize(component)); + } + }); } + @Override - public void setDisplayName(@NotNull Item stack, @Nullable Component component) { - if (component == null) { - stack.setCustomName(null); - } else { - stack.setCustomName(LegacyComponentSerializer.legacySection().serialize(component)); - } + public void setDisplayName(@NotNull Entity entity, @Nullable Component component) { + NBT.modify(entity, nbt -> { + if (component == null) { + nbt.removeKey("CustomName"); + } else { + nbt.setString("CustomName", GsonComponentSerializer.gson().serialize(component)); + } + }); } @Override @@ -190,16 +207,6 @@ public void setLines(@NotNull Sign sign, @NotNull List component) { }); } - @Override - public void setLore(@NotNull ItemStack stack, @NotNull Collection components) { - if (!stack.hasItemMeta()) { - return; - } - ItemMeta meta = stack.getItemMeta(); - meta.setLore(components.stream().map(LegacyComponentSerializer.legacySection()::serialize).collect(Collectors.toList())); - stack.setItemMeta(meta); - } - @Override public void updateTranslationMappingSection(@NotNull Map mapping) { this.translationMapping = mapping; diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index d53d99dca5..66a52c54e3 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -96,5 +96,17 @@ provided true + + de.tr7zw + item-nbt-api-plugin + 2.12.3 + provided + + + * + * + + + diff --git a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java index 8fa20e0518..8e3e50e1ed 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java @@ -3,9 +3,16 @@ import com.ghostchu.quickshop.platform.Platform; import com.ghostchu.quickshop.platform.Util; import com.ghostchu.quickshop.platform.spigot.AbstractSpigotPlatform; +import de.tr7zw.nbtapi.NBT; +import de.tr7zw.nbtapi.NBTCompound; +import de.tr7zw.nbtapi.NBTItem; +import de.tr7zw.nbtapi.iface.ReadWriteNBT; +import de.tr7zw.nbtapi.iface.ReadWriteNBTList; import net.kyori.adventure.key.Key; import net.kyori.adventure.nbt.api.BinaryTagHolder; +import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.core.RegistryAccess; import net.minecraft.nbt.Tag; import org.bukkit.Bukkit; @@ -15,11 +22,17 @@ import org.bukkit.craftbukkit.v1_20_R4.CraftServer; import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftItemStack; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; public class Spigot1205Platform extends AbstractSpigotPlatform implements Platform { @@ -64,6 +77,33 @@ public void registerCommand(@NotNull String prefix, @NotNull Command command) { return postProcessingTranslationKey(material.getTranslationKey()); } + @Override + public void setDisplayName(@NotNull ItemStack stack, @Nullable Component component) { + NBT.modify(stack, nbt->{ + ReadWriteNBT itemComponents = nbt.getOrCreateCompound("components"); + if (component == null) { + itemComponents.removeKey("minecraft:custom_name"); + } else { + itemComponents.setString("minecraft:custom_name", GsonComponentSerializer.gson().serialize(component)); + } + }); + } + + + @Override + public void setLore(@NotNull ItemStack stack, @NotNull Collection components) { + NBT.modify(stack, nbt->{ + ReadWriteNBT itemComponents = nbt.getOrCreateCompound("components"); + if (components.isEmpty()) { + itemComponents.removeKey("minecraft:lores"); + } else { + List gson = components.stream().map(c->GsonComponentSerializer.gson().serialize(c)).toList(); + ReadWriteNBTList list = itemComponents.getStringList("minecraft:lores"); + list.clear(); + list.addAll(gson); + } + }); + } private String postProcessingTranslationKey(String key) { return this.translationMapping.getOrDefault(key, key); diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopDisplayItemSafeGuardEvent.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopDisplayItemSafeGuardEvent.java index 03e514d0d8..af352c4110 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopDisplayItemSafeGuardEvent.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopDisplayItemSafeGuardEvent.java @@ -1,7 +1,7 @@ package com.ghostchu.quickshop.api.event; import com.ghostchu.quickshop.api.shop.Shop; -import org.bukkit.entity.Item; +import org.bukkit.entity.Entity; import org.jetbrains.annotations.NotNull; /** @@ -12,7 +12,7 @@ public class ShopDisplayItemSafeGuardEvent extends AbstractQSEvent { private final Shop shop; @NotNull - private final Item entity; + private final Entity entity; /** * This event called after QuickShop safe guarded (+protection flags and attributes) a display item. @@ -20,7 +20,7 @@ public class ShopDisplayItemSafeGuardEvent extends AbstractQSEvent { * @param shop the shop * @param entity the display item */ - public ShopDisplayItemSafeGuardEvent(@NotNull Shop shop, @NotNull Item entity) { + public ShopDisplayItemSafeGuardEvent(@NotNull Shop shop, @NotNull Entity entity) { this.shop = shop; this.entity = entity; } @@ -31,7 +31,7 @@ public ShopDisplayItemSafeGuardEvent(@NotNull Shop shop, @NotNull Item entity) { * @return the display item */ @NotNull - public Item getEntity() { + public Entity getEntity() { return entity; } diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/Shop.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/Shop.java index a7e85a4a83..13fec40e71 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/Shop.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/Shop.java @@ -424,7 +424,7 @@ default List getSignText(@NotNull ProxiedLocale locale) { @Deprecated() @ApiStatus.Internal - void handleUnloading(); + void handleUnloading(boolean dontTouchWorld); /** * open a preview for shop item diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/ShopManager.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/ShopManager.java index 33e90d275c..f0b46468ed 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/ShopManager.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/ShopManager.java @@ -327,6 +327,16 @@ void actionSelling( */ void unloadShop(@NotNull Shop shop); + /** + * Load shop method for loading shop into mapping, so getShops method will can find it. It also + * effects a lots of feature, make sure load it after create it. + * + * @param world The world the shop is in + * @param shop The shop to load + * @param chunkUnloading If unloadShop called caused by chunk unloading, when this is true, QuickShop will try avoid any main-thread opreations to avoid load-unload-load loop + */ + void unloadShop(@NotNull Shop shop, boolean chunkUnloading); + /** * Change the owner to unlimited shop owner. * It defined in configuration. diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/display/DisplayType.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/display/DisplayType.java index 4f85f448df..b8eeb4c22d 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/display/DisplayType.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/shop/display/DisplayType.java @@ -15,7 +15,8 @@ public enum DisplayType { REALITEM(0), // ARMORSTAND(1), VIRTUALITEM(2), - CUSTOM(3); + ENTITY_DISPLAY(3), + CUSTOM(900); private static final Map TYPE_MAP; diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/ChunkListener.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/ChunkListener.java index bcdebe5d7b..a8ae20ed65 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/ChunkListener.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/ChunkListener.java @@ -72,6 +72,7 @@ public void onChunkUnload(ChunkUnloadEvent e) { } } } + } /** diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/WorldListener.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/WorldListener.java index 337759206b..ebcd39d52b 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/WorldListener.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/WorldListener.java @@ -88,7 +88,7 @@ public void onWorldUnload(WorldUnloadEvent e) { } for (final Shop shop : inChunk.values()) { if (shop.isLoaded()) { //Don't unload already unloaded shops. - shop.handleUnloading(); + plugin.getShopManager().unloadShop(shop,true); } } } 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 f8afbff1dd..28dc1fdf21 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 @@ -20,6 +20,7 @@ import com.ghostchu.quickshop.obj.QUserImpl; import com.ghostchu.quickshop.shop.datatype.ShopSignPersistentDataType; import com.ghostchu.quickshop.shop.display.AbstractDisplayItem; +import com.ghostchu.quickshop.shop.display.DisplayEntityDisplayItem; import com.ghostchu.quickshop.shop.display.RealDisplayItem; import com.ghostchu.quickshop.util.MsgUtil; import com.ghostchu.quickshop.util.PackageUtil; @@ -31,6 +32,7 @@ import com.ghostchu.simplereloadlib.Reloadable; import io.papermc.lib.PaperLib; import lombok.EqualsAndHashCode; +import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.apache.commons.lang3.StringUtils; @@ -320,7 +322,7 @@ public void checkDisplay() { boolean displayStatus = plugin.isDisplayEnabled() && !isDisableDisplay() && this.isLoaded() && !this.isDeleted(); if (!displayStatus) { if (this.displayItem != null) { - this.displayItem.remove(); + this.displayItem.remove(false); } return; } @@ -338,6 +340,7 @@ public void checkDisplay() { yield new RealDisplayItem(this); } } + case ENTITY_DISPLAY -> new DisplayEntityDisplayItem(this); default -> new RealDisplayItem(this); }; } @@ -484,7 +487,7 @@ public void setItem(@NotNull ItemStack item) { this.item = item; this.originalItem = item; if (this.displayItem != null) { - this.displayItem.remove(); + this.displayItem.remove(false); } this.displayItem = null; checkDisplay(); @@ -1079,7 +1082,7 @@ public void handleLoading() { * Unload ContainerShop. */ @Override - public void handleUnloading() { + public void handleUnloading(boolean dontTouchWorld) { Util.ensureThread(false); if (!this.isLoaded) { Log.debug("Dupe unload request, canceled."); @@ -1089,7 +1092,7 @@ public void handleUnloading() { inventoryPreview.close(); } if (this.displayItem != null) { - this.displayItem.remove(); + this.displayItem.remove(dontTouchWorld); } this.isLoaded = false; plugin.getShopManager().getLoadedShops().remove(this); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 756e49794b..52a3b7e55f 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -1135,12 +1135,15 @@ public void loadShop(@NotNull Shop shop) { @Override public void unloadShop(@NotNull Shop shop) { + unloadShop(shop, false); + } + @Override + public void unloadShop(@NotNull Shop shop,boolean dontTouchWorld) { //noinspection deprecation - shop.handleUnloading(); + shop.handleUnloading(dontTouchWorld); this.loadedShops.remove(shop); } - /** * Change the owner to unlimited shop owner. * It defined in configuration. diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/AbstractDisplayItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/AbstractDisplayItem.java index 7191cf108d..6f0026749f 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/AbstractDisplayItem.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/AbstractDisplayItem.java @@ -256,7 +256,6 @@ public static ShopProtectionFlag createShopProtectionFlag( * @return The Location that the item *should* be displaying at. */ public @Nullable Location getDisplayLocation() { - Util.ensureThread(false); return this.shop.getLocation().clone().add(0.5, 1.2, 0.5); } @@ -310,8 +309,9 @@ public ReloadResult reloadModule() { /** * Remove the display entity. + * @param dontTouchWorld When it is true, display impl should avoid touch the world to avoid unload-load loop */ - public abstract void remove(); + public abstract void remove(boolean dontTouchWorld); /** * Remove this shop's display in the whole world.(Not whole server) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/DisplayEntityDisplayItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/DisplayEntityDisplayItem.java new file mode 100644 index 0000000000..5a0ba7b146 --- /dev/null +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/DisplayEntityDisplayItem.java @@ -0,0 +1,243 @@ +package com.ghostchu.quickshop.shop.display; + +import com.ghostchu.quickshop.api.event.ShopDisplayItemDespawnEvent; +import com.ghostchu.quickshop.api.event.ShopDisplayItemSafeGuardEvent; +import com.ghostchu.quickshop.api.event.ShopDisplayItemSpawnEvent; +import com.ghostchu.quickshop.api.shop.Shop; +import com.ghostchu.quickshop.api.shop.display.DisplayType; +import com.ghostchu.quickshop.util.MsgUtil; +import com.ghostchu.quickshop.util.Util; +import com.ghostchu.quickshop.util.logger.Log; +import io.papermc.lib.PaperLib; +import org.bukkit.Location; +import org.bukkit.entity.*; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.util.Transformation; +import org.bukkit.util.Vector; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.joml.AxisAngle4f; +import org.joml.Vector3f; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + +public class DisplayEntityDisplayItem extends AbstractDisplayItem { + private static final Vector axis = new Vector(0, 1, 0); + ItemDisplay displayEntity; + + /** + * ZZ Creates a new display item. + * + * @param shop The shop (See Shop) + */ + public DisplayEntityDisplayItem(@NotNull Shop shop) { + super(shop); + } + + @Override + public boolean checkDisplayIsMoved() { + return false; // Display won't move unless somebody teleport it.... + } + + @Override + public boolean checkDisplayNeedRegen() { + Util.ensureThread(false); + if (this.displayEntity == null) { + return false; + } + return !this.displayEntity.isValid(); + } + + @Override + public boolean checkIsShopEntity(@NotNull Entity entity) { + Util.ensureThread(false); + if (!(entity instanceof ItemDisplay display)) { + return false; + } + return AbstractDisplayItem.checkIsGuardItemStack(display.getItemStack()); + } + + @Override + public void fixDisplayMoved() { + Util.ensureThread(false); + Location location = this.getDisplayLocation(); + if (this.displayEntity != null && location != null) { + PaperLib.teleportAsync(this.displayEntity, location); + return; + } + fixDisplayMovedOld(); + } + + public void fixDisplayMovedOld() { + Util.ensureThread(false); + for (Entity entity : Objects.requireNonNull(this.shop.getLocation().getWorld()) + .getEntities()) { + if (!(entity instanceof Display display)) { + continue; + } + if (display.getUniqueId().equals(Objects.requireNonNull(this.displayEntity).getUniqueId())) { + Log.debug("Fixing moved Item displayItem " + display.getUniqueId() + " at " + display.getLocation()); + PaperLib.teleportAsync(entity, Objects.requireNonNull(getDisplayLocation()), PlayerTeleportEvent.TeleportCause.UNKNOWN); + return; + } + } + } + + @Override + public void fixDisplayNeedRegen() { + Util.ensureThread(false); + respawn(); + } + + @Override + public @Nullable Entity getDisplay() { + return this.displayEntity; + } + + @Override + public boolean isSpawned() { + if (this.displayEntity == null) { + return false; + } + return this.displayEntity.isValid(); + } + + @Override + public boolean isApplicableForPlayer(Player player) { + return true; + } + + @Override + public void remove(boolean dontTouchWorld) { + Util.ensureThread(false); + if (this.displayEntity == null) { + Log.debug("Ignore the Item removing because the Item is already gone or it's a left shop."); + return; + } + if(dontTouchWorld){ + return; + } + this.displayEntity.remove(); + this.displayEntity = null; + this.guardedIstack = null; + new ShopDisplayItemDespawnEvent(shop, originalItemStack, DisplayType.ENTITY_DISPLAY).callEvent(); + } + + @Override + public boolean removeDupe() { + Util.ensureThread(false); + if (this.displayEntity == null) { + Log.debug("Warning: Trying to removeDupe for a null display shop."); + return false; + } + + boolean removed = false; + + List elist = new ArrayList<>(displayEntity.getNearbyEntities(1.5, 1.5, 1.5)); + for (Entity entity : elist) { + if (entity.getType() != EntityType.ITEM_DISPLAY) { + continue; + } + ItemDisplay eItem = (ItemDisplay) entity; + UUID displayUUID = this.displayEntity.getUniqueId(); + if (eItem.getItemStack() == null) { + continue; + } + if (!eItem.getUniqueId().equals(displayUUID)) { + if (AbstractDisplayItem.checkIsTargetShopDisplay(eItem.getItemStack(), this.shop)) { + Log.debug("Removing a duped ItemEntity " + eItem.getUniqueId() + " at " + eItem.getLocation()); + entity.remove(); + removed = true; + } + } + } + return removed; + } + + @Override + public void respawn() { + Util.ensureThread(false); + remove(false); + spawn(); + } + + @Override + public void safeGuard(@NotNull Entity entity) { + Util.ensureThread(false); + if (!(entity instanceof ItemDisplay display)) { + Log.debug( + "Failed to safeGuard " + entity.getLocation() + ", cause target not a Item"); + return; + } + // Set item protect in the armorstand's hand + + if (PLUGIN.getConfig().getBoolean("shop.display-item-use-name")) { + PLUGIN.getPlatform().setDisplayName(display, Util.getItemStackName(this.originalItemStack)); + display.setCustomNameVisible(true); + } else { + display.setCustomNameVisible(false); + } + + display.setSilent(true); + display.setInvulnerable(true); + display.setPortalCooldown(Integer.MAX_VALUE); + display.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.GROUND); + display.setBillboard(Display.Billboard.VERTICAL); + } + + @Override + public void spawn() { + Util.ensureThread(false); + if (!shop.isLoaded()) { + return; + } + if (shop.getLocation().getWorld() == null) { + Log.debug("Canceled the itemDisplay spawning because the location in the world is null."); + return; + } + + if (originalItemStack == null) { + Log.debug("Canceled the itemDisplay spawning because the ItemStack is null."); + return; + } + if (displayEntity != null && displayEntity.isValid()) { + Log.debug("Warning: Spawning the itemDisplay for DisplayItem when there is already an existing Dropped Item, May cause a duplicated Dropped Item!"); + MsgUtil.debugStackTrace(Thread.currentThread().getStackTrace()); + } + if (!Util.isDisplayAllowBlock( + Objects.requireNonNull(getDisplayLocation()).getBlock().getType())) { + Log.debug("Can't spawn the itemDisplay because there is not an AIR block above the shopblock."); + return; + } + + + if (new ShopDisplayItemSpawnEvent(shop, originalItemStack, DisplayType.REALITEM).callCancellableEvent()) { + Log.debug("Canceled the itemDisplay spawning because a plugin setCancelled the spawning event, usually this is a QuickShop Add on"); + return; + } + this.guardedIstack = AbstractDisplayItem.createGuardItemStack(this.originalItemStack, this.shop); + this.displayEntity = (ItemDisplay) this.shop.getLocation().getWorld().spawnEntity(getDisplayLocation(), EntityType.ITEM_DISPLAY, false); + this.displayEntity.setItemStack(this.guardedIstack); + safeGuard(displayEntity); + new ShopDisplayItemSafeGuardEvent(shop, this.displayEntity).callEvent(); + } + + /** + * Gets either the item spawn location of this item's chest. + * Used for checking for duplicates. + * + * @return The display location of the item. + */ + public @Nullable Location getDoubleShopDisplayLocations() { + Util.ensureThread(false); + return shop.getLocation().clone().add(0.5, 1.1, 0.5); + } + + @Override + public @Nullable Location getDisplayLocation() { + return this.shop.getLocation().clone().add(0.5, 1.1, 0.5); + } +} diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java index bf14ab42ba..89137b8b10 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java @@ -123,12 +123,15 @@ public boolean isApplicableForPlayer(Player player) { } @Override - public void remove() { + public void remove(boolean dontTouchWorld) { Util.ensureThread(false); if (this.item == null) { Log.debug("Ignore the Item removing because the Item is already gone or it's a left shop."); return; } + if(dontTouchWorld){ + return; + } this.item.remove(); this.item = null; this.guardedIstack = null; @@ -167,7 +170,7 @@ public boolean removeDupe() { @Override public void respawn() { Util.ensureThread(false); - remove(); + remove(false); spawn(); } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItem.java index 01847f678e..54169a9e26 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItem.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItem.java @@ -93,7 +93,7 @@ public boolean isApplicableForPlayer(Player player) { } @Override - public void remove() { + public void remove(boolean dontTouchWorld) { if (isSpawned()) { sendPacketToAll(fakeItemDestroyPacket); unload(); @@ -109,7 +109,7 @@ public boolean removeDupe() { @Override public void respawn() { Util.ensureThread(false); - remove(); + remove(false); spawn(); } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/watcher/DisplayAutoDespawnWatcher.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/watcher/DisplayAutoDespawnWatcher.java index 284f2806eb..26e960a1f1 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/watcher/DisplayAutoDespawnWatcher.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/watcher/DisplayAutoDespawnWatcher.java @@ -70,7 +70,7 @@ public void run() { displayItem.spawn(); } } else if (displayItem.isSpawned()) { - displayItem.remove(); + displayItem.remove(false); } } } From 0dd9aa3f0ededf842e0aa83cf359002b32a95411 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 22:30:23 +0800 Subject: [PATCH 31/81] Version compatibility stuff --- pom.xml | 2 +- .../ghostchu/quickshop/api/GameVersion.java | 6 +-- .../listener/DisplayProtectionListener.java | 3 +- .../quickshop/shop/SimpleShopManager.java | 47 +++++++------------ .../shop/display/RealDisplayItem.java | 3 +- .../display/virtual/packetfactory/v1_18.java | 2 +- .../virtual/packetfactory/v1_19_R1.java | 2 +- .../packetfactory/v1_19_R2_TO_v1_20_R1.java | 2 +- .../virtual/packetfactory/v1_20_R2.java | 2 +- .../virtual/packetfactory/v1_20_R4.java | 2 +- .../util/envcheck/EnvironmentChecker.java | 2 +- 11 files changed, 29 insertions(+), 44 deletions(-) diff --git a/pom.xml b/pom.xml index 551156ea5c..3a3e3f72a3 100644 --- a/pom.xml +++ b/pom.xml @@ -310,7 +310,7 @@ org.spigotmc spigot-api - 1.20.4-R0.1-SNAPSHOT + 1.20.6-R0.1-SNAPSHOT provided diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java index 5097235e04..5e166b9608 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java @@ -41,10 +41,10 @@ public enum GameVersion { v1_16_R4(false, true, false, false, false, false), v1_17_R1(false, true, false, true, true, true), v1_18_R1(false, true, false, true, true, true), - v1_18_R2(true, false, true, true, true, true), + v1_18_R2(true, true, true, true, true, true), v1_19_R1(true, true, true, true, true, true), - v1_19_R2(true, false, true, true, true, true), - v1_19_R3(true, false, true, true, true, true), + v1_19_R2(true, true, true, true, true, true), + v1_19_R3(true, true, true, true, true, true), v1_20_R1(true, true, true, true, true, true), v1_20_R2(true, false, true, true, true, true), v1_20_R3(true, false, true, true, true, true), diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/DisplayProtectionListener.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/DisplayProtectionListener.java index 93665d01bb..79346dad15 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/DisplayProtectionListener.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/listener/DisplayProtectionListener.java @@ -84,10 +84,9 @@ public void player(PlayerFishEvent event) { if (event.getCaught() == null) { return; } - if (event.getCaught().getType() != EntityType.DROPPED_ITEM) { + if (!(event.getCaught() instanceof Item item)) { return; } - final Item item = (Item) event.getCaught(); final ItemStack is = item.getItemStack(); if (!AbstractDisplayItem.checkIsGuardItemStack(is)) { return; diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 52a3b7e55f..30161aafb6 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -62,12 +62,9 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -1135,10 +1132,11 @@ public void loadShop(@NotNull Shop shop) { @Override public void unloadShop(@NotNull Shop shop) { - unloadShop(shop, false); + unloadShop(shop, false); } + @Override - public void unloadShop(@NotNull Shop shop,boolean dontTouchWorld) { + public void unloadShop(@NotNull Shop shop, boolean dontTouchWorld) { //noinspection deprecation shop.handleUnloading(dontTouchWorld); this.loadedShops.remove(shop); @@ -1409,7 +1407,7 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { if (items.hasItemMeta()) { ItemMeta shopItemMeta = shop.getItem().getItemMeta(); shouldDisplayEnchantments = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ENCHANTS); - shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS); + shouldDisplayPotionEffects = shopItemMeta.hasItemFlag(ItemFlag.HIDE_ADDITIONAL_TOOLTIP); } } @@ -1418,37 +1416,26 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { } if (shouldDisplayPotionEffects) { if (items.hasItemMeta() && (items.getItemMeta() instanceof PotionMeta potionMeta)) { - PotionData potionData = potionMeta.getBasePotionData(); - PotionEffectType potionEffectType = potionData.getType().getEffectType(); - if (potionEffectType != null) { + List effects = new ArrayList<>(); + if (potionMeta.getBasePotionType() != null) { + effects.addAll(potionMeta.getBasePotionType().getPotionEffects()); + } + if (potionMeta.hasCustomEffects()) { + effects.addAll(potionMeta.getCustomEffects()); + } + for (PotionEffect potionEffect : effects) { + int level = potionEffect.getAmplifier(); Component translation; try { - translation = plugin.getPlatform().getTranslation(potionEffectType); + translation = plugin.getPlatform().getTranslation(potionEffect.getType()); } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffectType.getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffectType.getKey(), th); + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); } - chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); - //Because the bukkit API limit, we can't get the actual effect level chatSheetPrinter.printLine(Component.empty() .color(NamedTextColor.YELLOW) .append(translation) - ); - } - if (potionMeta.hasCustomEffects()) { - for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { - int level = potionEffect.getAmplifier(); - Component translation; - try { - translation = plugin.getPlatform().getTranslation(potionEffect.getType()); - } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); - } - chatSheetPrinter.printLine(Component.empty() - .color(NamedTextColor.YELLOW) - .append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); - } + .append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java index 89137b8b10..64f05368ed 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/RealDisplayItem.java @@ -151,10 +151,9 @@ public boolean removeDupe() { List elist = new ArrayList<>(item.getNearbyEntities(1.5, 1.5, 1.5)); for (Entity entity : elist) { - if (entity.getType() != EntityType.DROPPED_ITEM) { + if (!(entity instanceof Item eItem)) { continue; } - Item eItem = (Item) entity; UUID displayUUID = this.item.getUniqueId(); if (!eItem.getUniqueId().equals(displayUUID)) { if (AbstractDisplayItem.checkIsTargetShopDisplay(eItem.getItemStack(), this.shop)) { diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java index e72c50b914..57e640e075 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java @@ -60,7 +60,7 @@ public v1_18(QuickShop plugin, VirtualDisplayItemManager manager) { //Entity ID .write(0, entityID); //int data to mark - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.DROPPED_ITEM); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); fakeItemPacket.getIntegers().write(1, 0) //Velocity y .write(2, 0) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java index afda11361d..de14a03aee 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java @@ -58,7 +58,7 @@ public v1_19_R1(QuickShop plugin, VirtualDisplayItemManager manager) { fakeItemPacket.getIntegers() //Entity ID .write(0, entityID); - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.DROPPED_ITEM); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java index d59039735d..956ede8a17 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java @@ -63,7 +63,7 @@ public v1_19_R2_TO_v1_20_R1(QuickShop plugin, VirtualDisplayItemManager manager) //Entity ID .write(0, entityID); //Velocity x - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.DROPPED_ITEM); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java index 52e3e8384a..07d19dcb75 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java @@ -60,7 +60,7 @@ public v1_20_R2(QuickShop plugin, VirtualDisplayItemManager manager) { //Entity ID .write(0, entityID); //Velocity x - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.DROPPED_ITEM); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java index a870683a76..df0a4f58e2 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R4.java @@ -60,7 +60,7 @@ public v1_20_R4(QuickShop plugin, VirtualDisplayItemManager manager) { //Entity ID .write(0, entityID); //Velocity x - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.DROPPED_ITEM); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.ITEM); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java index e297c5364a..63572955af 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java @@ -73,7 +73,7 @@ public ResultContainer coreSupportTest() { @EnvCheckEntry(name = "End of life Test", priority = Integer.MAX_VALUE, stage = EnvCheckEntry.Stage.ON_ENABLE) public ResultContainer eolTest() { if (plugin.getGameVersion().isEndOfLife()) { - return new ResultContainer(CheckResult.WARNING, "You're running a Minecraft server with end of life version, QuickShop may not work on this version in future, and you won't receive any in-game update notification anymore, upgrade your server version!"); + return new ResultContainer(CheckResult.WARNING, "You're running a Minecraft server with a end of life version, QuickShop may not work on this version in future, consider upgrade your server version!"); } return new ResultContainer(CheckResult.PASSED, CHECK_PASSED_RETURNS); } From ca0bd9fd8ffd3e3f0343008ef6999e735bdf8a2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 14:31:46 +0000 Subject: [PATCH 32/81] Bump org.slf4j:slf4j-jdk14 from 2.0.12 to 2.0.13 Bumps org.slf4j:slf4j-jdk14 from 2.0.12 to 2.0.13. --- updated-dependencies: - dependency-name: org.slf4j:slf4j-jdk14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- quickshop-bukkit/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 75f679dc3d..99210ca5bf 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -352,7 +352,7 @@ org.slf4j slf4j-jdk14 - 2.0.12 + 2.0.13 compile From 6c10c2dfba5855374e343f895a2170efb0e637c0 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 22:37:12 +0800 Subject: [PATCH 33/81] Fix potion effect info showcase --- .../java/com/ghostchu/quickshop/shop/SimpleShopManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 30161aafb6..91c2511841 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -1407,7 +1407,7 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { if (items.hasItemMeta()) { ItemMeta shopItemMeta = shop.getItem().getItemMeta(); shouldDisplayEnchantments = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ENCHANTS); - shouldDisplayPotionEffects = shopItemMeta.hasItemFlag(ItemFlag.HIDE_ADDITIONAL_TOOLTIP); + shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ADDITIONAL_TOOLTIP); } } From 8ee413649cf19fc4ff3fcb821fa4b781dc13c59f Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 22:40:13 +0800 Subject: [PATCH 34/81] Backport support for hidePotionEffect ItemFlag --- .../com/ghostchu/quickshop/shop/SimpleShopManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 91c2511841..33d551316f 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -56,6 +56,7 @@ import org.bukkit.block.data.Waterlogged; import org.bukkit.block.data.type.WallSign; import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemFlag; @@ -1407,7 +1408,13 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { if (items.hasItemMeta()) { ItemMeta shopItemMeta = shop.getItem().getItemMeta(); shouldDisplayEnchantments = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ENCHANTS); - shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ADDITIONAL_TOOLTIP); + ItemFlag hidePotionEffect; + try { + hidePotionEffect = ItemFlag.valueOf("HIDE_ADDITIONAL_TOOLTIP"); + }catch (Exception e){ + hidePotionEffect = ItemFlag.valueOf("HIDE_POTION_EFFECTS"); // Remove this when we dropped 1.20.x support + } + shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(hidePotionEffect); } } From b78ec83af2daf41c7811b7548fc9ae325a45d269 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 6 May 2024 22:44:00 +0800 Subject: [PATCH 35/81] rename class --- .../shop/display/virtual/VirtualDisplayItemManager.java | 2 +- .../{v1_20_R2.java => v1_20_R2_TO_v1_20_R3.java} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/{v1_20_R2.java => v1_20_R2_TO_v1_20_R3.java} (98%) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java index 94c88dcacc..fa084f906f 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/VirtualDisplayItemManager.java @@ -57,7 +57,7 @@ public void load() { case v1_18_R1, v1_18_R2 -> new v1_18(plugin, this); case v1_19_R1 -> new v1_19_R1(plugin, this); case v1_19_R2, v1_19_R3, v1_20_R1 -> new v1_19_R2_TO_v1_20_R1(plugin, this); - case v1_20_R2, v1_20_R3 -> new v1_20_R2(plugin, this); + case v1_20_R2, v1_20_R3 -> new v1_20_R2_TO_v1_20_R3(plugin, this); case v1_20_R4 -> new v1_20_R4(plugin, this); default -> throw new IllegalStateException("Unsupported Virtual Display Minecraft version: " + plugin.getGameVersion()); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java similarity index 98% rename from quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java rename to quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java index 07d19dcb75..8d5ba91b87 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java @@ -28,11 +28,11 @@ import java.util.Optional; import java.util.UUID; -public class v1_20_R2 implements VirtualDisplayPacketFactory { +public class v1_20_R2_TO_v1_20_R3 implements VirtualDisplayPacketFactory { private final QuickShop plugin; private final VirtualDisplayItemManager manager; - public v1_20_R2(QuickShop plugin, VirtualDisplayItemManager manager) { + public v1_20_R2_TO_v1_20_R3(QuickShop plugin, VirtualDisplayItemManager manager) { this.plugin = plugin; this.manager = manager; } From 1dc6ba26ed0c929bd69bfd62f99049373b755c45 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 01:38:22 +0800 Subject: [PATCH 36/81] fix translation file --- quickshop-bukkit/src/main/resources/lang/messages.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 3c946e5377..2d77e5bac0 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -1747,6 +1747,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1759,6 +1760,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1784,4 +1791,5 @@ about: - "Powered by community Made with ❤" valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" - kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" \ No newline at end of file + kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" \ No newline at end of file From 42283954180b05b6785c7aa23d2d23bcb2aa72c3 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Tue, 7 May 2024 01:40:13 +0800 Subject: [PATCH 37/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/af-ZA/messages.yml | 8 ++++++++ crowdin/lang/ar-SA/messages.yml | 8 ++++++++ crowdin/lang/bg-BG/messages.yml | 8 ++++++++ crowdin/lang/ca-ES/messages.yml | 8 ++++++++ crowdin/lang/cs-CZ/messages.yml | 8 ++++++++ crowdin/lang/da-DK/messages.yml | 8 ++++++++ crowdin/lang/de-DE/messages.yml | 8 ++++++++ crowdin/lang/el-GR/messages.yml | 8 ++++++++ crowdin/lang/en-US/messages.yml | 8 ++++++++ crowdin/lang/es-ES/messages.yml | 8 ++++++++ crowdin/lang/fa-IR/messages.yml | 8 ++++++++ crowdin/lang/fi-FI/messages.yml | 8 ++++++++ crowdin/lang/fr-FR/messages.yml | 8 ++++++++ crowdin/lang/he-IL/messages.yml | 8 ++++++++ crowdin/lang/hi-IN/messages.yml | 8 ++++++++ crowdin/lang/hu-HU/messages.yml | 8 ++++++++ crowdin/lang/it-IT/messages.yml | 8 ++++++++ crowdin/lang/ja-JP/messages.yml | 8 ++++++++ crowdin/lang/ko-KR/messages.yml | 8 ++++++++ crowdin/lang/lt-LT/messages.yml | 8 ++++++++ crowdin/lang/nl-NL/messages.yml | 8 ++++++++ crowdin/lang/no-NO/messages.yml | 8 ++++++++ crowdin/lang/pl-PL/messages.yml | 8 ++++++++ crowdin/lang/pt-BR/messages.yml | 8 ++++++++ crowdin/lang/pt-PT/messages.yml | 8 ++++++++ crowdin/lang/ro-RO/messages.yml | 8 ++++++++ crowdin/lang/ru-RU/messages.yml | 8 ++++++++ crowdin/lang/sr-SP/messages.yml | 8 ++++++++ crowdin/lang/sv-SE/messages.yml | 8 ++++++++ crowdin/lang/th-TH/messages.yml | 8 ++++++++ crowdin/lang/tr-TR/messages.yml | 8 ++++++++ crowdin/lang/uk-UA/messages.yml | 8 ++++++++ crowdin/lang/vi-VN/messages.yml | 8 ++++++++ crowdin/lang/zh-CN/messages.yml | 8 ++++++++ crowdin/lang/zh-HK/messages.yml | 8 ++++++++ crowdin/lang/zh-TW/messages.yml | 8 ++++++++ 36 files changed, 288 insertions(+) diff --git a/crowdin/lang/af-ZA/messages.yml b/crowdin/lang/af-ZA/messages.yml index 8d165dc60a..d28ddaa447 100644 --- a/crowdin/lang/af-ZA/messages.yml +++ b/crowdin/lang/af-ZA/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/ar-SA/messages.yml b/crowdin/lang/ar-SA/messages.yml index 4760c183a9..1bfd7eaf94 100644 --- a/crowdin/lang/ar-SA/messages.yml +++ b/crowdin/lang/ar-SA/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/bg-BG/messages.yml b/crowdin/lang/bg-BG/messages.yml index 7d3648ea4d..afafb9395d 100644 --- a/crowdin/lang/bg-BG/messages.yml +++ b/crowdin/lang/bg-BG/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/ca-ES/messages.yml b/crowdin/lang/ca-ES/messages.yml index 3d113ba127..d38b6c0b42 100644 --- a/crowdin/lang/ca-ES/messages.yml +++ b/crowdin/lang/ca-ES/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/cs-CZ/messages.yml b/crowdin/lang/cs-CZ/messages.yml index 478d53340f..ff9da03e47 100644 --- a/crowdin/lang/cs-CZ/messages.yml +++ b/crowdin/lang/cs-CZ/messages.yml @@ -1499,6 +1499,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1511,6 +1512,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1537,3 +1544,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/da-DK/messages.yml b/crowdin/lang/da-DK/messages.yml index 2d9085f991..6f6e7b8398 100644 --- a/crowdin/lang/da-DK/messages.yml +++ b/crowdin/lang/da-DK/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index 04ec14b9ef..d5dd552206 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -1498,6 +1498,7 @@ suggest-wait: "Bitte warten... Berechne empfohlenen Preis." history: shop: gui-title: "Zeige Kaufprotokolle" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Typ: {0}" - "Besitzer: {1}" @@ -1510,6 +1511,12 @@ history: - "Gegenstand: {1} x{2}" - "Guthaben: {3}" - "Steuer: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Bitte warten, abfrage..." previous-page: "<< Vorherige Seite" next-page: "Nächste Seite >>" @@ -1536,3 +1543,4 @@ about: valid-donation-key: "Gebunden an {0}" invalid-donation-key: "Ungültiger Spendenschlüssel" kofi-thanks: "Besonderer Dank geht an alle, welche QuickShop auf Ko-fi unterstützen :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/el-GR/messages.yml b/crowdin/lang/el-GR/messages.yml index afdd52e14e..7e68dbfe15 100644 --- a/crowdin/lang/el-GR/messages.yml +++ b/crowdin/lang/el-GR/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/en-US/messages.yml b/crowdin/lang/en-US/messages.yml index 707384f6c6..cb8eb34499 100644 --- a/crowdin/lang/en-US/messages.yml +++ b/crowdin/lang/en-US/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/es-ES/messages.yml b/crowdin/lang/es-ES/messages.yml index b79c172dd6..d8ecbb6e00 100644 --- a/crowdin/lang/es-ES/messages.yml +++ b/crowdin/lang/es-ES/messages.yml @@ -1499,6 +1499,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1511,6 +1512,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1537,3 +1544,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/fa-IR/messages.yml b/crowdin/lang/fa-IR/messages.yml index 89b8195980..5c00b865fe 100644 --- a/crowdin/lang/fa-IR/messages.yml +++ b/crowdin/lang/fa-IR/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/fi-FI/messages.yml b/crowdin/lang/fi-FI/messages.yml index 112a646252..dbef3fbd0d 100644 --- a/crowdin/lang/fi-FI/messages.yml +++ b/crowdin/lang/fi-FI/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/fr-FR/messages.yml b/crowdin/lang/fr-FR/messages.yml index d3f5d6dac6..ddd580dfa5 100644 --- a/crowdin/lang/fr-FR/messages.yml +++ b/crowdin/lang/fr-FR/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/he-IL/messages.yml b/crowdin/lang/he-IL/messages.yml index 9e16b3d0f3..595d7578d4 100644 --- a/crowdin/lang/he-IL/messages.yml +++ b/crowdin/lang/he-IL/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/hi-IN/messages.yml b/crowdin/lang/hi-IN/messages.yml index e8ad54bc54..1c0392de27 100644 --- a/crowdin/lang/hi-IN/messages.yml +++ b/crowdin/lang/hi-IN/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/hu-HU/messages.yml b/crowdin/lang/hu-HU/messages.yml index 132661e197..797646e374 100644 --- a/crowdin/lang/hu-HU/messages.yml +++ b/crowdin/lang/hu-HU/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index d476896807..a2b0e0f467 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/ja-JP/messages.yml b/crowdin/lang/ja-JP/messages.yml index c7e3c263f1..0646df3599 100644 --- a/crowdin/lang/ja-JP/messages.yml +++ b/crowdin/lang/ja-JP/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/ko-KR/messages.yml b/crowdin/lang/ko-KR/messages.yml index 3cd01ec372..8f2720c7f0 100644 --- a/crowdin/lang/ko-KR/messages.yml +++ b/crowdin/lang/ko-KR/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/lt-LT/messages.yml b/crowdin/lang/lt-LT/messages.yml index 1b2688da23..739d2dd9e9 100644 --- a/crowdin/lang/lt-LT/messages.yml +++ b/crowdin/lang/lt-LT/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/nl-NL/messages.yml b/crowdin/lang/nl-NL/messages.yml index 3d235f2065..86a70cb82a 100644 --- a/crowdin/lang/nl-NL/messages.yml +++ b/crowdin/lang/nl-NL/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/no-NO/messages.yml b/crowdin/lang/no-NO/messages.yml index 409d633f66..e03765c1db 100644 --- a/crowdin/lang/no-NO/messages.yml +++ b/crowdin/lang/no-NO/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Vennligst vent... Beregner anbefalt pris." history: shop: gui-title: "Se kjøpshistorikk" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Eier: {1}" @@ -1528,6 +1529,12 @@ history: - "Gjenstand: {1} x{2}" - "Saldo: {3}" - "Skatt: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Vennligst vent, henter informasjon..." previous-page: "<< Forrige side" next-page: "Neste side >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bundet til {0}" invalid-donation-key: "Ugyldig donasjonsnøkkel" kofi-thanks: "Spesiell takk til de som støtter QuickShop på Ko-Fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/pl-PL/messages.yml b/crowdin/lang/pl-PL/messages.yml index 1c1eaaed96..14cd8dc0d9 100644 --- a/crowdin/lang/pl-PL/messages.yml +++ b/crowdin/lang/pl-PL/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/pt-BR/messages.yml b/crowdin/lang/pt-BR/messages.yml index 1227f871fe..2e8b3109f2 100644 --- a/crowdin/lang/pt-BR/messages.yml +++ b/crowdin/lang/pt-BR/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/pt-PT/messages.yml b/crowdin/lang/pt-PT/messages.yml index 1ca1aa5958..1a6ee04404 100644 --- a/crowdin/lang/pt-PT/messages.yml +++ b/crowdin/lang/pt-PT/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/ro-RO/messages.yml b/crowdin/lang/ro-RO/messages.yml index 2f90c92229..89000b5456 100644 --- a/crowdin/lang/ro-RO/messages.yml +++ b/crowdin/lang/ro-RO/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/ru-RU/messages.yml b/crowdin/lang/ru-RU/messages.yml index ef687f92ce..43d2627c01 100644 --- a/crowdin/lang/ru-RU/messages.yml +++ b/crowdin/lang/ru-RU/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/sr-SP/messages.yml b/crowdin/lang/sr-SP/messages.yml index 419a4d430c..b432327198 100644 --- a/crowdin/lang/sr-SP/messages.yml +++ b/crowdin/lang/sr-SP/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/sv-SE/messages.yml b/crowdin/lang/sv-SE/messages.yml index 98054ee26f..7cd33f87db 100644 --- a/crowdin/lang/sv-SE/messages.yml +++ b/crowdin/lang/sv-SE/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/th-TH/messages.yml b/crowdin/lang/th-TH/messages.yml index 9a371a8bbb..7b079f7dbe 100644 --- a/crowdin/lang/th-TH/messages.yml +++ b/crowdin/lang/th-TH/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/tr-TR/messages.yml b/crowdin/lang/tr-TR/messages.yml index f67585770b..d8c404b2cb 100644 --- a/crowdin/lang/tr-TR/messages.yml +++ b/crowdin/lang/tr-TR/messages.yml @@ -1499,6 +1499,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1511,6 +1512,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1537,3 +1544,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/uk-UA/messages.yml b/crowdin/lang/uk-UA/messages.yml index 4d93b6577d..74c8fa5c89 100644 --- a/crowdin/lang/uk-UA/messages.yml +++ b/crowdin/lang/uk-UA/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/vi-VN/messages.yml b/crowdin/lang/vi-VN/messages.yml index b3ceb7c0a6..45dd47936e 100644 --- a/crowdin/lang/vi-VN/messages.yml +++ b/crowdin/lang/vi-VN/messages.yml @@ -1500,6 +1500,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1512,6 +1513,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1538,3 +1545,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/zh-CN/messages.yml b/crowdin/lang/zh-CN/messages.yml index 7f0f77994b..ab97d6479e 100644 --- a/crowdin/lang/zh-CN/messages.yml +++ b/crowdin/lang/zh-CN/messages.yml @@ -1508,6 +1508,7 @@ suggest-wait: "请稍候... 计算推荐价格。" history: shop: gui-title: "查看交易记录" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "类型: {0}" - "所有者: {1}" @@ -1520,6 +1521,12 @@ history: - "物品: {1} x{2}" - "余额: {3}" - "税: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "请稍候,正在查询..." previous-page: "<< 前一页" next-page: "下一页 >>" @@ -1546,3 +1553,4 @@ about: valid-donation-key: "绑定到 {0}" invalid-donation-key: "无效的捐赠密钥" kofi-thanks: "特别感谢那些在 Ko-Fi 上支持 QuickShop 的人 :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/zh-HK/messages.yml b/crowdin/lang/zh-HK/messages.yml index e4f0f5830c..1d6526b26a 100644 --- a/crowdin/lang/zh-HK/messages.yml +++ b/crowdin/lang/zh-HK/messages.yml @@ -1516,6 +1516,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "View purchase history" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "Type: {0}" - "Owner: {1}" @@ -1528,6 +1529,12 @@ history: - "Item: {1} x{2}" - "Balance: {3}" - "Tax: {4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "<< Previous Page" next-page: "Next Page >>" @@ -1554,3 +1561,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 2b60f38ab9..054378926a 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -1515,6 +1515,7 @@ suggest-wait: "Please wait... Calculating recommend price." history: shop: gui-title: "查看購買歷史記錄" + header-icon-multiple-shop: "The query result across {0} shops" header-icon-description: - "類型:{0}" - "擁有者:{1}" @@ -1527,6 +1528,12 @@ history: - "Item: {1} x{2}" - "花費:{3}" - "税:{4}" + log-icon-description-with-store-name: + - "Store: {0}" + - "Purchaser: {1}" + - "Item: {2} x{3}" + - "Balance: {4}" + - "Tax: {5}" query-icon: "Please wait, querying..." previous-page: "上一頁" next-page: "下一頁" @@ -1553,3 +1560,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" +history-command-leave-blank: "" From d81cd466f0e6b35992afe195ca2c96d8f8755bd7 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 01:50:27 +0800 Subject: [PATCH 38/81] Adopt Minecraft break changes --- .../spigot/AbstractSpigotPlatform.java | 30 +++++++-- .../spigot.v1_18_1/Spigot1181Platform.java | 14 ---- .../spigot.v1_18_2/Spigot1182Platform.java | 14 ---- .../spigot/v1_19_1/Spigot1191Platform.java | 14 ---- .../spigot/v1_19_2/Spigot1193Platform.java | 14 ---- .../spigot/v1_19_3/Spigot1194Platform.java | 14 ---- .../spigot/v1_20_1/Spigot1201Platform.java | 14 ---- .../spigot/v1_20_2/Spigot1202Platform.java | 14 ---- .../spigot/v1_20_3/Spigot1203Platform.java | 14 ---- .../spigot/v1_20_4/Spigot1205Platform.java | 64 ++++++++++--------- 10 files changed, 59 insertions(+), 147 deletions(-) diff --git a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java index 9e9a520a41..a53b3c4cb2 100644 --- a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java +++ b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java @@ -2,17 +2,22 @@ import com.ghostchu.quickshop.common.util.QuickSLF4JLogger; import com.ghostchu.quickshop.platform.Platform; +import com.ghostchu.quickshop.platform.Util; import de.tr7zw.nbtapi.NBT; import de.tr7zw.nbtapi.iface.ReadWriteNBT; import de.tr7zw.nbtapi.iface.ReadWriteNBTList; +import net.kyori.adventure.key.Key; +import net.kyori.adventure.nbt.api.BinaryTagHolder; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.NamespacedKey; import org.bukkit.block.Sign; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; @@ -149,16 +154,31 @@ public void sendSignTextChange(@NotNull Player player, @NotNull Sign sign, boole //player.sendSignChange(sign.getLocation(), components.stream().map(com -> LegacyComponentSerializer.legacySection().serialize(com)).toArray(String[]::new)); } + @Override + public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { + NamespacedKey namespacedKey = stack.getType().getKey(); + Key key = Key.key(namespacedKey.toString()); + ReadWriteNBT nbt = NBT.itemStackToNBT(stack); + BinaryTagHolder holder; + if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { + holder = BinaryTagHolder.binaryTagHolder(nbt.toString()); + } else { + //noinspection UnstableApiUsage + holder = BinaryTagHolder.of(nbt.toString()); + } + return HoverEvent.showItem(key, stack.getAmount(), holder); + } + @Override public void setLore(@NotNull ItemStack stack, @NotNull Collection components) { - NBT.modify(stack, nbt->{ + NBT.modify(stack, nbt -> { ReadWriteNBT display = nbt.getOrCreateCompound("display"); - if(components.isEmpty()){ + if (components.isEmpty()) { display.removeKey("Lore"); - }else{ - List gson = components.stream().map(c->GsonComponentSerializer.gson().serialize(c)).toList(); - ReadWriteNBTList list = display.getStringList("Lore"); + } else { + List gson = components.stream().map(c -> GsonComponentSerializer.gson().serialize(c)).toList(); + ReadWriteNBTList list = display.getStringList("Lore"); list.clear(); list.addAll(gson); } diff --git a/platform/quickshop-platform-spigot-v1_18_R1/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_1/Spigot1181Platform.java b/platform/quickshop-platform-spigot-v1_18_R1/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_1/Spigot1181Platform.java index 7f5ac31c72..723c95a8c3 100644 --- a/platform/quickshop-platform-spigot-v1_18_R1/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_1/Spigot1181Platform.java +++ b/platform/quickshop-platform-spigot-v1_18_R1/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_1/Spigot1181Platform.java @@ -31,20 +31,6 @@ public Spigot1181Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_18_R2/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_2/Spigot1182Platform.java b/platform/quickshop-platform-spigot-v1_18_R2/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_2/Spigot1182Platform.java index 61093003d7..7c5c289fae 100644 --- a/platform/quickshop-platform-spigot-v1_18_R2/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_2/Spigot1182Platform.java +++ b/platform/quickshop-platform-spigot-v1_18_R2/src/main/java/com/ghostchu/quickshop/platform/spigot.v1_18_2/Spigot1182Platform.java @@ -31,20 +31,6 @@ public Spigot1182Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_19_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_1/Spigot1191Platform.java b/platform/quickshop-platform-spigot-v1_19_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_1/Spigot1191Platform.java index 33a445f389..76fe23e9a8 100644 --- a/platform/quickshop-platform-spigot-v1_19_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_1/Spigot1191Platform.java +++ b/platform/quickshop-platform-spigot-v1_19_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_1/Spigot1191Platform.java @@ -31,20 +31,6 @@ public Spigot1191Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_19_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_2/Spigot1193Platform.java b/platform/quickshop-platform-spigot-v1_19_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_2/Spigot1193Platform.java index 9e9a41e535..06fe3e02b0 100644 --- a/platform/quickshop-platform-spigot-v1_19_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_2/Spigot1193Platform.java +++ b/platform/quickshop-platform-spigot-v1_19_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_2/Spigot1193Platform.java @@ -29,20 +29,6 @@ public Spigot1193Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_19_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_3/Spigot1194Platform.java b/platform/quickshop-platform-spigot-v1_19_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_3/Spigot1194Platform.java index a9bcde9a99..dd81afa9e4 100644 --- a/platform/quickshop-platform-spigot-v1_19_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_3/Spigot1194Platform.java +++ b/platform/quickshop-platform-spigot-v1_19_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_19_3/Spigot1194Platform.java @@ -29,20 +29,6 @@ public Spigot1194Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_20_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_1/Spigot1201Platform.java b/platform/quickshop-platform-spigot-v1_20_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_1/Spigot1201Platform.java index d86a70f422..91d10bf969 100644 --- a/platform/quickshop-platform-spigot-v1_20_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_1/Spigot1201Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R1/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_1/Spigot1201Platform.java @@ -29,20 +29,6 @@ public Spigot1201Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_20_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_2/Spigot1202Platform.java b/platform/quickshop-platform-spigot-v1_20_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_2/Spigot1202Platform.java index 85fbaba709..9c77ddd0e0 100644 --- a/platform/quickshop-platform-spigot-v1_20_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_2/Spigot1202Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R2/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_2/Spigot1202Platform.java @@ -29,20 +29,6 @@ public Spigot1202Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_20_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_3/Spigot1203Platform.java b/platform/quickshop-platform-spigot-v1_20_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_3/Spigot1203Platform.java index c0cf4f830c..f1ebe94f03 100644 --- a/platform/quickshop-platform-spigot-v1_20_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_3/Spigot1203Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R3/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_3/Spigot1203Platform.java @@ -29,20 +29,6 @@ public Spigot1203Platform(@NotNull Plugin plugin) { super(plugin); } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(CraftItemStack.asNMSCopy(stack).save(new CompoundTag()).toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); - } - @Override public @NotNull String getMinecraftVersion() { try { diff --git a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java index 8e3e50e1ed..682c9ce2f4 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java @@ -4,17 +4,14 @@ import com.ghostchu.quickshop.platform.Util; import com.ghostchu.quickshop.platform.spigot.AbstractSpigotPlatform; import de.tr7zw.nbtapi.NBT; -import de.tr7zw.nbtapi.NBTCompound; -import de.tr7zw.nbtapi.NBTItem; import de.tr7zw.nbtapi.iface.ReadWriteNBT; -import de.tr7zw.nbtapi.iface.ReadWriteNBTList; import net.kyori.adventure.key.Key; import net.kyori.adventure.nbt.api.BinaryTagHolder; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; -import net.minecraft.core.RegistryAccess; -import net.minecraft.nbt.Tag; +import net.minecraft.core.component.DataComponents; +import net.minecraft.world.item.component.ItemLore; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -22,7 +19,6 @@ import org.bukkit.craftbukkit.v1_20_R4.CraftServer; import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftItemStack; import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; @@ -30,7 +26,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -44,14 +39,13 @@ public Spigot1205Platform(@NotNull Plugin plugin) { public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { NamespacedKey namespacedKey = stack.getType().getKey(); Key key = Key.key(namespacedKey.toString()); - RegistryAccess access = ((CraftServer) Bukkit.getServer()).getServer().registryAccess(); - Tag tag = CraftItemStack.asNMSCopy(stack).save(access); + ReadWriteNBT nbt = NBT.itemStackToNBT(stack); BinaryTagHolder holder; if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(tag.toString()); + holder = BinaryTagHolder.binaryTagHolder(nbt.toString()); } else { //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(tag.toString()); + holder = BinaryTagHolder.of(nbt.toString()); } return HoverEvent.showItem(key, stack.getAmount(), holder); } @@ -79,30 +73,40 @@ public void registerCommand(@NotNull String prefix, @NotNull Command command) { @Override public void setDisplayName(@NotNull ItemStack stack, @Nullable Component component) { - NBT.modify(stack, nbt->{ - ReadWriteNBT itemComponents = nbt.getOrCreateCompound("components"); - if (component == null) { - itemComponents.removeKey("minecraft:custom_name"); - } else { - itemComponents.setString("minecraft:custom_name", GsonComponentSerializer.gson().serialize(component)); - } - }); + net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(stack); + if (component == null) { + nmsItemStack.remove(DataComponents.CUSTOM_NAME); + return; + } + String json = GsonComponentSerializer.gson().serialize(component); + nmsItemStack.set(DataComponents.CUSTOM_NAME, + net.minecraft.network.chat.Component.Serializer + .fromJson(json, + ((CraftServer) Bukkit.getServer()) + .getServer() + .registryAccess())); + stack.setItemMeta(CraftItemStack.asBukkitCopy(nmsItemStack).getItemMeta()); } @Override public void setLore(@NotNull ItemStack stack, @NotNull Collection components) { - NBT.modify(stack, nbt->{ - ReadWriteNBT itemComponents = nbt.getOrCreateCompound("components"); - if (components.isEmpty()) { - itemComponents.removeKey("minecraft:lores"); - } else { - List gson = components.stream().map(c->GsonComponentSerializer.gson().serialize(c)).toList(); - ReadWriteNBTList list = itemComponents.getStringList("minecraft:lores"); - list.clear(); - list.addAll(gson); - } - }); + net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(stack); + if (components.isEmpty()) { + nmsItemStack.remove(DataComponents.LORE); + } else { + List componentsList = components.stream() + .map(c -> GsonComponentSerializer.gson().serialize(c)) + .map(json -> (net.minecraft.network.chat.Component) + net.minecraft.network.chat.Component.Serializer + .fromJson(json, + ((CraftServer) Bukkit.getServer()) + .getServer() + .registryAccess())) + .toList(); + nmsItemStack.set(DataComponents.LORE, new ItemLore(componentsList)); + } + stack.setItemMeta(CraftItemStack.asBukkitCopy(nmsItemStack).getItemMeta()); } private String postProcessingTranslationKey(String key) { From 37b0f869ea43b83d332e0aa6a7134150d68501a9 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 02:31:38 +0800 Subject: [PATCH 39/81] Introducing an enhanced implementation of History --- .../pom.xml | 8 +- .../api/event/ShopHistoryGuiOpenEvent.java | 11 +- .../command/SimpleCommandManager.java | 6 +- .../subcommand/SubCommand_History.java | 65 ++++++- .../silent/SubCommand_SilentHistory.java | 4 +- .../quickshop/shop/history/ShopHistory.java | 163 +++++++++++------- .../shop/history/ShopHistoryGUI.java | 115 +++++++----- .../src/main/resources/lang/messages.yml | 2 +- .../src/main/resources/plugin.yml | 12 ++ 9 files changed, 261 insertions(+), 125 deletions(-) diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index 3288042ff7..964d1fa9c8 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -36,9 +36,9 @@ remap-obf - org.spigotmc:minecraft-server:1.20.5-R0.1-SNAPSHOT:txt:maps-mojang + org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:txt:maps-mojang true - org.spigotmc:spigot:1.20.5-R0.1-SNAPSHOT:jar:remapped-mojang + org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-mojang true remapped-obf @@ -54,8 +54,8 @@ ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar - org.spigotmc:minecraft-server:1.20.5-R0.1-SNAPSHOT:csrg:maps-spigot - org.spigotmc:spigot:1.20.5-R0.1-SNAPSHOT:jar:remapped-obf + org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:csrg:maps-spigot + org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-obf diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopHistoryGuiOpenEvent.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopHistoryGuiOpenEvent.java index 1da965f9a3..8fdcd622f7 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopHistoryGuiOpenEvent.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/event/ShopHistoryGuiOpenEvent.java @@ -4,21 +4,24 @@ import lombok.Getter; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; + +import java.util.List; + @Getter public class ShopHistoryGuiOpenEvent extends AbstractQSEvent{ private final Player player; - private final Shop shop; + private final List shops; private final Inventory inventory; /** * Called when user opened a Shop History GUI - * @param shop The shop that related to GUI + * @param shops The shops that related to GUI * @param player The player that open GUI * @param inventory The GUI itself */ - public ShopHistoryGuiOpenEvent(Shop shop, Player player, Inventory inventory){ + public ShopHistoryGuiOpenEvent(List shops, Player player, Inventory inventory){ this.player = player; - this.shop = shop; + this.shops = shops; this.inventory = inventory; } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/SimpleCommandManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/SimpleCommandManager.java index 7f9fab7390..b275b011f7 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/SimpleCommandManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/SimpleCommandManager.java @@ -355,7 +355,11 @@ public SimpleCommandManager(QuickShop plugin) { .build()); registerCmd(CommandContainer.builder() .prefix("history") - .permission("quickshop.history") + .selectivePermission("quickshop.history") + .selectivePermission("quickshop.other.history") + .selectivePermission("quickshop.history.owned") + .selectivePermission("quickshop.history.accessible") + .selectivePermission("quickshop.history.global") .executor(new SubCommand_History(plugin)) .build()); registerCmd(CommandContainer.builder() diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_History.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_History.java index 4cfbb993ba..8fb21bf437 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_History.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_History.java @@ -9,6 +9,12 @@ import com.ghostchu.quickshop.shop.history.ShopHistoryGUI; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; public class SubCommand_History implements CommandHandler { @@ -20,16 +26,61 @@ public SubCommand_History(QuickShop plugin) { @Override public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @NotNull CommandParser parser) { - Shop shop = getLookingShop(sender); - if (shop == null) { - plugin.text().of(sender, "not-looking-at-shop").send(); + if (parser.getArgs().isEmpty()) { + if (!plugin.perm().hasPermission(sender, "quickshop.history")) { + plugin.text().of(sender, "no-permission").send(); + return; + } + Shop shop = getLookingShop(sender); + if (shop == null) { + plugin.text().of(sender, "not-looking-at-shop").send(); + return; + } + if (!shop.playerAuthorize(sender.getUniqueId(), BuiltInShopPermission.VIEW_PURCHASE_LOGS) && !plugin.perm().hasPermission(sender, "quickshop.other.history")) { + plugin.text().of(sender, "no-permission"); + return; + } + new ShopHistoryGUI(plugin, sender, new ShopHistory(plugin, List.of(shop))).open(); return; } - if (!shop.playerAuthorize(sender.getUniqueId(), BuiltInShopPermission.VIEW_PURCHASE_LOGS) && !plugin.perm().hasPermission(sender, "quickshop.other.history")) { - plugin.text().of(sender, "no-permission"); - return; + List shops = new ArrayList<>(); + switch (parser.getArgs().get(0).toLowerCase(Locale.ROOT)) { + case "owned" -> { + if (!plugin.perm().hasPermission(sender, "quickshop.history.owned")) { + plugin.text().of(sender, "no-permission").send(); + return; + } + shops.addAll(plugin.getShopManager().getAllShops(sender.getUniqueId())); + } + case "accessible" -> { + if (!plugin.perm().hasPermission(sender, "quickshop.history.accessible")) { + plugin.text().of(sender, "no-permission").send(); + return; + } + shops.addAll(plugin.getShopManager().getAllShops() + .stream().filter(s -> s.playerAuthorize(sender.getUniqueId(), BuiltInShopPermission.VIEW_PURCHASE_LOGS)).toList()); + } + case "global" -> { + if (!plugin.perm().hasPermission(sender, "quickshop.history.global")) { + plugin.text().of(sender, "no-permission").send(); + return; + } + shops.addAll(plugin.getShopManager().getAllShops()); + } + default -> { + plugin.text().of(sender, "command-incorrect", "/quickshop history ").send(); + return; + } } - new ShopHistoryGUI(plugin, sender, new ShopHistory(plugin, shop)).open(); + new ShopHistoryGUI(plugin, sender, new ShopHistory(plugin, shops)).open(); + return; } + @Override + public @Nullable List onTabComplete(@NotNull Player sender, @NotNull String commandLabel, @NotNull CommandParser parser) { + if (parser.getArgs().size() == 1) { + return List.of("owned", "accessible", "global", plugin.text().of(sender, "history-command-leave-blank").plain()); + } + return Collections.emptyList(); + } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/silent/SubCommand_SilentHistory.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/silent/SubCommand_SilentHistory.java index ad62e20653..19e52f50d0 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/silent/SubCommand_SilentHistory.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/silent/SubCommand_SilentHistory.java @@ -9,6 +9,8 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; +import java.util.List; + public class SubCommand_SilentHistory extends SubCommand_SilentBase { public SubCommand_SilentHistory(QuickShop plugin) { @@ -22,6 +24,6 @@ protected void doSilentCommand(Player sender, @NotNull Shop shop, @NotNull Comma plugin.text().of(sender, "not-managed-shop").send(); return; } - new ShopHistoryGUI(plugin, sender, new ShopHistory(plugin, shop)).open(); + new ShopHistoryGUI(plugin, sender, new ShopHistory(plugin, List.of(shop))).open(); } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java index 4250383713..e37adbb276 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java @@ -8,50 +8,67 @@ import com.ghostchu.quickshop.database.DataTables; import com.ghostchu.quickshop.util.Util; import com.ghostchu.quickshop.util.performance.PerfMonitor; +import lombok.Cleanup; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.time.Instant; import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.concurrent.CompletableFuture; public class ShopHistory { - private final long shopId; - protected final Shop shop; + protected final List shops; + protected final Map shopsMapping = new HashMap<>(); + private final String shopIdsPlaceHolders; private final QuickShop plugin; - public ShopHistory(QuickShop plugin, Shop shop) { + public ShopHistory(QuickShop plugin, List shops) { this.plugin = plugin; - if (shop.getShopId() < 0) { - throw new IllegalStateException("The shop " + shop + " had no shopId persist in database"); + this.shops = shops; + for (Shop shop : shops) { + long shopId= shop.getShopId(); + if(shopId <= 0){ + continue; + } + shopsMapping.put(shopId, shop); } -// Long dataId = plugin.getDatabaseHelper().locateShopDataId( shop.getShopId()).join(); -// if(dataId == null){ -// throw new IllegalStateException("The shop "+shop +" had no dataId persist in database" ); -// } - this.shopId = shop.getShopId(); - this.shop = shop; + this.shopIdsPlaceHolders = generatePlaceHolders(shopsMapping.size()); } private boolean isValidSummaryRecordType(String type) { return ShopOperationEnum.PURCHASE_SELLING_SHOP.name().equalsIgnoreCase(type) || ShopOperationEnum.PURCHASE_BUYING_SHOP.name().equalsIgnoreCase(type); } + private String generatePlaceHolders(int size) { + StringJoiner joiner = new StringJoiner(","); + for (int i = 0; i < size; i++) { + joiner.add("?"); + } + return joiner.toString(); + } + + private void mappingPreparedStatement(PreparedStatement statement, int startAt) throws SQLException { + List ids = new ArrayList<>(shopsMapping.keySet()); + for (int i = startAt; i < startAt + ids.size(); i++) { + statement.setLong(i, ids.get(i - startAt)); + } + } + private CompletableFuture> summaryTopNValuableCustomers(int n, Instant from, Instant to) { return CompletableFuture.supplyAsync(() -> { LinkedHashMap orderedMap = new LinkedHashMap<>(); String SQL = "SELECT `buyer`, COUNT(`buyer`) AS `count` FROM %s " + - "WHERE `shop`= ? AND `time` >= ? AND `time` <= ? GROUP BY `buyer` ORDER BY `count` DESC LIMIT " + n; + "WHERE `time` >= ? AND `time` <= ? AND `shop` IN (" + this.shopIdsPlaceHolders + ") GROUP BY `buyer` ORDER BY `count` DESC LIMIT " + n; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryTopNValuableCustomers"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId, from, to).execute()) { - perfMonitor.setContext("shopId="+shopId+", n="+n+", from="+from+", to="+to); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + ps.setTimestamp(1, new Timestamp(from.toEpochMilli())); + ps.setTimestamp(2, new Timestamp(to.toEpochMilli())); + mappingPreparedStatement(ps, 3); + perfMonitor.setContext("shopIds=" + shopsMapping.keySet() + ", n=" + n + ", from=" + from + ", to=" + to); + @Cleanup + ResultSet set = ps.executeQuery(); while (set.next()) { orderedMap.put(UUID.fromString(set.getString("buyer")), set.getLong("count")); } @@ -66,12 +83,17 @@ private CompletableFuture> summaryTopNValuableCustomer private CompletableFuture summaryUniquePurchasers(Instant from, Instant to) { return CompletableFuture.supplyAsync(() -> { String SQL = "SELECT COUNT(DISTINCT `buyer`) FROM %s " + - "WHERE `shop`= ? AND `time` >= ? AND `time` <= ?"; + "WHERE `time` >= ? AND `time` <= ? AND `shop` IN (" + this.shopIdsPlaceHolders + ")"; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryUniquePurchasers"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId, from, to).execute()) { - perfMonitor.setContext("shopId="+shopId+", from="+from+", to="+to); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + ps.setTimestamp(1, new Timestamp(from.toEpochMilli())); + ps.setTimestamp(2, new Timestamp(to.toEpochMilli())); + mappingPreparedStatement(ps, 3); + perfMonitor.setContext("shopId=" + shopsMapping.keySet() + ", from=" + from + ", to=" + to); + @Cleanup + ResultSet set = ps.executeQuery(); if (set.next()) { return set.getLong(1); } @@ -87,12 +109,14 @@ private CompletableFuture> summaryTopNValuableCustomer return CompletableFuture.supplyAsync(() -> { LinkedHashMap orderedMap = new LinkedHashMap<>(); String SQL = "SELECT `buyer`, COUNT(`buyer`) AS `count` FROM %s " + - "WHERE `shop`= ? GROUP BY `buyer` ORDER BY `count` DESC LIMIT " + n; + "WHERE `shop` IN (" + this.shopIdsPlaceHolders + ") GROUP BY `buyer` ORDER BY `count` DESC LIMIT " + n; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryTopNValuableCustomers"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId).execute()) { - perfMonitor.setContext("shopId="+shopId+", n="+n); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + mappingPreparedStatement(ps, 1); + @Cleanup + ResultSet set = ps.executeQuery(); while (set.next()) { orderedMap.put(UUID.fromString(set.getString("buyer")), set.getLong("count")); } @@ -107,12 +131,15 @@ private CompletableFuture> summaryTopNValuableCustomer private CompletableFuture summaryUniquePurchasers() { return CompletableFuture.supplyAsync(() -> { String SQL = "SELECT COUNT(DISTINCT `buyer`) FROM %s " + - "WHERE `shop`= ?"; + "WHERE `shop` IN (" + this.shopIdsPlaceHolders + ")"; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryUniquePurchasers"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId).execute()) { - perfMonitor.setContext("shopId="+shopId); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + perfMonitor.setContext("shopIds=" +shopsMapping.keySet()); + mappingPreparedStatement(ps, 1); + @Cleanup + ResultSet set = ps.executeQuery(); if (set.next()) { return set.getLong(1); } @@ -127,12 +154,17 @@ private CompletableFuture summaryUniquePurchasers() { private CompletableFuture summaryPurchasesBalance(Instant from, Instant to) { return CompletableFuture.supplyAsync(() -> { String SQL = "SELECT SUM(`money`) FROM %s " + - "WHERE `shop`= ? AND `time` >= ? AND `time` <= ?"; + "WHERE `time` >= ? AND `time` <= ? AND `shop` IN (" + this.shopIdsPlaceHolders + ")"; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryPurchasesBalance"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId, from, to).execute()) { - perfMonitor.setContext("shopId="+shopId+", from="+from+", to="+to); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + ps.setTimestamp(1, new Timestamp(from.toEpochMilli())); + ps.setTimestamp(2, new Timestamp(to.toEpochMilli())); + mappingPreparedStatement(ps, 3); + perfMonitor.setContext("shopIds=" + shopsMapping.keySet() + ", from=" + from + ", to=" + to); + @Cleanup + ResultSet set = ps.executeQuery(); if (set.next()) { return set.getDouble(1); } @@ -147,12 +179,15 @@ private CompletableFuture summaryPurchasesBalance(Instant from, Instant private CompletableFuture summaryPurchasesBalance() { return CompletableFuture.supplyAsync(() -> { String SQL = "SELECT SUM(`money`) FROM %s " + - "WHERE `shop`= ?"; + "WHERE `shop` IN (" + this.shopIdsPlaceHolders + ")"; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryPurchasesBalance"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId).execute()) { - perfMonitor.setContext("shopId="+shopId); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + perfMonitor.setContext("shopIds=" + shopsMapping.keySet()); + mappingPreparedStatement(ps, 1); + @Cleanup + ResultSet set = ps.executeQuery(); if (set.next()) { return set.getDouble(1); } @@ -165,16 +200,21 @@ private CompletableFuture summaryPurchasesBalance() { } private CompletableFuture summaryPurchasesCount(Instant from, Instant to) { - if((from==null) != (to==null)) + if ((from == null) != (to == null)) throw new IllegalStateException("from to must null or not null in same time"); return CompletableFuture.supplyAsync(() -> { String SQL = "SELECT COUNT(*) FROM %s " + - "WHERE `shop`= ? AND `time` >= ? AND `time` <= ?"; + "WHERE `time` >= ? AND `time` <= ? AND `shop` IN (" + this.shopIdsPlaceHolders + ")"; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryPurchasesCount"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId, from, to).execute()) { - perfMonitor.setContext("shopId="+shopId+", from="+from+", to="+to); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + ps.setTimestamp(1, new Timestamp(from.toEpochMilli())); + ps.setTimestamp(2, new Timestamp(to.toEpochMilli())); + mappingPreparedStatement(ps, 3); + perfMonitor.setContext("shopId=" + shopsMapping.keySet() + ", from=" + from + ", to=" + to); + @Cleanup + ResultSet set = ps.executeQuery(); if (set.next()) { return set.getLong(1); } @@ -189,12 +229,15 @@ private CompletableFuture summaryPurchasesCount(Instant from, Instant to) private CompletableFuture summaryPurchasesCount() { return CompletableFuture.supplyAsync(() -> { String SQL = "SELECT COUNT(*) FROM %s " + - "WHERE `shop`= ?"; + "WHERE `shop` IN (" + this.shopIdsPlaceHolders + ")"; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("summaryPurchasesCount"); - SQLQuery query = plugin.getSqlManager().createQuery().withPreparedSQL(SQL).setParams(shopId).execute()) { - perfMonitor.setContext("shopId="+shopId); - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { + mappingPreparedStatement(ps, 1); + perfMonitor.setContext("shopIds=" + shopsMapping.keySet()); + @Cleanup + ResultSet set = ps.executeQuery(); if (set.next()) { return set.getLong(1); } @@ -219,7 +262,7 @@ public CompletableFuture generateSummary() { double totalPurchasesBalance = summaryPurchasesBalance().join(); long totalUniquePurchases = summaryUniquePurchasers().join(); LinkedHashMap valuableCustomers = summaryTopNValuableCustomers(5).join(); - + return CompletableFuture.supplyAsync(() -> new ShopSummary( recentPurchases24h, recentPurchases3d, @@ -241,15 +284,15 @@ public CompletableFuture generateSummary() { public List query(int page, int pageSize) throws SQLException { Util.ensureThread(true); List historyRecords = new ArrayList<>(pageSize); + String SQL = "SELECT * FROM %s WHERE `shop` IN ("+shopIdsPlaceHolders+") ORDER BY `time` DESC LIMIT "+(page - 1) * pageSize+","+pageSize; + SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); try (PerfMonitor perfMonitor = new PerfMonitor("historyPageableQuery")) { - SQLQuery query = DataTables.LOG_PURCHASE.createQuery() - .addCondition("shop", shopId) - .orderBy("time", false) - .setPageLimit((page - 1) * pageSize, pageSize) - .build().execute(); - perfMonitor.setContext("shopId="+shopId+", page="+page+", pageSize="+pageSize); - try (query) { - ResultSet set = query.getResultSet(); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL); + mappingPreparedStatement(ps, 1); + perfMonitor.setContext("shopIds=" + shopsMapping.keySet() + ", page=" + page + ", pageSize=" + pageSize); + + try (ResultSet set = ps.executeQuery()) { while (set.next()) { if (!isValidSummaryRecordType(set.getString("type"))) { continue; diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java index 4222cb9306..c9882c7af9 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java @@ -42,7 +42,7 @@ public class ShopHistoryGUI { private final OutlinePane body; private final StaticPane footer; private final Player player; - private final Shop shop; + private final List shops; private final SkullProvider skullProvider; private final ProxiedLocale locale; private int page = 1; @@ -55,7 +55,7 @@ public ShopHistoryGUI(QuickShop plugin, Player player, ShopHistory shopHistory) this.shopHistory = shopHistory; this.player = player; this.locale = plugin.getTextManager().findRelativeLanguages(player); - this.shop = shopHistory.shop; + this.shops = shopHistory.shops; this.chestGui = new ChestGui(6, plugin.text().of(player, "history.shop.gui-title").legacy()); this.header = new StaticPane(0, 0, 9, 1); this.body = new OutlinePane(0, 1, 9, 4); @@ -75,7 +75,7 @@ private void reQuery() { Log.debug(summary.toString()); } } catch (SQLException e) { - plugin.logger().error("Couldn't query the shop history for shop {}.", shopHistory.shop, e); + plugin.logger().error("Couldn't query the shop history for shops {}.", shopHistory.shops, e); Util.mainThreadRun(() -> this.chestGui.getViewers().forEach(p -> { p.closeInventory(); plugin.text().of(p, "internal-error", p).send(); @@ -84,43 +84,50 @@ private void reQuery() { } private ItemStack getHeaderIcon() { - ItemStack headerSkullItem = new ItemStack(Material.PLAYER_HEAD); - String shopName = shop.getShopName() == null ? shop.getLocation().getWorld().getName() + " " + shop.getLocation().getBlockX() + ", " + shop.getLocation().getBlockY() + ", " + shop.getLocation().getBlockZ() : shop.getShopName(); - Component shopNameComponent = LegacyComponentSerializer.legacySection().deserialize(shopName); - List lore = plugin.text().ofList(player, "history.shop.header-icon-description", shop.getShopType().name(), - shop.getOwner().getDisplay(), - Util.getItemStackName(shop.getItem()), - shop.getPrice(), shop.getShopStackingAmount(), - shop.getLocation().getWorld().getName() + " " + shop.getLocation().getBlockX() + ", " + shop.getLocation().getBlockY() + ", " + shop.getLocation().getBlockZ()) - .forLocale(); - plugin.getPlatform().setDisplayName(headerSkullItem, shopNameComponent); - plugin.getPlatform().setLore(headerSkullItem, lore); - if (PackageUtil.parsePackageProperly("renderSkullTexture").asBoolean(true)) { - QUser owner = shopHistory.shop.getOwner(); - if (owner.isRealPlayer()) { - if (owner.getUniqueId() != null) { - skullProvider.provide(owner.getUniqueId()).thenAccept(skull -> { - headerSkullItem.setItemMeta(skull.getItemMeta()); - plugin.getPlatform().setDisplayName(headerSkullItem, shopNameComponent); - plugin.getPlatform().setLore(headerSkullItem, lore); - }); - } else if (owner.getUsername() != null) { - skullProvider.provide(owner.getUsername()).thenAccept(skull -> { - headerSkullItem.setItemMeta(skull.getItemMeta()); - plugin.getPlatform().setDisplayName(headerSkullItem, shopNameComponent); - plugin.getPlatform().setLore(headerSkullItem, lore); - }); + if (shops.size() == 1) { + ItemStack headerSkullItem = new ItemStack(Material.PLAYER_HEAD); + Shop shop = shops.get(0); + String shopName = shop.getShopName() == null ? shop.getLocation().getWorld().getName() + " " + shop.getLocation().getBlockX() + ", " + shop.getLocation().getBlockY() + ", " + shop.getLocation().getBlockZ() : shop.getShopName(); + final List lore = plugin.text().ofList(player, "history.shop.header-icon-description", shop.getShopType().name(), + shop.getOwner().getDisplay(), + Util.getItemStackName(shop.getItem()), + shop.getPrice(), shop.getShopStackingAmount(), + shop.getLocation().getWorld().getName() + " " + shop.getLocation().getBlockX() + ", " + shop.getLocation().getBlockY() + ", " + shop.getLocation().getBlockZ()) + .forLocale(); + Component shopNameComponent = LegacyComponentSerializer.legacySection().deserialize(shopName); + plugin.getPlatform().setDisplayName(headerSkullItem, shopNameComponent); + plugin.getPlatform().setLore(headerSkullItem, lore); + if (PackageUtil.parsePackageProperly("renderSkullTexture").asBoolean(true)) { + QUser owner = shop.getOwner(); + if (owner.isRealPlayer()) { + if (owner.getUniqueId() != null) { + skullProvider.provide(owner.getUniqueId()).thenAccept(skull -> { + headerSkullItem.setItemMeta(skull.getItemMeta()); + plugin.getPlatform().setDisplayName(headerSkullItem, shopNameComponent); + plugin.getPlatform().setLore(headerSkullItem, lore); + }); + } else if (owner.getUsername() != null) { + skullProvider.provide(owner.getUsername()).thenAccept(skull -> { + headerSkullItem.setItemMeta(skull.getItemMeta()); + plugin.getPlatform().setDisplayName(headerSkullItem, shopNameComponent); + plugin.getPlatform().setLore(headerSkullItem, lore); + }); + } } } + return headerSkullItem; + } else { + ItemStack headerItem = new ItemStack(Material.CHEST); + plugin.getPlatform().setDisplayName(headerItem, plugin.text().of(player, "history.shop.header-icon-multiple-shop", shops.size()).forLocale()); + return headerItem; } - return headerSkullItem; } public void open() { refreshGui(); chestGui.show(player); - new ShopHistoryGuiOpenEvent(shop, player, chestGui.getInventory()).callEvent(); + new ShopHistoryGuiOpenEvent(shops, player, chestGui.getInventory()).callEvent(); } @@ -131,12 +138,16 @@ private void refreshGui() { updateFooterPageIcons(); chestGui.update(); CompletableFuture.supplyAsync(() -> { - reQuery(); - updateHeaderIcon(); - updateFooterPageIcons(); - updateBodyWithResult(); - return null; - }).thenAccept((ignored) -> Util.mainThreadRun(chestGui::update)); + reQuery(); + updateHeaderIcon(); + updateFooterPageIcons(); + updateBodyWithResult(); + return null; + }).thenAccept((ignored) -> Util.mainThreadRun(chestGui::update)) + .exceptionally(e -> { + plugin.logger().warn("Failed to update History GUI", e); + return null; + }); } private void updateHeaderIcon() { @@ -262,20 +273,30 @@ private void updateBodyWithResult() { itemName = plugin.text().of(player, "internal-error").forLocale(); plugin.logger().error("Failed to deserialize itemstack {}", dataRecord.getItem(), e); } - List lore = plugin.text().ofList(player, "history.shop.log-icon-description", + Shop shop = shopHistory.shopsMapping.get(record.shopId()); + if (shop == null) continue; + String shopName = shop.getShopName() == null ? shop.getLocation().getWorld().getName() + " " + shop.getLocation().getBlockX() + ", " + shop.getLocation().getBlockY() + ", " + shop.getLocation().getBlockZ() : shop.getShopName(); + List lore = plugin.text().ofList(player, "history.shop.log-icon-description-with-store-name", + shopName, userName, itemName, record.amount(), record.money(), record.tax()).forLocale(); - ItemStack stack = new ItemStack(Material.PLAYER_HEAD); - if (PackageUtil.parsePackageProperly("renderSkullTexture").asBoolean(true)) { - skullProvider.provide(record.buyer()).thenAccept(skull -> { - stack.setItemMeta(skull.getItemMeta()); - // Reapply the name and lore - plugin.getPlatform().setDisplayName(stack, plugin.text().of(player, "history.shop.log-icon-title", - format.format(record.date())).forLocale()); - plugin.getPlatform().setLore(stack, lore); - }); + ItemStack stack; + + if (shops.size() == 1) { + stack = new ItemStack(Material.PLAYER_HEAD); + if (PackageUtil.parsePackageProperly("renderSkullTexture").asBoolean(true)) { + skullProvider.provide(record.buyer()).thenAccept(skull -> { + stack.setItemMeta(skull.getItemMeta()); + // Reapply the name and lore + plugin.getPlatform().setDisplayName(stack, plugin.text().of(player, "history.shop.log-icon-title", + format.format(record.date())).forLocale()); + plugin.getPlatform().setLore(stack, lore); + }); + } + } else { + stack = shop.getItem().clone(); } plugin.getPlatform().setDisplayName(stack, plugin.text().of(player, "history.shop.log-icon-title", format.format(record.date())).forLocale()); diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 2d77e5bac0..7417edaa9d 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -1792,4 +1792,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" -history-command-leave-blank: "" \ No newline at end of file +history-command-leave-blank: "" \ No newline at end of file diff --git a/quickshop-bukkit/src/main/resources/plugin.yml b/quickshop-bukkit/src/main/resources/plugin.yml index 3f4d23bb13..85c7393bf7 100644 --- a/quickshop-bukkit/src/main/resources/plugin.yml +++ b/quickshop-bukkit/src/main/resources/plugin.yml @@ -131,6 +131,8 @@ permissions: quickshop.benefit: true quickshop.sign: true quickshop.history: true + quickshop.history.owned: true + quickshop.history.accessible: true quickshop.suggestprice: true quickshop.moderator: description: The permission that provide all moderator need have permissions @@ -143,6 +145,7 @@ permissions: quickshop.bypass.*: true quickshop.alerts: true quickshop.create.admin: true + quickshop.history.*: true quickshop.transferownershop.other: true quickshop.other.changeitem: true quickshop.other.changeamount: true @@ -356,6 +359,15 @@ permissions: quickshop.history: description: Permission to view the shop history default: op + quickshop.history.owned: + description: Permission to view the shop history which owned + default: op + quickshop.history.accessible: + description: Permission to view the shop history which the store granted player VIEW_PURCHASE_LOGS permission + default: op + quickshop.history.global: + description: Permission to view the shop history on this server + default: op quickshop.other.history: description: Permission to view the other's shop history default: op From 63caa0da74fc26056d8bf8294fdd85e55efff8df Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Tue, 7 May 2024 02:53:40 +0800 Subject: [PATCH 40/81] [ci skip] Automatically merge Crowdin translations --- quickshop-bukkit/src/main/resources/lang/messages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 7417edaa9d..2d77e5bac0 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -1792,4 +1792,4 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" -history-command-leave-blank: "" \ No newline at end of file +history-command-leave-blank: "" \ No newline at end of file From 47f8945062d56aa46c08dd9da0eabf2a082858b3 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 03:00:25 +0800 Subject: [PATCH 41/81] Disable hover preview on Spigot platform because lack of proper impl --- .../ghostchu/quickshop/platform/Platform.java | 2 +- .../platform/paper/PaperPlatform.java | 2 +- .../spigot/AbstractSpigotPlatform.java | 4 +-- .../spigot/v1_20_4/Spigot1205Platform.java | 30 +++++++++++-------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java b/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java index 1ab4c0e320..40d43887a3 100644 --- a/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java +++ b/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java @@ -57,7 +57,7 @@ default String getItemShopId(@NotNull ItemStack stack) { return shopId; } - @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack); + @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack); @NotNull Component getLine(@NotNull Sign sign, int line); diff --git a/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java b/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java index 7a2beef6bc..1518daeada 100644 --- a/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java +++ b/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java @@ -54,7 +54,7 @@ public void shutdown() { } @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { + public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { return stack.asHoverEvent(); } diff --git a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java index a53b3c4cb2..ca75d90612 100644 --- a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java +++ b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java @@ -40,7 +40,7 @@ public abstract class AbstractSpigotPlatform implements Platform { protected final Logger logger = Logger.getLogger("QuickShop-Hikari"); - private final Plugin plugin; + public final Plugin plugin; protected Map translationMapping; private BukkitAudiences audience; @@ -155,7 +155,7 @@ public void sendSignTextChange(@NotNull Player player, @NotNull Sign sign, boole } @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { + public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { NamespacedKey namespacedKey = stack.getType().getKey(); Key key = Key.key(namespacedKey.toString()); ReadWriteNBT nbt = NBT.itemStackToNBT(stack); diff --git a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java index 682c9ce2f4..b0925852fd 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java @@ -9,6 +9,7 @@ import net.kyori.adventure.nbt.api.BinaryTagHolder; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.core.component.DataComponents; import net.minecraft.world.item.component.ItemLore; @@ -36,18 +37,23 @@ public Spigot1205Platform(@NotNull Plugin plugin) { } @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - NamespacedKey namespacedKey = stack.getType().getKey(); - Key key = Key.key(namespacedKey.toString()); - ReadWriteNBT nbt = NBT.itemStackToNBT(stack); - BinaryTagHolder holder; - if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { - holder = BinaryTagHolder.binaryTagHolder(nbt.toString()); - } else { - //noinspection UnstableApiUsage - holder = BinaryTagHolder.of(nbt.toString()); - } - return HoverEvent.showItem(key, stack.getAmount(), holder); + public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { + return HoverEvent.showText(Component.text("Click to preview the item") + .appendNewline() + .append(Component.text("× Item hover preview are not available at this time (Spigot 1.20.5+) due major item nbt related changes.").color(NamedTextColor.RED)) + .appendNewline() + .append(Component.text("💡 Consider switch to Paper to use PaperAPI instead.").color(NamedTextColor.GRAY))); +// NamespacedKey namespacedKey = stack.getType().getKey(); +// Key key = Key.key(namespacedKey.toString()); +// ReadWriteNBT nbt = NBT.itemStackToNBT(stack); +// BinaryTagHolder holder; +// if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { +// holder = BinaryTagHolder.binaryTagHolder(nbt.toString()); +// } else { +// //noinspection UnstableApiUsage +// holder = BinaryTagHolder.of(nbt.toString()); +// } +// return HoverEvent.showItem(HoverEvent.ShowItem.showItem(key,stack.getAmount(), holder)); } @Override From ae97ff5e7f713f819fce588f604ae9efb434a6ae Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 03:07:14 +0800 Subject: [PATCH 42/81] fix ci --- addon/reremake-migrator/pom.xml | 2 +- pom.xml | 2 +- quickshop-bukkit/pom.xml | 6 ------ quickshop-common/pom.xml | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/addon/reremake-migrator/pom.xml b/addon/reremake-migrator/pom.xml index c07d0c1b50..dc0de76e01 100644 --- a/addon/reremake-migrator/pom.xml +++ b/addon/reremake-migrator/pom.xml @@ -54,7 +54,7 @@ shade - ${project.name}-${version} + ${project.name}-${project.version} true false diff --git a/pom.xml b/pom.xml index 8e38e274ba..b67e069d97 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,7 @@ shade - ${project.name}-${version} + ${project.name}-${project.version} true false diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 99210ca5bf..6ab1a55b31 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -349,12 +349,6 @@ compile 1.25.0 - - org.slf4j - slf4j-jdk14 - 2.0.13 - compile - com.ghostchu.lib.unofficial.com.alessiodp.libby libby-core diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index 99b2b01381..db293ae0f3 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -44,8 +44,8 @@ org.slf4j - slf4j-api - 2.0.12 + slf4j-jdk14 + 2.0.13 compile From c6d1f554e790e35a732084f36595de708e44df77 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 03:11:51 +0800 Subject: [PATCH 43/81] use release tag --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index b67e069d97..aab8135bae 100644 --- a/pom.xml +++ b/pom.xml @@ -82,6 +82,7 @@ ${java.version} ${java.version} + ${java.version} From 1d26989e054801e9f937726ec5366cadaaf6388e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 19:23:16 +0000 Subject: [PATCH 44/81] Bump de.tr7zw:item-nbt-api-plugin from 2.12.3 to 2.12.4 Bumps de.tr7zw:item-nbt-api-plugin from 2.12.3 to 2.12.4. --- updated-dependencies: - dependency-name: de.tr7zw:item-nbt-api-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- platform/quickshop-platform-spigot-abstract/pom.xml | 2 +- platform/quickshop-platform-spigot-v1_20_R4/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/quickshop-platform-spigot-abstract/pom.xml b/platform/quickshop-platform-spigot-abstract/pom.xml index c9628fb56a..e7861f42f9 100644 --- a/platform/quickshop-platform-spigot-abstract/pom.xml +++ b/platform/quickshop-platform-spigot-abstract/pom.xml @@ -66,7 +66,7 @@ de.tr7zw item-nbt-api-plugin - 2.12.3 + 2.12.4 provided diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index 964d1fa9c8..a095cc1155 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -99,7 +99,7 @@ de.tr7zw item-nbt-api-plugin - 2.12.3 + 2.12.4 provided From ecc12c6a32c0d727b6b2a68d0d895608e3a79246 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Tue, 7 May 2024 06:22:42 +0800 Subject: [PATCH 45/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/de-DE/messages.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index d5dd552206..8311204f30 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -1498,7 +1498,7 @@ suggest-wait: "Bitte warten... Berechne empfohlenen Preis." history: shop: gui-title: "Zeige Kaufprotokolle" - header-icon-multiple-shop: "The query result across {0} shops" + header-icon-multiple-shop: "Das Abfrageergebnis in {0} shops" header-icon-description: - "Typ: {0}" - "Besitzer: {1}" @@ -1512,11 +1512,11 @@ history: - "Guthaben: {3}" - "Steuer: {4}" log-icon-description-with-store-name: - - "Store: {0}" - - "Purchaser: {1}" - - "Item: {2} x{3}" - - "Balance: {4}" - - "Tax: {5}" + - "Laden: {0}" + - "Käufer: {1}" + - "Gegenstand: {2} x{3}" + - "Guthaben: {4}" + - "Steuern: {5}" query-icon: "Bitte warten, abfrage..." previous-page: "<< Vorherige Seite" next-page: "Nächste Seite >>" @@ -1543,4 +1543,4 @@ about: valid-donation-key: "Gebunden an {0}" invalid-donation-key: "Ungültiger Spendenschlüssel" kofi-thanks: "Besonderer Dank geht an alle, welche QuickShop auf Ko-fi unterstützen :)" -history-command-leave-blank: "" +history-command-leave-blank: "" From e596b2edadbb3be8d89d8a135ae3429c5ef7a514 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 May 2024 17:47:35 +0800 Subject: [PATCH 46/81] clean up --- .../ghostchu/quickshop/platform/Platform.java | 2 +- .../platform/paper/PaperPlatform.java | 9 +-- .../spigot/AbstractSpigotPlatform.java | 9 ++- .../spigot/v1_20_4/Spigot1205Platform.java | 24 +++---- pom.xml | 2 +- quickshop-bukkit/pom.xml | 4 ++ .../command/subcommand/SubCommand_Debug.java | 9 +++ .../command/subcommand/SubCommand_Find.java | 4 +- .../quickshop/shop/SimpleShopManager.java | 31 ++++----- .../src/main/resources/libraries.maven | 19 ------ quickshop-common/pom.xml | 63 ++++++++++--------- 11 files changed, 78 insertions(+), 98 deletions(-) diff --git a/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java b/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java index 40d43887a3..e76397c1cb 100644 --- a/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java +++ b/platform/quickshop-platform-interface/src/main/java/com/ghostchu/quickshop/platform/Platform.java @@ -57,7 +57,7 @@ default String getItemShopId(@NotNull ItemStack stack) { return shopId; } - @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack); + @NotNull Component setItemStackHoverEvent(@NotNull Component oldComponent, @NotNull ItemStack stack); @NotNull Component getLine(@NotNull Sign sign, int line); diff --git a/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java b/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java index 1518daeada..d5a4395d25 100644 --- a/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java +++ b/platform/quickshop-platform-paper/src/main/java/com/ghostchu/quickshop/platform/paper/PaperPlatform.java @@ -53,10 +53,6 @@ public void shutdown() { return displayName; } - @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - return stack.asHoverEvent(); - } @Override public @NotNull Component getLine(@NotNull Sign sign, int line) { @@ -78,6 +74,11 @@ public void shutdown() { return Bukkit.getMinecraftVersion(); } + @Override + public @NotNull Component setItemStackHoverEvent(@NotNull Component oldComponent, @NotNull ItemStack stack) { + return oldComponent.hoverEvent(stack.asHoverEvent()); + } + @Override public @NotNull Component getTranslation(@NotNull Material material) { return Component.translatable(getTranslationKey(material)); diff --git a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java index ca75d90612..4d5fdc3f42 100644 --- a/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java +++ b/platform/quickshop-platform-spigot-abstract/src/main/java/com/ghostchu/quickshop/platform/spigot/AbstractSpigotPlatform.java @@ -39,8 +39,8 @@ import java.util.stream.Collectors; public abstract class AbstractSpigotPlatform implements Platform { - protected final Logger logger = Logger.getLogger("QuickShop-Hikari"); public final Plugin plugin; + protected final Logger logger = Logger.getLogger("QuickShop-Hikari"); protected Map translationMapping; private BukkitAudiences audience; @@ -132,7 +132,6 @@ public static String getNMSVersion() { return MiniMessage.miniMessage(); } - @Override public void sendMessage(@NotNull CommandSender sender, @NotNull Component component) { if (this.audience == null) { @@ -155,7 +154,7 @@ public void sendSignTextChange(@NotNull Player player, @NotNull Sign sign, boole } @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { + public @NotNull Component setItemStackHoverEvent(@NotNull Component oldComponent, @NotNull ItemStack stack) { NamespacedKey namespacedKey = stack.getType().getKey(); Key key = Key.key(namespacedKey.toString()); ReadWriteNBT nbt = NBT.itemStackToNBT(stack); @@ -166,10 +165,10 @@ public void sendSignTextChange(@NotNull Player player, @NotNull Sign sign, boole //noinspection UnstableApiUsage holder = BinaryTagHolder.of(nbt.toString()); } - return HoverEvent.showItem(key, stack.getAmount(), holder); + HoverEvent he = HoverEvent.showItem(key, stack.getAmount(), holder); + return oldComponent.hoverEvent(he); } - @Override public void setLore(@NotNull ItemStack stack, @NotNull Collection components) { NBT.modify(stack, nbt -> { diff --git a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java index b0925852fd..5a17e92561 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java +++ b/platform/quickshop-platform-spigot-v1_20_R4/src/main/java/com/ghostchu/quickshop/platform/spigot/v1_20_4/Spigot1205Platform.java @@ -37,23 +37,13 @@ public Spigot1205Platform(@NotNull Plugin plugin) { } @Override - public @NotNull HoverEvent getItemStackHoverEvent(@NotNull ItemStack stack) { - return HoverEvent.showText(Component.text("Click to preview the item") - .appendNewline() - .append(Component.text("× Item hover preview are not available at this time (Spigot 1.20.5+) due major item nbt related changes.").color(NamedTextColor.RED)) - .appendNewline() - .append(Component.text("💡 Consider switch to Paper to use PaperAPI instead.").color(NamedTextColor.GRAY))); -// NamespacedKey namespacedKey = stack.getType().getKey(); -// Key key = Key.key(namespacedKey.toString()); -// ReadWriteNBT nbt = NBT.itemStackToNBT(stack); -// BinaryTagHolder holder; -// if (Util.methodExists(BinaryTagHolder.class, "binaryTagHolder")) { -// holder = BinaryTagHolder.binaryTagHolder(nbt.toString()); -// } else { -// //noinspection UnstableApiUsage -// holder = BinaryTagHolder.of(nbt.toString()); -// } -// return HoverEvent.showItem(HoverEvent.ShowItem.showItem(key,stack.getAmount(), holder)); + public @NotNull Component setItemStackHoverEvent(@NotNull Component oldComponent, @NotNull ItemStack stack) { + return oldComponent.hoverEvent(HoverEvent.showText(Component.text("Click to preview the item") + .appendNewline() + .append(Component.text("× Item hover preview are not available at this time (Spigot 1.20.5+) due major item nbt related changes.").color(NamedTextColor.RED)) + .appendNewline() + .append(Component.text("💡 Consider switch to Paper to use PaperAPI instead.").color(NamedTextColor.GRAY)))); + } @Override diff --git a/pom.xml b/pom.xml index aab8135bae..df6828c5f4 100644 --- a/pom.xml +++ b/pom.xml @@ -113,6 +113,7 @@ de.tr7zw:item-nbt-api:* io.papermc:paperlib:* org.bstats:* + net.kyori:* @@ -179,7 +180,6 @@ META-INF/*.kotlin_module META-INF/*.txt META-INF/proguard/* - META-INF/services/* META-INF/versions/9/* *License* *LICENSE* diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 6ab1a55b31..b504e6a0f6 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -61,6 +61,10 @@ Mohist MC https://maven.mohistmc.com/ + + sonatype-oss-snapshots1 + https://s01.oss.sonatype.org/content/repositories/snapshots/ + diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index 5c0c38bf77..e52c11516a 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -17,10 +17,19 @@ import com.google.common.cache.Cache; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.HoverEvent; +import net.md_5.bungee.api.chat.ItemTag; +import net.md_5.bungee.api.chat.TextComponent; +import net.md_5.bungee.api.chat.hover.content.Item; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.event.HandlerList; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.RegisteredListener; import org.jetbrains.annotations.NotNull; diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Find.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Find.java index 74e3a18c2d..25bef2047f 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Find.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Find.java @@ -136,8 +136,8 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not location.getBlockY(), location.getBlockZ(), shopDoubleEntry.getValue().intValue() - ).forLocale() - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(previewItemStack)); + ).forLocale(); + entryComponent = plugin.getPlatform().setItemStackHoverEvent(entryComponent, shop.getItem()); MsgUtil.sendDirectMessage(sender, entryComponent); } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 33d551316f..0356e15c87 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -280,8 +280,8 @@ private void notifySold(@NotNull QUser buyerQUser, @NotNull Shop shop, int amoun List sendList = new ArrayList<>(); Component notify = plugin.text().of("player-sold-to-your-store", buyerQUser.getDisplay(), amount, - Util.getItemStackName(shop.getItem())).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + Util.getItemStackName(shop.getItem())).forLocale(langCode); + notify = plugin.getPlatform().setItemStackHoverEvent(notify, shop.getItem()); sendList.add(notify); if (space == amount) { Component spaceWarn; @@ -289,13 +289,12 @@ private void notifySold(@NotNull QUser buyerQUser, @NotNull Shop shop, int amoun spaceWarn = plugin.text().of("shop-out-of-space", shop.getLocation().getBlockX(), shop.getLocation().getBlockY(), - shop.getLocation().getBlockZ()).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + shop.getLocation().getBlockZ()).forLocale(langCode); } else { spaceWarn = plugin.text().of("shop-out-of-space-name", shop.getShopName(), - Util.getItemStackName(shop.getItem())).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + Util.getItemStackName(shop.getItem())).forLocale(langCode); } + spaceWarn = plugin.getPlatform().setItemStackHoverEvent(spaceWarn, shop.getItem()); sendList.add(spaceWarn); } for (Component component : sendList) { @@ -1349,8 +1348,8 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { previewComponentPrePopulateEvent.callEvent(); previewItemStack = previewComponentPrePopulateEvent.getItemStack(); Component previewComponent = plugin.text().of(p, "menu.preview", Component.text(previewItemStack.getAmount())).forLocale() - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(previewItemStack)) .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, MsgUtil.fillArgs("/quickshop silentpreview {0}", shop.getRuntimeRandomUniqueId().toString()))); + previewComponent = plugin.getPlatform().setItemStackHoverEvent(previewComponent, shop.getItem()); ItemPreviewComponentPopulateEvent itemPreviewComponentPopulateEvent = new ItemPreviewComponentPopulateEvent(previewComponent, p); itemPreviewComponentPopulateEvent.callEvent(); previewComponent = itemPreviewComponentPopulateEvent.getComponent(); @@ -1362,9 +1361,7 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { ItemStack previewItemStack = shop.getItem().clone(); ItemPreviewComponentPrePopulateEvent previewComponentPrePopulateEvent = new ItemPreviewComponentPrePopulateEvent(previewItemStack, p); previewComponentPrePopulateEvent.callEvent(); - chatSheetPrinter.printLine(plugin.text().of(p, "menu.item", Util.getItemStackName(previewComponentPrePopulateEvent.getItemStack())).forLocale() - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(previewComponentPrePopulateEvent.getItemStack())) - ); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.item", plugin.getPlatform().setItemStackHoverEvent(Util.getItemStackName(previewComponentPrePopulateEvent.getItemStack()), previewComponentPrePopulateEvent.getItemStack())).forLocale()); } if (Util.isTool(items.getType()) && plugin.getConfig().getBoolean("shop.info-panel.show-durability")) { @@ -1467,16 +1464,15 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, amount * shop.getItem().getAmount(), Util.getItemStackName(shop.getItem()), this.formatter.format(total - tax, shop), - this.formatter.format(tax, shop)).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + this.formatter.format(tax, shop)).forLocale(langCode); } else { notify = plugin.text().of("player-bought-from-your-store", seller, amount * shop.getItem().getAmount(), Util.getItemStackName(shop.getItem()), - this.formatter.format(total - tax, shop)).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + this.formatter.format(total - tax, shop)).forLocale(langCode); } + notify = plugin.getPlatform().setItemStackHoverEvent(notify, shop.getItem()); sendList.add(notify); // Transfers the item from A to B if (stock == amount) { @@ -1486,13 +1482,12 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, shop.getLocation().getBlockX(), shop.getLocation().getBlockY(), shop.getLocation().getBlockZ(), - Util.getItemStackName(shop.getItem())).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + Util.getItemStackName(shop.getItem())).forLocale(langCode); } else { stockWarn = plugin.text().of("shop-out-of-stock-name", shop.getShopName(), - Util.getItemStackName(shop.getItem())).forLocale(langCode) - .hoverEvent(plugin.getPlatform().getItemStackHoverEvent(shop.getItem())); + Util.getItemStackName(shop.getItem())).forLocale(langCode); } + stockWarn = plugin.getPlatform().setItemStackHoverEvent(stockWarn, shop.getItem()); sendList.add(stockWarn); } for (Component component : sendList) { diff --git a/quickshop-bukkit/src/main/resources/libraries.maven b/quickshop-bukkit/src/main/resources/libraries.maven index c91ebbd95f..2436a58cba 100644 --- a/quickshop-bukkit/src/main/resources/libraries.maven +++ b/quickshop-bukkit/src/main/resources/libraries.maven @@ -10,23 +10,4 @@ net.sourceforge.csvjdbc:csvjdbc:1.0.42@org.relique.jdbc.csv.CsvDriver org.dom4j:dom4j:2.1.4@org.dom4j.io.SAXReader com.vdurmont:semver4j:3.1.0@com.vdurmont.semver4j.Semver com.ghostchu.crowdin:crowdinota:1.0.3@com.ghostchu.crowdin.CrowdinOTA -net.kyori:adventure-api:4.16.0@net.kyori.adventure.Adventure -net.kyori:adventure-key:4.16.0@net.kyori.adventure.key.Key -net.kyori:adventure-nbt:4.16.0@net.kyori.adventure.nbt.CompoundBinaryTag -net.kyori:adventure-platform-api:4.3.2@net.kyori.adventure.platform.AudienceProvider -net.kyori:adventure-platform-bukkit:4.3.2@net.kyori.adventure.platform.bukkit.BukkitAudiences -net.kyori:adventure-platform-facet:4.3.2@net.kyori.adventure.platform.facet.FacetAudience -net.kyori:adventure-platform-viaversion:4.3.2@net.kyori.adventure.platform.viaversion.ViaFacet -net.kyori:adventure-serializer-configurate4:4.16.0@net.kyori.adventure.serializer.configurate4.KeySerializer -net.kyori:adventure-text-logger-slf4j:4.16.0@net.kyori.adventure.text.logger.slf4j.ComponentLogger -net.kyori:adventure-text-minimessage:4.16.0@net.kyori.adventure.text.minimessage.MiniMessage -net.kyori:adventure-text-serializer-ansi:4.16.0@net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer -net.kyori:adventure-text-serializer-bungeecord:4.3.2@net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer -net.kyori:adventure-text-serializer-gson-legacy-impl:4.16.0@net.kyori.adventure.text.serializer.gson.legacyimpl.NBTLegacyHoverEventSerializer -net.kyori:adventure-text-serializer-json:4.16.0@net.kyori.adventure.text.serializer.json.JSONComponentSerializer -net.kyori:adventure-text-serializer-json-legacy-impl:4.16.0@net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer -net.kyori:adventure-text-serializer-legacy:4.16.0@net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer -net.kyori:adventure-text-serializer-plain:4.16.0@net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer -net.kyori:examination-api:1.3.0@net.kyori.examination.Examinable -net.kyori:examination-string:1.3.0@net.kyori.examination.string.StringExaminer com.github.stefvanschie.inventoryframework:IF:0.10.13@com.github.stefvanschie.inventoryframework.gui.GuiItem \ No newline at end of file diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index db293ae0f3..0b7d9b26ce 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -70,109 +70,109 @@ net.kyori adventure-api compile - 4.15.0 + 4.17.0-SNAPSHOT net.kyori adventure-key compile - 4.15.0 + 4.17.0-SNAPSHOT net.kyori adventure-nbt compile - 4.15.0 + 4.17.0-SNAPSHOT net.kyori - adventure-platform-api + adventure-text-logger-slf4j compile - 4.3.2 + 4.17.0-SNAPSHOT net.kyori - adventure-platform-bukkit + adventure-text-minimessage compile - 4.3.2 + 4.17.0-SNAPSHOT net.kyori - adventure-platform-facet + adventure-text-serializer-ansi compile - 4.3.2 + 4.17.0-SNAPSHOT net.kyori - adventure-platform-viaversion + adventure-text-serializer-gson-legacy-impl compile - 4.3.2 + 4.17.0-SNAPSHOT net.kyori - adventure-text-logger-slf4j + adventure-text-serializer-json compile - 4.16.0 + 4.17.0-SNAPSHOT net.kyori - adventure-text-minimessage + adventure-text-serializer-json-legacy-impl compile - 4.15.0 + 4.17.0-SNAPSHOT net.kyori - adventure-text-serializer-ansi + adventure-text-serializer-legacy compile - 4.16.0 + 4.17.0-SNAPSHOT net.kyori - adventure-text-serializer-bungeecord + adventure-text-serializer-plain compile - 4.3.2 + 4.17.0-SNAPSHOT net.kyori - adventure-text-serializer-gson-legacy-impl + adventure-platform-api compile - 4.16.0 + 4.3.3-SNAPSHOT net.kyori - adventure-text-serializer-json + adventure-platform-bukkit compile - 4.15.0 + 4.3.3-SNAPSHOT net.kyori - adventure-text-serializer-json-legacy-impl + adventure-platform-facet compile - 4.15.0 + 4.3.3-SNAPSHOT net.kyori - adventure-text-serializer-legacy + adventure-platform-viaversion compile - 4.15.0 + 4.3.3-SNAPSHOT net.kyori - adventure-text-serializer-plain + adventure-text-serializer-bungeecord compile - 4.15.0 + 4.3.3-SNAPSHOT net.kyori examination-api compile - 1.3.0 + 1.3.1-SNAPSHOT net.kyori examination-string compile - 1.3.0 + 1.3.1-SNAPSHOT com.vdurmont @@ -180,6 +180,7 @@ 3.1.0 compile + \ No newline at end of file From 73ed82e113e9b98954078e46da324405951c1cf2 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Thu, 9 May 2024 18:39:35 +0800 Subject: [PATCH 47/81] Translatable debug messages --- .../command/subcommand/SubCommand_Debug.java | 71 +++++++++++-------- .../src/main/resources/lang/messages.yml | 20 ++++++ 2 files changed, 61 insertions(+), 30 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index e52c11516a..097c43304c 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -15,26 +15,20 @@ import com.ghostchu.quickshop.util.Util; import com.ghostchu.quickshop.util.performance.BatchBukkitExecutor; import com.google.common.cache.Cache; +import com.google.common.hash.Hashing; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; -import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import net.md_5.bungee.api.chat.BaseComponent; -import net.md_5.bungee.api.chat.HoverEvent; -import net.md_5.bungee.api.chat.ItemTag; -import net.md_5.bungee.api.chat.TextComponent; -import net.md_5.bungee.api.chat.hover.content.Item; import org.bukkit.ChatColor; -import org.bukkit.Material; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.RegisteredListener; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; import java.sql.Connection; import java.sql.SQLException; import java.time.Instant; @@ -79,38 +73,55 @@ public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabe case "toggle-db-debugmode" -> handleToggleDbDebugMode(sender, subParams); case "dump-hikaricp-status" -> handleDumpHikariCPStatus(sender, subParams); case "set-hikaricp-capacity" -> handleSetHikariCPCapacity(sender, subParams); + case "item-info" -> handleItemInfo(sender, subParams); default -> plugin.text().of(sender, "debug.arguments-invalid", parser.getArgs().get(0)).send(); } } + private void handleItemInfo(CommandSender sender, List subParams) { + if (!(sender instanceof Player player)) { + return; + } + String hand = player.getInventory().getItemInMainHand().getItemMeta().getAsString(); + plugin.text().of(sender, "debug.item-info-hand-as-string", hand, Hashing.crc32().hashString(hand, StandardCharsets.UTF_8).toString()).send(); + Shop shop = getLookingShop(sender); + if (shop != null) { + String store = shop.getItem().getItemMeta().getAsString(); + plugin.text().of(sender, "debug.item-info-store-as-string", store, Hashing.crc32().hashString(store, StandardCharsets.UTF_8).toString()).send(); + boolean hand2Store = plugin.getItemMatcher().matches(player.getInventory().getItemInMainHand(), shop.getItem()); + boolean store2Hand = plugin.getItemMatcher().matches(shop.getItem(), player.getInventory().getItemInMainHand()); + plugin.text().of(sender, "debug.item-matching-result", hand2Store, store2Hand).send(); + } + } + private void handleSetHikariCPCapacity(CommandSender sender, List subParams) { int size = Integer.parseInt(subParams.get(0)); HikariDataSource hikariDataSource = (HikariDataSource) plugin.getSqlManager().getDataSource(); hikariDataSource.setMaximumPoolSize(size); hikariDataSource.setMinimumIdle(size); - sender.sendMessage("MaximumPoolSize and MinimumIdle was set to "+size); + plugin.text().of(sender, "debug.hikari-cp-size-tweak",size).send();; } private void handleDbConnectionTest(CommandSender sender, List subParams) { - sender.sendMessage("Please wait..."); + plugin.text().of(sender,"debug.hikari-cp-testing").send(); try { CompletableFuture.supplyAsync(() -> { try (Connection connection = plugin.getSqlManager().getConnection()) { if (connection.isValid(1000)) { - sender.sendMessage("HikariCP working!"); + plugin.text().of(sender, "debug.hikari-cp-working").send();; } else { - sender.sendMessage("HikariCP returned a dead connection!"); + plugin.text().of(sender,"debug.hikari-cp-not-working"); } } catch (SQLException e) { - sender.sendMessage("Failed to test HikariCP"); + plugin.text().of(sender,"internal-error").send(); e.printStackTrace(); } return null; }).get(5, TimeUnit.SECONDS); } catch (TimeoutException e) { - sender.sendMessage("HikariCP seems stop working, please clean up all active queries to release connection resources."); + plugin.text().of(sender,"debug.hikari-cp-timeout").send(); } catch (ExecutionException | InterruptedException e) { - sender.sendMessage("Failed to test HikariCP"); + plugin.text().of(sender,"internal-error").send(); e.printStackTrace(); } } @@ -120,7 +131,7 @@ private void handleStopDbQueries(CommandSender sender, List subParams) { s.close(); return null; }).count(); - sender.sendMessage("Stopped " + stopped + " active queries."); + plugin.text().of(sender,"debug.queries-stopped", stopped).send(); } private void handleDumpHikariCPStatus(CommandSender sender, List subParams) { @@ -154,23 +165,23 @@ private void handleToggleDbDebugMode(CommandSender sender, List subParam } private void handleDumpDbConnections(CommandSender sender, List subParams) { - sender.sendMessage("Dumping active queries..."); + plugin.text().of(sender,"debug.queries-dumping").send(); for (Map.Entry e : plugin.getSqlManager().getActiveQuery().entrySet()) { sender.sendMessage(e.getKey().toString() + ": " + e.getValue()); } } private void handleDbManagerReset(CommandSender sender, List subParams) { - sender.sendMessage("Please wait..."); - sender.sendMessage("Shutting down sql manager"); + plugin.text().of(sender,"debug.restart-database-manager").send(); EasySQL.shutdownManager(this.plugin.getSqlManager()); - sender.sendMessage("Clear executors..."); - QuickExecutor.getHikaricpExecutor().shutdownNow().forEach(r -> sender.sendMessage("Unfinished HikariCP task: " + r)); + plugin.text().of(sender, "debug.restart-database-manager-clear-executors").send(); + QuickExecutor.getHikaricpExecutor().shutdownNow().forEach(r -> plugin.text().of(sender, "debug.restart-database-manager-unfinished-task", r).send()); QuickExecutor.setHikaricpExecutor(QuickExecutor.provideHikariCPExecutor()); - QuickExecutor.getShopHistoryQueryExecutor().shutdownNow().forEach(r -> sender.sendMessage("Unfinished HistoryQuery task: " + r)); + QuickExecutor.getShopHistoryQueryExecutor().shutdownNow().forEach(r -> plugin.text().of(sender,"debug.restart-database-manager-unfinished-task-history-query",r).send()); QuickExecutor.setShopHistoryQueryExecutor(QuickExecutor.provideShopHistoryQueryExecutor()); - sender.sendMessage("Re-launch database connect progress!"); + plugin.text().of(sender, "debug.restart-database-manager-reconnect").send(); Util.asyncThreadRun(plugin::setupDatabase); + plugin.text().of(sender, "debug.restart-database-manager-done").send(); } private void handleShopCacheResetting(CommandSender sender, List subParams) { @@ -182,16 +193,16 @@ private void handleShopCacheResetting(CommandSender sender, List subPara private void handleProperty(CommandSender sender, List subParams) { if (subParams.isEmpty()) { - sender.sendMessage("Error: You must enter a property key=value set."); + plugin.text().of(sender, "debug.property-incorrect").send(); return; } if (subParams.size() > 1) { - sender.sendMessage("Error: You must enter a (and only one) property key=value set. E.g aaa=bbb"); + plugin.text().of(sender, "debug.property-incorrect").send(); return; } String[] split = subParams.get(0).split("="); if (split.length < 1) { - sender.sendMessage("Error: You must enter a (and only one) property key=value set. E.g aaa=bbb"); + plugin.text().of(sender, "debug.property-incorrect").send(); return; } String key = split[0]; @@ -200,14 +211,15 @@ private void handleProperty(CommandSender sender, List subParams) { value = split[1]; } if (!key.startsWith("com.ghostchu.quickshop") && !key.startsWith("quickshop")) { - sender.sendMessage("Error: You can only set the quickshop related properties for safety."); + plugin.text().of(sender, "debug.property-security-block").send(); return; } if (value == null) { System.clearProperty(key); - sender.sendMessage("Property " + key + " has been deleted."); + plugin.text().of(sender, "debug.property-removed",key).send(); } else { String oldOne = System.setProperty(key, value); + plugin.text().of(sender, "debug.property-changed",key,oldOne,value).send(); sender.sendMessage("Property " + key + " has been changed from " + oldOne + " to " + value); } } @@ -284,7 +296,6 @@ public void switchDebug(@NotNull CommandSender sender) { private void handleHandlerList(@NotNull CommandSender sender, List remove) { if (remove.isEmpty()) { - MsgUtil.sendDirectMessage(sender, "You must enter an Bukkit Event class"); plugin.text().of(sender, "debug.handler-list-not-valid-bukkit-event-class", "null"); return; } diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 2d77e5bac0..3b641a9b1f 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -755,6 +755,26 @@ debug: for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... From 2525dfa5dfa48f356e450bfe407ea9690bb92509 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Thu, 9 May 2024 18:54:12 +0800 Subject: [PATCH 48/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/af-ZA/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/ar-SA/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/bg-BG/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/ca-ES/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/cs-CZ/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/da-DK/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/de-DE/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/el-GR/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/en-US/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/es-ES/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/fa-IR/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/fi-FI/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/fr-FR/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/he-IL/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/hi-IN/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/hu-HU/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/it-IT/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/ja-JP/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/ko-KR/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/lt-LT/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/nl-NL/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/no-NO/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/pl-PL/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/pt-BR/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/pt-PT/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/ro-RO/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/ru-RU/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/sr-SP/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/sv-SE/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/th-TH/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/tr-TR/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/uk-UA/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/vi-VN/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/zh-CN/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/zh-HK/messages.yml | 20 ++++++++++++++++++++ crowdin/lang/zh-TW/messages.yml | 20 ++++++++++++++++++++ 36 files changed, 720 insertions(+) diff --git a/crowdin/lang/af-ZA/messages.yml b/crowdin/lang/af-ZA/messages.yml index d28ddaa447..435a7ea7b1 100644 --- a/crowdin/lang/af-ZA/messages.yml +++ b/crowdin/lang/af-ZA/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ar-SA/messages.yml b/crowdin/lang/ar-SA/messages.yml index 1bfd7eaf94..bfd5b007b0 100644 --- a/crowdin/lang/ar-SA/messages.yml +++ b/crowdin/lang/ar-SA/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/bg-BG/messages.yml b/crowdin/lang/bg-BG/messages.yml index afafb9395d..e75dcc52a1 100644 --- a/crowdin/lang/bg-BG/messages.yml +++ b/crowdin/lang/bg-BG/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ca-ES/messages.yml b/crowdin/lang/ca-ES/messages.yml index d38b6c0b42..909e3b3d7e 100644 --- a/crowdin/lang/ca-ES/messages.yml +++ b/crowdin/lang/ca-ES/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/cs-CZ/messages.yml b/crowdin/lang/cs-CZ/messages.yml index ff9da03e47..7eef97bb2c 100644 --- a/crowdin/lang/cs-CZ/messages.yml +++ b/crowdin/lang/cs-CZ/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/da-DK/messages.yml b/crowdin/lang/da-DK/messages.yml index 6f6e7b8398..5fca561223 100644 --- a/crowdin/lang/da-DK/messages.yml +++ b/crowdin/lang/da-DK/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index 8311204f30..71fe8ff2ff 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Maximale Anzahl Shops die pro Tick aktualisiert werden können: {0}' update-player-shops-complete: Aufgabe erfolgreich. Aktualisierung benötigte {0}ms. update-player-shops-task-started: Die Aufgaben wurden gestartet. Bitte warte, bis sie abgeschlossen sind. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanne die isolierten Daten in der QuickShop Datenbank. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern... scanning-async: Scanne die isolierten Daten in der QuickShop Datenbank auf einem Asyncronen Auftrags-Thread. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern. Wenn es schiefgeht, versuch es später erneut. diff --git a/crowdin/lang/el-GR/messages.yml b/crowdin/lang/el-GR/messages.yml index 7e68dbfe15..0da999e0e8 100644 --- a/crowdin/lang/el-GR/messages.yml +++ b/crowdin/lang/el-GR/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/en-US/messages.yml b/crowdin/lang/en-US/messages.yml index cb8eb34499..53afef9cad 100644 --- a/crowdin/lang/en-US/messages.yml +++ b/crowdin/lang/en-US/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/es-ES/messages.yml b/crowdin/lang/es-ES/messages.yml index d8ecbb6e00..fb84aa6bb4 100644 --- a/crowdin/lang/es-ES/messages.yml +++ b/crowdin/lang/es-ES/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fa-IR/messages.yml b/crowdin/lang/fa-IR/messages.yml index 5c00b865fe..1f00bf6641 100644 --- a/crowdin/lang/fa-IR/messages.yml +++ b/crowdin/lang/fa-IR/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/fi-FI/messages.yml b/crowdin/lang/fi-FI/messages.yml index dbef3fbd0d..7f6d1fcf15 100644 --- a/crowdin/lang/fi-FI/messages.yml +++ b/crowdin/lang/fi-FI/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fr-FR/messages.yml b/crowdin/lang/fr-FR/messages.yml index ddd580dfa5..3d5c677071 100644 --- a/crowdin/lang/fr-FR/messages.yml +++ b/crowdin/lang/fr-FR/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/he-IL/messages.yml b/crowdin/lang/he-IL/messages.yml index 595d7578d4..d97b14088b 100644 --- a/crowdin/lang/he-IL/messages.yml +++ b/crowdin/lang/he-IL/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hi-IN/messages.yml b/crowdin/lang/hi-IN/messages.yml index 1c0392de27..fdee9799e6 100644 --- a/crowdin/lang/hi-IN/messages.yml +++ b/crowdin/lang/hi-IN/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hu-HU/messages.yml b/crowdin/lang/hu-HU/messages.yml index 797646e374..3830a7ae3f 100644 --- a/crowdin/lang/hu-HU/messages.yml +++ b/crowdin/lang/hu-HU/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index a2b0e0f467..3e417435bc 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ja-JP/messages.yml b/crowdin/lang/ja-JP/messages.yml index 0646df3599..741e2079fe 100644 --- a/crowdin/lang/ja-JP/messages.yml +++ b/crowdin/lang/ja-JP/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ko-KR/messages.yml b/crowdin/lang/ko-KR/messages.yml index 8f2720c7f0..cb9bbfa324 100644 --- a/crowdin/lang/ko-KR/messages.yml +++ b/crowdin/lang/ko-KR/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/lt-LT/messages.yml b/crowdin/lang/lt-LT/messages.yml index 739d2dd9e9..306ccbdfcb 100644 --- a/crowdin/lang/lt-LT/messages.yml +++ b/crowdin/lang/lt-LT/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/nl-NL/messages.yml b/crowdin/lang/nl-NL/messages.yml index 86a70cb82a..1c2fc240d0 100644 --- a/crowdin/lang/nl-NL/messages.yml +++ b/crowdin/lang/nl-NL/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/no-NO/messages.yml b/crowdin/lang/no-NO/messages.yml index e03765c1db..feef01be0e 100644 --- a/crowdin/lang/no-NO/messages.yml +++ b/crowdin/lang/no-NO/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Maks antall butikker som oppdateres per tick: {0}' update-player-shops-complete: Oppgave fullført, brukte {0}ms på oppdatering. update-player-shops-task-started: Oppgavene er startet, vennligst vent til den er fullført. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Skanner de isolerte dataene i QuickShop-databasen. Databasebelastningen kan øke skanneprosessen. Dette kan ta litt tid... scanning-async: Skanner de isolerte dataene i QuickShop-databasen på en asynkron oppgavetråd. Databasebelastningen kan øke skannesprosessen. Dette kan ta litt tid. Hvis det mislykkes, prøv igjen senere. diff --git a/crowdin/lang/pl-PL/messages.yml b/crowdin/lang/pl-PL/messages.yml index 14cd8dc0d9..160e2a4c19 100644 --- a/crowdin/lang/pl-PL/messages.yml +++ b/crowdin/lang/pl-PL/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-BR/messages.yml b/crowdin/lang/pt-BR/messages.yml index 2e8b3109f2..2432b43b79 100644 --- a/crowdin/lang/pt-BR/messages.yml +++ b/crowdin/lang/pt-BR/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Tarefas completadas, Usado {0}ms para atualizar. update-player-shops-task-started: As tarefas foram iniciadas, por favor espere até serem completadas. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-PT/messages.yml b/crowdin/lang/pt-PT/messages.yml index 1a6ee04404..dfa3200db9 100644 --- a/crowdin/lang/pt-PT/messages.yml +++ b/crowdin/lang/pt-PT/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ro-RO/messages.yml b/crowdin/lang/ro-RO/messages.yml index 89000b5456..984b1d19f9 100644 --- a/crowdin/lang/ro-RO/messages.yml +++ b/crowdin/lang/ro-RO/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ru-RU/messages.yml b/crowdin/lang/ru-RU/messages.yml index 43d2627c01..09d2d84c57 100644 --- a/crowdin/lang/ru-RU/messages.yml +++ b/crowdin/lang/ru-RU/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: Задачи запущены, пожалуйста, дождитесь их завершения. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sr-SP/messages.yml b/crowdin/lang/sr-SP/messages.yml index b432327198..41b0fe052f 100644 --- a/crowdin/lang/sr-SP/messages.yml +++ b/crowdin/lang/sr-SP/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sv-SE/messages.yml b/crowdin/lang/sv-SE/messages.yml index 7cd33f87db..6dba3d14de 100644 --- a/crowdin/lang/sv-SE/messages.yml +++ b/crowdin/lang/sv-SE/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/th-TH/messages.yml b/crowdin/lang/th-TH/messages.yml index 7b079f7dbe..8cfd2a68f8 100644 --- a/crowdin/lang/th-TH/messages.yml +++ b/crowdin/lang/th-TH/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/tr-TR/messages.yml b/crowdin/lang/tr-TR/messages.yml index d8c404b2cb..4eaf403aa2 100644 --- a/crowdin/lang/tr-TR/messages.yml +++ b/crowdin/lang/tr-TR/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/uk-UA/messages.yml b/crowdin/lang/uk-UA/messages.yml index 74c8fa5c89..586efe993b 100644 --- a/crowdin/lang/uk-UA/messages.yml +++ b/crowdin/lang/uk-UA/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/vi-VN/messages.yml b/crowdin/lang/vi-VN/messages.yml index 45dd47936e..790e3e5448 100644 --- a/crowdin/lang/vi-VN/messages.yml +++ b/crowdin/lang/vi-VN/messages.yml @@ -601,6 +601,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-CN/messages.yml b/crowdin/lang/zh-CN/messages.yml index ab97d6479e..54c5fd9fcc 100644 --- a/crowdin/lang/zh-CN/messages.yml +++ b/crowdin/lang/zh-CN/messages.yml @@ -611,6 +611,26 @@ debug: update-player-shops-per-tick-threshold: '最大商店可以每(tick)更新:{0}' update-player-shops-complete: 任务已完成,已使用 {0} 毫秒更新。 update-player-shops-task-started: 任务已开始,请等待完成。 + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: 正在 QuickShop 数据库中扫描孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间... scanning-async: 正在异步任务线程上扫描 QuickShop 数据库中孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间,请稍后再试。 diff --git a/crowdin/lang/zh-HK/messages.yml b/crowdin/lang/zh-HK/messages.yml index 1d6526b26a..bab40b8ee6 100644 --- a/crowdin/lang/zh-HK/messages.yml +++ b/crowdin/lang/zh-HK/messages.yml @@ -614,6 +614,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: Task completed, Used {0}ms for updating. update-player-shops-task-started: The tasks has been started, please wait for it to complete. + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 054378926a..6558518f4b 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -613,6 +613,26 @@ debug: update-player-shops-per-tick-threshold: 'Max shops can be update per tick: {0}' update-player-shops-complete: 任務已完成,已使用 {0} 毫秒更新。 update-player-shops-task-started: 任務已開始,請等候它完成。 + item-info-store-as-string: "The store you looking at: {0} Hash: {1}" + item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" + hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" + hikari-cp-testing: "Please wait, testing HikariCP connection..." + hikari-cp-working: "Pass! HikariCP working well!" + hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" + hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." + queries-stopped: "Stopped {0} active queries." + queries-dumping: "Dumping active queries..." + restart-database-manager: "Restarting SQLManager..." + restart-database-manager-clear-executors: "Clearing executors..." + restart-database-manager-unfinished-task: "Unfinished task: {0}" + restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" + restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" + restart-database-manager-done: "Done!" + property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" + property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + property-removed: "Removed property key {0}" + property-changed: "Property key {0} was changed from {1} to {2}" database: scanning: 正在掃描 QuickShop 資料庫中的孤立資料,在掃描過程中資料庫負載可能會增加,且這可能需要等候一段時間…… scanning-async: 正在掃描異步任務線程上 QuickShop 資料庫中的孤立資料,掃描過程中資料庫負載可能會增加,這可能需要等候一段時間,請稍後再試。 From 7b6e631abcd087dda28c3ad6b04677c8a9e17352 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Fri, 10 May 2024 23:39:57 +0800 Subject: [PATCH 49/81] Try to fix pig display issue --- .../display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java index 8d5ba91b87..118581d2f4 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_20_R2_TO_v1_20_R3.java @@ -60,7 +60,7 @@ public v1_20_R2_TO_v1_20_R3(QuickShop plugin, VirtualDisplayItemManager manager) //Entity ID .write(0, entityID); //Velocity x - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.valueOf("DROPPED_ITEM")); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location @@ -210,4 +210,4 @@ public void onPacketSending(@NotNull PacketEvent event) { } }; } -} +} \ No newline at end of file From f3df3ce3d3ef0f38a3953984ba63482d8ea42941 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Fri, 10 May 2024 23:54:32 +0800 Subject: [PATCH 50/81] use valueOf --- .../quickshop/shop/display/virtual/packetfactory/v1_18.java | 2 +- .../quickshop/shop/display/virtual/packetfactory/v1_19_R1.java | 2 +- .../display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java index 57e640e075..2eec90ea93 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_18.java @@ -60,7 +60,7 @@ public v1_18(QuickShop plugin, VirtualDisplayItemManager manager) { //Entity ID .write(0, entityID); //int data to mark - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.valueOf("DROPPED_ITEM")); fakeItemPacket.getIntegers().write(1, 0) //Velocity y .write(2, 0) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java index de14a03aee..073c5313c2 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R1.java @@ -58,7 +58,7 @@ public v1_19_R1(QuickShop plugin, VirtualDisplayItemManager manager) { fakeItemPacket.getIntegers() //Entity ID .write(0, entityID); - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.valueOf("DROPPED_ITEM")); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java index 956ede8a17..67e8b23a29 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packetfactory/v1_19_R2_TO_v1_20_R1.java @@ -63,7 +63,7 @@ public v1_19_R2_TO_v1_20_R1(QuickShop plugin, VirtualDisplayItemManager manager) //Entity ID .write(0, entityID); //Velocity x - fakeItemPacket.getEntityTypeModifier().write(0, EntityType.fromName("DROPPED_ITEM")); + fakeItemPacket.getEntityTypeModifier().write(0, EntityType.valueOf("DROPPED_ITEM")); //UUID fakeItemPacket.getUUIDs().write(0, UUID.randomUUID()); //Location From be7ca5df27c86c078f517d8662aad4bc75e0dd42 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Sat, 11 May 2024 14:48:21 +0800 Subject: [PATCH 51/81] Drop compatibility helper since we completely dropped any support before 1.18.2 --- .../ghostchu/quickshop/api/GameVersion.java | 94 ++++++++----------- .../quickshop/shop/ContainerShop.java | 15 +-- 2 files changed, 46 insertions(+), 63 deletions(-) diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java index 5e166b9608..1441e43195 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java @@ -10,46 +10,46 @@ */ @Getter public enum GameVersion { - v1_5_R1(false, true, false, false, false, false), - v1_5_R2(false, true, false, false, false, false), - v1_5_R3(false, true, false, false, false, false), - v1_6_R1(false, true, false, false, false, false), - v1_6_R2(false, true, false, false, false, false), - v1_6_R3(false, true, false, false, false, false), - v1_7_R1(false, true, false, false, false, false), - v1_7_R2(false, true, false, false, false, false), - v1_7_R3(false, true, false, false, false, false), - v1_7_R4(false, true, false, false, false, false), - v1_8_R1(false, true, false, false, false, false), - v1_8_R2(false, true, false, false, false, false), - v1_8_R3(false, true, false, false, false, false), - v1_9_R1(false, true, false, false, false, false), - v1_9_R2(false, true, false, false, false, false), - v1_10_R1(false, true, false, false, false, false), - v1_11_R1(false, true, false, false, false, false), - v1_12_R1(false, true, false, false, false, false), - v1_12_R2(false, true, false, false, false, false), - v1_13_R1(false, true, false, false, false, false), - v1_13_R2(false, true, false, false, false, false), - v1_14_R1(false, true, false, false, false, false), - v1_14_R2(false, true, false, false, false, false), - v1_15_R1(false, true, false, false, false, false), - v1_15_R2(false, true, false, false, false, false), - v1_16_R1(false, true, false, false, false, false), - v1_16_R2(false, true, false, false, false, false), - v1_16_R3(false, true, false, false, false, false), - v1_16_R4(false, true, false, false, false, false), - v1_17_R1(false, true, false, true, true, true), - v1_18_R1(false, true, false, true, true, true), - v1_18_R2(true, true, true, true, true, true), - v1_19_R1(true, true, true, true, true, true), - v1_19_R2(true, true, true, true, true, true), - v1_19_R3(true, true, true, true, true, true), - v1_20_R1(true, true, true, true, true, true), - v1_20_R2(true, false, true, true, true, true), - v1_20_R3(true, false, true, true, true, true), - v1_20_R4(true, false, true, true, true, true), - UNKNOWN(true, false, false, true, true, true); + v1_5_R1(false, true, false, false), + v1_5_R2(false, true, false, false), + v1_5_R3(false, true, false, false), + v1_6_R1(false, true, false, false), + v1_6_R2(false, true, false, false), + v1_6_R3(false, true, false, false), + v1_7_R1(false, true, false, false), + v1_7_R2(false, true, false, false), + v1_7_R3(false, true, false, false), + v1_7_R4(false, true, false, false), + v1_8_R1(false, true, false, false), + v1_8_R2(false, true, false, false), + v1_8_R3(false, true, false, false), + v1_9_R1(false, true, false, false), + v1_9_R2(false, true, false, false), + v1_10_R1(false, true, false, false), + v1_11_R1(false, true, false, false), + v1_12_R1(false, true, false, false), + v1_12_R2(false, true, false, false), + v1_13_R1(false, true, false, false), + v1_13_R2(false, true, false, false), + v1_14_R1(false, true, false, false), + v1_14_R2(false, true, false, false), + v1_15_R1(false, true, false, false), + v1_15_R2(false, true, false, false), + v1_16_R1(false, true, false, false), + v1_16_R2(false, true, false, false), + v1_16_R3(false, true, false, false), + v1_16_R4(false, true, false, false), + v1_17_R1(false, true, false, true), + v1_18_R1(false, true, false, true), + v1_18_R2(true, true, true, true), + v1_19_R1(true, true, true, true), + v1_19_R2(true, true, true, true), + v1_19_R3(true, true, true, true), + v1_20_R1(true, true, true, true), + v1_20_R2(true, false, true, true), + v1_20_R3(true, false, true, true), + v1_20_R4(true, false, false, true), + UNKNOWN(true, false, false, true); /** * CoreSupports - Check does QuickShop most features supports this server version */ @@ -70,23 +70,11 @@ public enum GameVersion { */ private final boolean newNmsName; - /** - * Sign Glowing Support - */ - private final boolean signGlowingSupport; - - /** - * Sign Glowing Support - */ - private final boolean signTextDyeSupport; - - GameVersion(boolean coreSupports, boolean endOfLife, boolean virtualDisplaySupports, boolean newNmsName, boolean signGlowingSupport, boolean signTextDyeSupport) { + GameVersion(boolean coreSupports, boolean endOfLife, boolean virtualDisplaySupports, boolean newNmsName) { this.coreSupports = coreSupports; this.endOfLife = endOfLife; this.virtualDisplaySupports = virtualDisplaySupports; this.newNmsName = newNmsName; - this.signGlowingSupport = signGlowingSupport; - this.signTextDyeSupport = signTextDyeSupport; } 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 28dc1fdf21..e987d0cad6 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 @@ -32,7 +32,6 @@ import com.ghostchu.simplereloadlib.Reloadable; import io.papermc.lib.PaperLib; import lombok.EqualsAndHashCode; -import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.apache.commons.lang3.StringUtils; @@ -1428,16 +1427,12 @@ public void setSignText(@NotNull List lines) { Log.debug("Globally sign text setting..."); List signs = this.getSigns(); for (Sign sign : signs) { - if (plugin.getGameVersion().isSignTextDyeSupport()) { - DyeColor dyeColor = Util.getDyeColor(); - if (dyeColor != null) { - sign.setColor(dyeColor); - } - } - if (plugin.getGameVersion().isSignGlowingSupport()) { - boolean isGlowing = plugin.getConfig().getBoolean("shop.sign-glowing"); - sign.setGlowingText(isGlowing); + DyeColor dyeColor = Util.getDyeColor(); + if (dyeColor != null) { + sign.setColor(dyeColor); } + boolean isGlowing = plugin.getConfig().getBoolean("shop.sign-glowing"); + sign.setGlowingText(isGlowing); sign.update(true); //plugin.getPlatform().setLine(sign, i, lines.get(i)); plugin.getPlatform().setLines(sign, lines); From 9ad03d87187bbea4cfc506ec3624c8c38faf6cce Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Sat, 11 May 2024 14:52:14 +0800 Subject: [PATCH 52/81] Allow mark all shops as dirty status --- .../quickshop/command/subcommand/SubCommand_Debug.java | 6 ++++++ quickshop-bukkit/src/main/resources/lang/messages.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index 097c43304c..d1bff44c69 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -74,10 +74,16 @@ public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabe case "dump-hikaricp-status" -> handleDumpHikariCPStatus(sender, subParams); case "set-hikaricp-capacity" -> handleSetHikariCPCapacity(sender, subParams); case "item-info" -> handleItemInfo(sender, subParams); + case "mark-all-shops-dirty" -> handleShopsDirtyAndSave(sender, subParams); default -> plugin.text().of(sender, "debug.arguments-invalid", parser.getArgs().get(0)).send(); } } + private void handleShopsDirtyAndSave(CommandSender sender, List subParams) { + plugin.getShopManager().getAllShops().forEach(Shop::setDirty); + plugin.text().of(sender, "debug.marked-as-dirty").send(); + } + private void handleItemInfo(CommandSender sender, List subParams) { if (!(sender instanceof Player player)) { return; diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 3b641a9b1f..89ba5a24ab 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -775,6 +775,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... From 05135bdf94e7a9838cd134bc6261fedcb8ed84ea Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Sat, 11 May 2024 14:59:53 +0800 Subject: [PATCH 53/81] Tab-complete for /qs debug --- .../command/subcommand/SubCommand_Debug.java | 57 ++++++++++++------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index d1bff44c69..8e9d3fab01 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -37,13 +37,37 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.function.BiConsumer; public class SubCommand_Debug implements CommandHandler { private final QuickShop plugin; + private final Map>> subParamMapping = new HashMap<>(); public SubCommand_Debug(QuickShop plugin) { this.plugin = plugin; + subParamMapping.put("debug", (sender,subParams)->switchDebug(sender)); + subParamMapping.put("dev", (sender,subParams)->switchDebug(sender)); + subParamMapping.put("devmode", (sender,subParams)->switchDebug(sender)); + subParamMapping.put("signs", (sender,subParams)->handleSigns(sender)); + subParamMapping.put("database", this::handleDatabase); + subParamMapping.put("updateplayersigns", this::handleSignsUpdate); + subParamMapping.put("force-shops-reload", this::handleShopsReload); + subParamMapping.put("force-shoploader-reload", this::handleShopsLoaderReload); + subParamMapping.put("check-shop-status", this::handleShopDebug); + subParamMapping.put("toggle-shop-load-status", this::handleShopLoading); + subParamMapping.put("check-shop-debug", this::handleShopInfo); + subParamMapping.put("set-property", this::handleShopsReload); + subParamMapping.put("force-shops-reload", this::handleProperty); + subParamMapping.put("reset-shop-caches", this::handleShopCacheResetting); + subParamMapping.put("reset-dbmanager", this::handleDbManagerReset); + subParamMapping.put("dump-db-connections", this::handleDumpDbConnections); + subParamMapping.put("stop-db-any-queries", this::handleStopDbQueries); + subParamMapping.put("toggle-db-debugmode", this::handleToggleDbDebugMode); + subParamMapping.put("dump-hikaricp-status", this::handleDumpHikariCPStatus); + subParamMapping.put("set-hikaricp-capacity", this::handleSetHikariCPCapacity); + subParamMapping.put("item-info", this::handleItemInfo); + subParamMapping.put("mark-all-shops-dirty", this::handleShopsDirtyAndSave); } @Override @@ -54,29 +78,15 @@ public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabe } List subParams = new ArrayList<>(parser.getArgs()); subParams.remove(0); - switch (parser.getArgs().get(0)) { - case "debug", "dev", "devmode" -> switchDebug(sender); - case "handlerlist" -> handleHandlerList(sender, subParams); - case "signs" -> handleSigns(sender); - case "database" -> handleDatabase(sender, subParams); - case "updateplayersigns" -> handleSignsUpdate(sender, subParams); - case "force-shops-reload" -> handleShopsReload(sender, subParams); - case "force-shoploader-reload" -> handleShopsLoaderReload(sender, subParams); - case "check-shop-status" -> handleShopDebug(sender, subParams); - case "toggle-shop-load-status" -> handleShopLoading(sender, subParams); - case "check-shop-debug" -> handleShopInfo(sender, subParams); - case "set-property" -> handleProperty(sender, subParams); - case "reset-shop-caches" -> handleShopCacheResetting(sender, subParams); - case "reset-dbmanager" -> handleDbManagerReset(sender, subParams); - case "dump-db-connections" -> handleDumpDbConnections(sender, subParams); - case "stop-db-any-queries" -> handleStopDbQueries(sender, subParams); - case "toggle-db-debugmode" -> handleToggleDbDebugMode(sender, subParams); - case "dump-hikaricp-status" -> handleDumpHikariCPStatus(sender, subParams); - case "set-hikaricp-capacity" -> handleSetHikariCPCapacity(sender, subParams); - case "item-info" -> handleItemInfo(sender, subParams); - case "mark-all-shops-dirty" -> handleShopsDirtyAndSave(sender, subParams); - default -> plugin.text().of(sender, "debug.arguments-invalid", parser.getArgs().get(0)).send(); + String arg = parser.getArgs().get(0); + + BiConsumer> executor = subParamMapping.get(arg); + if(executor == null){ + plugin.text().of(sender, "debug.arguments-invalid", parser.getArgs().get(0)).send(); + return; } + + executor.accept(sender, subParams); } private void handleShopsDirtyAndSave(CommandSender sender, List subParams) { @@ -380,6 +390,9 @@ public void printHandlerList(@NotNull CommandSender sender, String event) { @Override public List onTabComplete( @NotNull CommandSender sender, @NotNull String commandLabel, @NotNull CommandParser parser) { + if(parser.getArgs().size() == 1){ + return List.copyOf(subParamMapping.keySet()); + } return Collections.emptyList(); } From ed1836cf6d783f175f4085b345a8ed2b577000d7 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Sat, 11 May 2024 16:26:16 +0800 Subject: [PATCH 54/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/af-ZA/messages.yml | 1 + crowdin/lang/ar-SA/messages.yml | 1 + crowdin/lang/bg-BG/messages.yml | 1 + crowdin/lang/ca-ES/messages.yml | 1 + crowdin/lang/cs-CZ/messages.yml | 1 + crowdin/lang/da-DK/messages.yml | 1 + crowdin/lang/de-DE/messages.yml | 1 + crowdin/lang/el-GR/messages.yml | 1 + crowdin/lang/en-US/messages.yml | 1 + crowdin/lang/es-ES/messages.yml | 1 + crowdin/lang/fa-IR/messages.yml | 1 + crowdin/lang/fi-FI/messages.yml | 1 + crowdin/lang/fr-FR/messages.yml | 1 + crowdin/lang/he-IL/messages.yml | 1 + crowdin/lang/hi-IN/messages.yml | 1 + crowdin/lang/hu-HU/messages.yml | 1 + crowdin/lang/it-IT/messages.yml | 1 + crowdin/lang/ja-JP/messages.yml | 1 + crowdin/lang/ko-KR/messages.yml | 1 + crowdin/lang/lt-LT/messages.yml | 1 + crowdin/lang/nl-NL/messages.yml | 1 + crowdin/lang/no-NO/messages.yml | 1 + crowdin/lang/pl-PL/messages.yml | 1 + crowdin/lang/pt-BR/messages.yml | 1 + crowdin/lang/pt-PT/messages.yml | 1 + crowdin/lang/ro-RO/messages.yml | 1 + crowdin/lang/ru-RU/messages.yml | 1 + crowdin/lang/sr-SP/messages.yml | 1 + crowdin/lang/sv-SE/messages.yml | 1 + crowdin/lang/th-TH/messages.yml | 1 + crowdin/lang/tr-TR/messages.yml | 1 + crowdin/lang/uk-UA/messages.yml | 1 + crowdin/lang/vi-VN/messages.yml | 1 + crowdin/lang/zh-CN/messages.yml | 43 +++++++++++++++++---------------- crowdin/lang/zh-HK/messages.yml | 1 + crowdin/lang/zh-TW/messages.yml | 1 + 36 files changed, 57 insertions(+), 21 deletions(-) diff --git a/crowdin/lang/af-ZA/messages.yml b/crowdin/lang/af-ZA/messages.yml index 435a7ea7b1..135b0c01a3 100644 --- a/crowdin/lang/af-ZA/messages.yml +++ b/crowdin/lang/af-ZA/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ar-SA/messages.yml b/crowdin/lang/ar-SA/messages.yml index bfd5b007b0..2b9b5ffb40 100644 --- a/crowdin/lang/ar-SA/messages.yml +++ b/crowdin/lang/ar-SA/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/bg-BG/messages.yml b/crowdin/lang/bg-BG/messages.yml index e75dcc52a1..31c89e9c82 100644 --- a/crowdin/lang/bg-BG/messages.yml +++ b/crowdin/lang/bg-BG/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ca-ES/messages.yml b/crowdin/lang/ca-ES/messages.yml index 909e3b3d7e..29678cee24 100644 --- a/crowdin/lang/ca-ES/messages.yml +++ b/crowdin/lang/ca-ES/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/cs-CZ/messages.yml b/crowdin/lang/cs-CZ/messages.yml index 7eef97bb2c..6c6dc3803a 100644 --- a/crowdin/lang/cs-CZ/messages.yml +++ b/crowdin/lang/cs-CZ/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/da-DK/messages.yml b/crowdin/lang/da-DK/messages.yml index 5fca561223..9bda6047f1 100644 --- a/crowdin/lang/da-DK/messages.yml +++ b/crowdin/lang/da-DK/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index 71fe8ff2ff..85b83ab528 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanne die isolierten Daten in der QuickShop Datenbank. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern... scanning-async: Scanne die isolierten Daten in der QuickShop Datenbank auf einem Asyncronen Auftrags-Thread. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern. Wenn es schiefgeht, versuch es später erneut. diff --git a/crowdin/lang/el-GR/messages.yml b/crowdin/lang/el-GR/messages.yml index 0da999e0e8..a4ea502723 100644 --- a/crowdin/lang/el-GR/messages.yml +++ b/crowdin/lang/el-GR/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/en-US/messages.yml b/crowdin/lang/en-US/messages.yml index 53afef9cad..d7afee2c90 100644 --- a/crowdin/lang/en-US/messages.yml +++ b/crowdin/lang/en-US/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/es-ES/messages.yml b/crowdin/lang/es-ES/messages.yml index fb84aa6bb4..4ae00c9fba 100644 --- a/crowdin/lang/es-ES/messages.yml +++ b/crowdin/lang/es-ES/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fa-IR/messages.yml b/crowdin/lang/fa-IR/messages.yml index 1f00bf6641..3938c2762c 100644 --- a/crowdin/lang/fa-IR/messages.yml +++ b/crowdin/lang/fa-IR/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/fi-FI/messages.yml b/crowdin/lang/fi-FI/messages.yml index 7f6d1fcf15..0a0f5b4685 100644 --- a/crowdin/lang/fi-FI/messages.yml +++ b/crowdin/lang/fi-FI/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fr-FR/messages.yml b/crowdin/lang/fr-FR/messages.yml index 3d5c677071..30de678570 100644 --- a/crowdin/lang/fr-FR/messages.yml +++ b/crowdin/lang/fr-FR/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/he-IL/messages.yml b/crowdin/lang/he-IL/messages.yml index d97b14088b..962ded86a1 100644 --- a/crowdin/lang/he-IL/messages.yml +++ b/crowdin/lang/he-IL/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hi-IN/messages.yml b/crowdin/lang/hi-IN/messages.yml index fdee9799e6..07dee2eb3c 100644 --- a/crowdin/lang/hi-IN/messages.yml +++ b/crowdin/lang/hi-IN/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hu-HU/messages.yml b/crowdin/lang/hu-HU/messages.yml index 3830a7ae3f..ef87c762eb 100644 --- a/crowdin/lang/hu-HU/messages.yml +++ b/crowdin/lang/hu-HU/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index 3e417435bc..271f3576e8 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ja-JP/messages.yml b/crowdin/lang/ja-JP/messages.yml index 741e2079fe..1d102d57c4 100644 --- a/crowdin/lang/ja-JP/messages.yml +++ b/crowdin/lang/ja-JP/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ko-KR/messages.yml b/crowdin/lang/ko-KR/messages.yml index cb9bbfa324..8678155311 100644 --- a/crowdin/lang/ko-KR/messages.yml +++ b/crowdin/lang/ko-KR/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/lt-LT/messages.yml b/crowdin/lang/lt-LT/messages.yml index 306ccbdfcb..c355a17029 100644 --- a/crowdin/lang/lt-LT/messages.yml +++ b/crowdin/lang/lt-LT/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/nl-NL/messages.yml b/crowdin/lang/nl-NL/messages.yml index 1c2fc240d0..89a7de438d 100644 --- a/crowdin/lang/nl-NL/messages.yml +++ b/crowdin/lang/nl-NL/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/no-NO/messages.yml b/crowdin/lang/no-NO/messages.yml index feef01be0e..5c4a391fac 100644 --- a/crowdin/lang/no-NO/messages.yml +++ b/crowdin/lang/no-NO/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Skanner de isolerte dataene i QuickShop-databasen. Databasebelastningen kan øke skanneprosessen. Dette kan ta litt tid... scanning-async: Skanner de isolerte dataene i QuickShop-databasen på en asynkron oppgavetråd. Databasebelastningen kan øke skannesprosessen. Dette kan ta litt tid. Hvis det mislykkes, prøv igjen senere. diff --git a/crowdin/lang/pl-PL/messages.yml b/crowdin/lang/pl-PL/messages.yml index 160e2a4c19..b285d3662a 100644 --- a/crowdin/lang/pl-PL/messages.yml +++ b/crowdin/lang/pl-PL/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-BR/messages.yml b/crowdin/lang/pt-BR/messages.yml index 2432b43b79..15bb3c90e9 100644 --- a/crowdin/lang/pt-BR/messages.yml +++ b/crowdin/lang/pt-BR/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-PT/messages.yml b/crowdin/lang/pt-PT/messages.yml index dfa3200db9..404fa279b2 100644 --- a/crowdin/lang/pt-PT/messages.yml +++ b/crowdin/lang/pt-PT/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ro-RO/messages.yml b/crowdin/lang/ro-RO/messages.yml index 984b1d19f9..4432efa3ed 100644 --- a/crowdin/lang/ro-RO/messages.yml +++ b/crowdin/lang/ro-RO/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ru-RU/messages.yml b/crowdin/lang/ru-RU/messages.yml index 09d2d84c57..5dab3324fa 100644 --- a/crowdin/lang/ru-RU/messages.yml +++ b/crowdin/lang/ru-RU/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sr-SP/messages.yml b/crowdin/lang/sr-SP/messages.yml index 41b0fe052f..f1f26e83db 100644 --- a/crowdin/lang/sr-SP/messages.yml +++ b/crowdin/lang/sr-SP/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sv-SE/messages.yml b/crowdin/lang/sv-SE/messages.yml index 6dba3d14de..7dede08556 100644 --- a/crowdin/lang/sv-SE/messages.yml +++ b/crowdin/lang/sv-SE/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/th-TH/messages.yml b/crowdin/lang/th-TH/messages.yml index 8cfd2a68f8..4351b06e53 100644 --- a/crowdin/lang/th-TH/messages.yml +++ b/crowdin/lang/th-TH/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/tr-TR/messages.yml b/crowdin/lang/tr-TR/messages.yml index 4eaf403aa2..b75234b1b1 100644 --- a/crowdin/lang/tr-TR/messages.yml +++ b/crowdin/lang/tr-TR/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/uk-UA/messages.yml b/crowdin/lang/uk-UA/messages.yml index 586efe993b..a506eb5208 100644 --- a/crowdin/lang/uk-UA/messages.yml +++ b/crowdin/lang/uk-UA/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/vi-VN/messages.yml b/crowdin/lang/vi-VN/messages.yml index 790e3e5448..8a7009cf10 100644 --- a/crowdin/lang/vi-VN/messages.yml +++ b/crowdin/lang/vi-VN/messages.yml @@ -621,6 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-CN/messages.yml b/crowdin/lang/zh-CN/messages.yml index 54c5fd9fcc..1c3c7b5672 100644 --- a/crowdin/lang/zh-CN/messages.yml +++ b/crowdin/lang/zh-CN/messages.yml @@ -611,26 +611,27 @@ debug: update-player-shops-per-tick-threshold: '最大商店可以每(tick)更新:{0}' update-player-shops-complete: 任务已完成,已使用 {0} 毫秒更新。 update-player-shops-task-started: 任务已开始,请等待完成。 - item-info-store-as-string: "The store you looking at: {0} Hash: {1}" - item-info-hand-as-string: "The item in your hand: {0} Hash: {1}" + item-info-store-as-string: "您正在查看的商店: {0} Hash: {1}" + item-info-hand-as-string: "您手中的物品: {0} Hash: {1}" item-matching-result: "Hand2Store: {0}, Store2Hand: {1}" - hikari-cp-size-tweak: "HikariCP MaximumPoolSize and MinimumIdle was set to {0}" - hikari-cp-testing: "Please wait, testing HikariCP connection..." - hikari-cp-working: "Pass! HikariCP working well!" - hikari-cp-not-working: "Failed! The connection that returned by HikariCP is dead! (Not passed test in 1 second)" - hikari-cp-timeout: "HikariCP is timed out while getting a valid connection, please clean up all active queries to release connection resources." - queries-stopped: "Stopped {0} active queries." - queries-dumping: "Dumping active queries..." - restart-database-manager: "Restarting SQLManager..." + hikari-cp-size-tweak: "HikariCP MaximumPoolsize 和 MinimumIdle 已设置为 {0}" + hikari-cp-testing: "请稍候,正在测试 HikariCP 连接..." + hikari-cp-working: "通过!HikariCP运行良好!" + hikari-cp-not-working: "失败!HikariCP返回的连接未正常工作!(未在 1 秒内通过测试)" + hikari-cp-timeout: "HikariCP 在获取有效连接时超时,请清理所有活动查询以释放连接资源。" + queries-stopped: "停止 {0} 活动查询。" + queries-dumping: "正在转储活动查询..." + restart-database-manager: "重新启动 SQLManager..." restart-database-manager-clear-executors: "Clearing executors..." - restart-database-manager-unfinished-task: "Unfinished task: {0}" - restart-database-manager-unfinished-task-history-query: "Unfinished task (History Query): {0}" - restart-database-manager-reconnect: "Re-launching SQLManager via initial sequence (via async executor)" - restart-database-manager-done: "Done!" - property-incorrect: "You must enter a (and only one) property key=value set. E.g aaa=bbb" - property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." + restart-database-manager-unfinished-task: "未完成的任务: {0}" + restart-database-manager-unfinished-task-history-query: "未完成的任务(历史查询): {0}" + restart-database-manager-reconnect: "通过初始序列重新启动 SQLManager (通过 async 执行器)" + restart-database-manager-done: "完成!" + property-incorrect: "您必须输入属性键值(且只输入一个)。例如,aaa=bbb" + property-security-block: "请求被拒绝,出于安全原因,您只能更改启动脚本 com.ghostchu.quickshopquickshop 的属性。" property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: 正在 QuickShop 数据库中扫描孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间... scanning-async: 正在异步任务线程上扫描 QuickShop 数据库中孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间,请稍后再试。 @@ -1542,11 +1543,11 @@ history: - "余额: {3}" - "税: {4}" log-icon-description-with-store-name: - - "Store: {0}" - - "Purchaser: {1}" - - "Item: {2} x{3}" - - "Balance: {4}" - - "Tax: {5}" + - "商店: {0}" + - "交易者: {1}" + - "物品: {2} x{3}" + - "余额: {4}" + - "税: {5}" query-icon: "请稍候,正在查询..." previous-page: "<< 前一页" next-page: "下一页 >>" diff --git a/crowdin/lang/zh-HK/messages.yml b/crowdin/lang/zh-HK/messages.yml index bab40b8ee6..7139f63248 100644 --- a/crowdin/lang/zh-HK/messages.yml +++ b/crowdin/lang/zh-HK/messages.yml @@ -634,6 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 6558518f4b..97af189c4d 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -633,6 +633,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" + marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: 正在掃描 QuickShop 資料庫中的孤立資料,在掃描過程中資料庫負載可能會增加,且這可能需要等候一段時間…… scanning-async: 正在掃描異步任務線程上 QuickShop 資料庫中的孤立資料,掃描過程中資料庫負載可能會增加,這可能需要等候一段時間,請稍後再試。 From 38664078ea69887e0788d5cdaa7b4f5263d6a970 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Sat, 11 May 2024 20:42:37 +0800 Subject: [PATCH 55/81] fix translation --- quickshop-bukkit/src/main/resources/lang/messages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 89ba5a24ab..15e60589ed 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -775,7 +775,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... From e0b42650d59aebe430693c2cab2a504121022b10 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Sat, 11 May 2024 21:07:33 +0800 Subject: [PATCH 56/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/af-ZA/messages.yml | 2 +- crowdin/lang/ar-SA/messages.yml | 2 +- crowdin/lang/bg-BG/messages.yml | 2 +- crowdin/lang/ca-ES/messages.yml | 2 +- crowdin/lang/cs-CZ/messages.yml | 2 +- crowdin/lang/da-DK/messages.yml | 2 +- crowdin/lang/de-DE/messages.yml | 2 +- crowdin/lang/el-GR/messages.yml | 2 +- crowdin/lang/en-US/messages.yml | 2 +- crowdin/lang/es-ES/messages.yml | 2 +- crowdin/lang/fa-IR/messages.yml | 2 +- crowdin/lang/fi-FI/messages.yml | 2 +- crowdin/lang/fr-FR/messages.yml | 2 +- crowdin/lang/he-IL/messages.yml | 2 +- crowdin/lang/hi-IN/messages.yml | 2 +- crowdin/lang/hu-HU/messages.yml | 2 +- crowdin/lang/it-IT/messages.yml | 2 +- crowdin/lang/ja-JP/messages.yml | 2 +- crowdin/lang/ko-KR/messages.yml | 2 +- crowdin/lang/lt-LT/messages.yml | 2 +- crowdin/lang/nl-NL/messages.yml | 2 +- crowdin/lang/no-NO/messages.yml | 2 +- crowdin/lang/pl-PL/messages.yml | 2 +- crowdin/lang/pt-BR/messages.yml | 2 +- crowdin/lang/pt-PT/messages.yml | 2 +- crowdin/lang/ro-RO/messages.yml | 2 +- crowdin/lang/ru-RU/messages.yml | 2 +- crowdin/lang/sr-SP/messages.yml | 2 +- crowdin/lang/sv-SE/messages.yml | 2 +- crowdin/lang/th-TH/messages.yml | 2 +- crowdin/lang/tr-TR/messages.yml | 2 +- crowdin/lang/uk-UA/messages.yml | 2 +- crowdin/lang/vi-VN/messages.yml | 2 +- crowdin/lang/zh-CN/messages.yml | 2 +- crowdin/lang/zh-HK/messages.yml | 2 +- crowdin/lang/zh-TW/messages.yml | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/crowdin/lang/af-ZA/messages.yml b/crowdin/lang/af-ZA/messages.yml index 135b0c01a3..cbe617741c 100644 --- a/crowdin/lang/af-ZA/messages.yml +++ b/crowdin/lang/af-ZA/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ar-SA/messages.yml b/crowdin/lang/ar-SA/messages.yml index 2b9b5ffb40..5ec108f0fc 100644 --- a/crowdin/lang/ar-SA/messages.yml +++ b/crowdin/lang/ar-SA/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/bg-BG/messages.yml b/crowdin/lang/bg-BG/messages.yml index 31c89e9c82..98f3a89e9b 100644 --- a/crowdin/lang/bg-BG/messages.yml +++ b/crowdin/lang/bg-BG/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ca-ES/messages.yml b/crowdin/lang/ca-ES/messages.yml index 29678cee24..f157a9b194 100644 --- a/crowdin/lang/ca-ES/messages.yml +++ b/crowdin/lang/ca-ES/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/cs-CZ/messages.yml b/crowdin/lang/cs-CZ/messages.yml index 6c6dc3803a..a961a6bee6 100644 --- a/crowdin/lang/cs-CZ/messages.yml +++ b/crowdin/lang/cs-CZ/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/da-DK/messages.yml b/crowdin/lang/da-DK/messages.yml index 9bda6047f1..e0741ec338 100644 --- a/crowdin/lang/da-DK/messages.yml +++ b/crowdin/lang/da-DK/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index 85b83ab528..8a54ca90ef 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanne die isolierten Daten in der QuickShop Datenbank. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern... scanning-async: Scanne die isolierten Daten in der QuickShop Datenbank auf einem Asyncronen Auftrags-Thread. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern. Wenn es schiefgeht, versuch es später erneut. diff --git a/crowdin/lang/el-GR/messages.yml b/crowdin/lang/el-GR/messages.yml index a4ea502723..20b6807c88 100644 --- a/crowdin/lang/el-GR/messages.yml +++ b/crowdin/lang/el-GR/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/en-US/messages.yml b/crowdin/lang/en-US/messages.yml index d7afee2c90..e70c50ede6 100644 --- a/crowdin/lang/en-US/messages.yml +++ b/crowdin/lang/en-US/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/es-ES/messages.yml b/crowdin/lang/es-ES/messages.yml index 4ae00c9fba..78d829b630 100644 --- a/crowdin/lang/es-ES/messages.yml +++ b/crowdin/lang/es-ES/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fa-IR/messages.yml b/crowdin/lang/fa-IR/messages.yml index 3938c2762c..8b46d5ac5e 100644 --- a/crowdin/lang/fa-IR/messages.yml +++ b/crowdin/lang/fa-IR/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/fi-FI/messages.yml b/crowdin/lang/fi-FI/messages.yml index 0a0f5b4685..73bfb90905 100644 --- a/crowdin/lang/fi-FI/messages.yml +++ b/crowdin/lang/fi-FI/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fr-FR/messages.yml b/crowdin/lang/fr-FR/messages.yml index 30de678570..6ff974fd76 100644 --- a/crowdin/lang/fr-FR/messages.yml +++ b/crowdin/lang/fr-FR/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/he-IL/messages.yml b/crowdin/lang/he-IL/messages.yml index 962ded86a1..393ef64cf2 100644 --- a/crowdin/lang/he-IL/messages.yml +++ b/crowdin/lang/he-IL/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hi-IN/messages.yml b/crowdin/lang/hi-IN/messages.yml index 07dee2eb3c..a3308b873d 100644 --- a/crowdin/lang/hi-IN/messages.yml +++ b/crowdin/lang/hi-IN/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hu-HU/messages.yml b/crowdin/lang/hu-HU/messages.yml index ef87c762eb..8acd663a8a 100644 --- a/crowdin/lang/hu-HU/messages.yml +++ b/crowdin/lang/hu-HU/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index 271f3576e8..5571b71d08 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ja-JP/messages.yml b/crowdin/lang/ja-JP/messages.yml index 1d102d57c4..507db5ce1e 100644 --- a/crowdin/lang/ja-JP/messages.yml +++ b/crowdin/lang/ja-JP/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ko-KR/messages.yml b/crowdin/lang/ko-KR/messages.yml index 8678155311..b16e753f07 100644 --- a/crowdin/lang/ko-KR/messages.yml +++ b/crowdin/lang/ko-KR/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/lt-LT/messages.yml b/crowdin/lang/lt-LT/messages.yml index c355a17029..ba7f304cda 100644 --- a/crowdin/lang/lt-LT/messages.yml +++ b/crowdin/lang/lt-LT/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/nl-NL/messages.yml b/crowdin/lang/nl-NL/messages.yml index 89a7de438d..6e51f813d9 100644 --- a/crowdin/lang/nl-NL/messages.yml +++ b/crowdin/lang/nl-NL/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/no-NO/messages.yml b/crowdin/lang/no-NO/messages.yml index 5c4a391fac..41bcf8c90b 100644 --- a/crowdin/lang/no-NO/messages.yml +++ b/crowdin/lang/no-NO/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Skanner de isolerte dataene i QuickShop-databasen. Databasebelastningen kan øke skanneprosessen. Dette kan ta litt tid... scanning-async: Skanner de isolerte dataene i QuickShop-databasen på en asynkron oppgavetråd. Databasebelastningen kan øke skannesprosessen. Dette kan ta litt tid. Hvis det mislykkes, prøv igjen senere. diff --git a/crowdin/lang/pl-PL/messages.yml b/crowdin/lang/pl-PL/messages.yml index b285d3662a..8390681040 100644 --- a/crowdin/lang/pl-PL/messages.yml +++ b/crowdin/lang/pl-PL/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-BR/messages.yml b/crowdin/lang/pt-BR/messages.yml index 15bb3c90e9..f778ed8364 100644 --- a/crowdin/lang/pt-BR/messages.yml +++ b/crowdin/lang/pt-BR/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-PT/messages.yml b/crowdin/lang/pt-PT/messages.yml index 404fa279b2..ed58fef477 100644 --- a/crowdin/lang/pt-PT/messages.yml +++ b/crowdin/lang/pt-PT/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ro-RO/messages.yml b/crowdin/lang/ro-RO/messages.yml index 4432efa3ed..6629555b29 100644 --- a/crowdin/lang/ro-RO/messages.yml +++ b/crowdin/lang/ro-RO/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ru-RU/messages.yml b/crowdin/lang/ru-RU/messages.yml index 5dab3324fa..dc83f42dac 100644 --- a/crowdin/lang/ru-RU/messages.yml +++ b/crowdin/lang/ru-RU/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sr-SP/messages.yml b/crowdin/lang/sr-SP/messages.yml index f1f26e83db..7314cf0207 100644 --- a/crowdin/lang/sr-SP/messages.yml +++ b/crowdin/lang/sr-SP/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sv-SE/messages.yml b/crowdin/lang/sv-SE/messages.yml index 7dede08556..91dee34c5e 100644 --- a/crowdin/lang/sv-SE/messages.yml +++ b/crowdin/lang/sv-SE/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/th-TH/messages.yml b/crowdin/lang/th-TH/messages.yml index 4351b06e53..6ffec97a3e 100644 --- a/crowdin/lang/th-TH/messages.yml +++ b/crowdin/lang/th-TH/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/tr-TR/messages.yml b/crowdin/lang/tr-TR/messages.yml index b75234b1b1..97f99d6e24 100644 --- a/crowdin/lang/tr-TR/messages.yml +++ b/crowdin/lang/tr-TR/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/uk-UA/messages.yml b/crowdin/lang/uk-UA/messages.yml index a506eb5208..924ab49b3b 100644 --- a/crowdin/lang/uk-UA/messages.yml +++ b/crowdin/lang/uk-UA/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/vi-VN/messages.yml b/crowdin/lang/vi-VN/messages.yml index 8a7009cf10..cda81bcd53 100644 --- a/crowdin/lang/vi-VN/messages.yml +++ b/crowdin/lang/vi-VN/messages.yml @@ -621,7 +621,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-CN/messages.yml b/crowdin/lang/zh-CN/messages.yml index 1c3c7b5672..7f672ce756 100644 --- a/crowdin/lang/zh-CN/messages.yml +++ b/crowdin/lang/zh-CN/messages.yml @@ -631,7 +631,7 @@ debug: property-security-block: "请求被拒绝,出于安全原因,您只能更改启动脚本 com.ghostchu.quickshopquickshop 的属性。" property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: 正在 QuickShop 数据库中扫描孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间... scanning-async: 正在异步任务线程上扫描 QuickShop 数据库中孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间,请稍后再试。 diff --git a/crowdin/lang/zh-HK/messages.yml b/crowdin/lang/zh-HK/messages.yml index 7139f63248..3e56681203 100644 --- a/crowdin/lang/zh-HK/messages.yml +++ b/crowdin/lang/zh-HK/messages.yml @@ -634,7 +634,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 97af189c4d..03fa66716b 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -633,7 +633,7 @@ debug: property-security-block: "Request was rejected, for security reason, you can only change the property that startsWith com.ghostchu.quickshop or quickshop." property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" - marked-as-dirty: "Marked all founded stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" database: scanning: 正在掃描 QuickShop 資料庫中的孤立資料,在掃描過程中資料庫負載可能會增加,且這可能需要等候一段時間…… scanning-async: 正在掃描異步任務線程上 QuickShop 資料庫中的孤立資料,掃描過程中資料庫負載可能會增加,這可能需要等候一段時間,請稍後再試。 From 6eefc355efc29a785931576dc2ab1420db778198 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 18:24:51 +0800 Subject: [PATCH 57/81] Allow operator remove exists displays via debug command --- .../command/subcommand/SubCommand_Debug.java | 69 +++++++++++++------ .../src/main/resources/lang/messages.yml | 1 + 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index 8e9d3fab01..7dde0c79eb 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -11,6 +11,7 @@ import com.ghostchu.quickshop.common.util.QuickExecutor; import com.ghostchu.quickshop.shop.SimpleShopManager; import com.ghostchu.quickshop.shop.cache.SimpleShopCache; +import com.ghostchu.quickshop.shop.display.AbstractDisplayItem; import com.ghostchu.quickshop.util.MsgUtil; import com.ghostchu.quickshop.util.Util; import com.ghostchu.quickshop.util.performance.BatchBukkitExecutor; @@ -19,8 +20,13 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.World; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Item; +import org.bukkit.entity.ItemDisplay; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.plugin.RegisteredListener; @@ -46,10 +52,10 @@ public class SubCommand_Debug implements CommandHandler { public SubCommand_Debug(QuickShop plugin) { this.plugin = plugin; - subParamMapping.put("debug", (sender,subParams)->switchDebug(sender)); - subParamMapping.put("dev", (sender,subParams)->switchDebug(sender)); - subParamMapping.put("devmode", (sender,subParams)->switchDebug(sender)); - subParamMapping.put("signs", (sender,subParams)->handleSigns(sender)); + subParamMapping.put("debug", (sender, subParams) -> switchDebug(sender)); + subParamMapping.put("dev", (sender, subParams) -> switchDebug(sender)); + subParamMapping.put("devmode", (sender, subParams) -> switchDebug(sender)); + subParamMapping.put("signs", (sender, subParams) -> handleSigns(sender)); subParamMapping.put("database", this::handleDatabase); subParamMapping.put("updateplayersigns", this::handleSignsUpdate); subParamMapping.put("force-shops-reload", this::handleShopsReload); @@ -68,6 +74,27 @@ public SubCommand_Debug(QuickShop plugin) { subParamMapping.put("set-hikaricp-capacity", this::handleSetHikariCPCapacity); subParamMapping.put("item-info", this::handleItemInfo); subParamMapping.put("mark-all-shops-dirty", this::handleShopsDirtyAndSave); + subParamMapping.put("clean-display-entities", this::handleDisplayEntities); + } + + private void handleDisplayEntities(CommandSender sender, List strings) { + List entities = new ArrayList<>(); + for (World world : Bukkit.getWorlds()) { + for (Entity entity : world.getEntities()) { + if (entity instanceof Item itemEntity) { + if (AbstractDisplayItem.checkIsGuardItemStack(itemEntity.getItemStack())) { + entities.add(entity); + } + } + if (entity instanceof ItemDisplay itemDisplay) { + if (AbstractDisplayItem.checkIsGuardItemStack(itemDisplay.getItemStack())) { + entities.add(entity); + } + } + } + } + entities.forEach(Entity::remove); + plugin.text().of(sender, "debug.display-removed", entities.size()).send(); } @Override @@ -80,8 +107,8 @@ public void onCommand(@NotNull CommandSender sender, @NotNull String commandLabe subParams.remove(0); String arg = parser.getArgs().get(0); - BiConsumer> executor = subParamMapping.get(arg); - if(executor == null){ + BiConsumer> executor = subParamMapping.get(arg); + if (executor == null) { plugin.text().of(sender, "debug.arguments-invalid", parser.getArgs().get(0)).send(); return; } @@ -115,29 +142,31 @@ private void handleSetHikariCPCapacity(CommandSender sender, List subPar HikariDataSource hikariDataSource = (HikariDataSource) plugin.getSqlManager().getDataSource(); hikariDataSource.setMaximumPoolSize(size); hikariDataSource.setMinimumIdle(size); - plugin.text().of(sender, "debug.hikari-cp-size-tweak",size).send();; + plugin.text().of(sender, "debug.hikari-cp-size-tweak", size).send(); + ; } private void handleDbConnectionTest(CommandSender sender, List subParams) { - plugin.text().of(sender,"debug.hikari-cp-testing").send(); + plugin.text().of(sender, "debug.hikari-cp-testing").send(); try { CompletableFuture.supplyAsync(() -> { try (Connection connection = plugin.getSqlManager().getConnection()) { if (connection.isValid(1000)) { - plugin.text().of(sender, "debug.hikari-cp-working").send();; + plugin.text().of(sender, "debug.hikari-cp-working").send(); + ; } else { - plugin.text().of(sender,"debug.hikari-cp-not-working"); + plugin.text().of(sender, "debug.hikari-cp-not-working"); } } catch (SQLException e) { - plugin.text().of(sender,"internal-error").send(); + plugin.text().of(sender, "internal-error").send(); e.printStackTrace(); } return null; }).get(5, TimeUnit.SECONDS); } catch (TimeoutException e) { - plugin.text().of(sender,"debug.hikari-cp-timeout").send(); + plugin.text().of(sender, "debug.hikari-cp-timeout").send(); } catch (ExecutionException | InterruptedException e) { - plugin.text().of(sender,"internal-error").send(); + plugin.text().of(sender, "internal-error").send(); e.printStackTrace(); } } @@ -147,7 +176,7 @@ private void handleStopDbQueries(CommandSender sender, List subParams) { s.close(); return null; }).count(); - plugin.text().of(sender,"debug.queries-stopped", stopped).send(); + plugin.text().of(sender, "debug.queries-stopped", stopped).send(); } private void handleDumpHikariCPStatus(CommandSender sender, List subParams) { @@ -181,19 +210,19 @@ private void handleToggleDbDebugMode(CommandSender sender, List subParam } private void handleDumpDbConnections(CommandSender sender, List subParams) { - plugin.text().of(sender,"debug.queries-dumping").send(); + plugin.text().of(sender, "debug.queries-dumping").send(); for (Map.Entry e : plugin.getSqlManager().getActiveQuery().entrySet()) { sender.sendMessage(e.getKey().toString() + ": " + e.getValue()); } } private void handleDbManagerReset(CommandSender sender, List subParams) { - plugin.text().of(sender,"debug.restart-database-manager").send(); + plugin.text().of(sender, "debug.restart-database-manager").send(); EasySQL.shutdownManager(this.plugin.getSqlManager()); plugin.text().of(sender, "debug.restart-database-manager-clear-executors").send(); QuickExecutor.getHikaricpExecutor().shutdownNow().forEach(r -> plugin.text().of(sender, "debug.restart-database-manager-unfinished-task", r).send()); QuickExecutor.setHikaricpExecutor(QuickExecutor.provideHikariCPExecutor()); - QuickExecutor.getShopHistoryQueryExecutor().shutdownNow().forEach(r -> plugin.text().of(sender,"debug.restart-database-manager-unfinished-task-history-query",r).send()); + QuickExecutor.getShopHistoryQueryExecutor().shutdownNow().forEach(r -> plugin.text().of(sender, "debug.restart-database-manager-unfinished-task-history-query", r).send()); QuickExecutor.setShopHistoryQueryExecutor(QuickExecutor.provideShopHistoryQueryExecutor()); plugin.text().of(sender, "debug.restart-database-manager-reconnect").send(); Util.asyncThreadRun(plugin::setupDatabase); @@ -232,10 +261,10 @@ private void handleProperty(CommandSender sender, List subParams) { } if (value == null) { System.clearProperty(key); - plugin.text().of(sender, "debug.property-removed",key).send(); + plugin.text().of(sender, "debug.property-removed", key).send(); } else { String oldOne = System.setProperty(key, value); - plugin.text().of(sender, "debug.property-changed",key,oldOne,value).send(); + plugin.text().of(sender, "debug.property-changed", key, oldOne, value).send(); sender.sendMessage("Property " + key + " has been changed from " + oldOne + " to " + value); } } @@ -390,7 +419,7 @@ public void printHandlerList(@NotNull CommandSender sender, String event) { @Override public List onTabComplete( @NotNull CommandSender sender, @NotNull String commandLabel, @NotNull CommandParser parser) { - if(parser.getArgs().size() == 1){ + if (parser.getArgs().size() == 1) { return List.copyOf(subParamMapping.keySet()); } return Collections.emptyList(); diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 15e60589ed..4e9b20ef5c 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -776,6 +776,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... From 1471d3da98ae08478ae9dbd77ce500e4e1756290 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 18:25:14 +0800 Subject: [PATCH 58/81] Look game version instance via Minecraft version when NMS version not available --- .../ghostchu/quickshop/api/GameVersion.java | 59 ++++++------------- .../com/ghostchu/quickshop/QuickShop.java | 3 + .../util/envcheck/EnvironmentChecker.java | 18 ++---- .../util/paste/item/ServerInfoItem.java | 2 +- 4 files changed, 28 insertions(+), 54 deletions(-) diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java index 1441e43195..a2b5cd8fec 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java @@ -3,6 +3,8 @@ import lombok.Getter; import org.jetbrains.annotations.NotNull; +import java.util.Arrays; + /** * Utilities to help QuickShop quickly check server supported features * @@ -10,46 +12,17 @@ */ @Getter public enum GameVersion { - v1_5_R1(false, true, false, false), - v1_5_R2(false, true, false, false), - v1_5_R3(false, true, false, false), - v1_6_R1(false, true, false, false), - v1_6_R2(false, true, false, false), - v1_6_R3(false, true, false, false), - v1_7_R1(false, true, false, false), - v1_7_R2(false, true, false, false), - v1_7_R3(false, true, false, false), - v1_7_R4(false, true, false, false), - v1_8_R1(false, true, false, false), - v1_8_R2(false, true, false, false), - v1_8_R3(false, true, false, false), - v1_9_R1(false, true, false, false), - v1_9_R2(false, true, false, false), - v1_10_R1(false, true, false, false), - v1_11_R1(false, true, false, false), - v1_12_R1(false, true, false, false), - v1_12_R2(false, true, false, false), - v1_13_R1(false, true, false, false), - v1_13_R2(false, true, false, false), - v1_14_R1(false, true, false, false), - v1_14_R2(false, true, false, false), - v1_15_R1(false, true, false, false), - v1_15_R2(false, true, false, false), - v1_16_R1(false, true, false, false), - v1_16_R2(false, true, false, false), - v1_16_R3(false, true, false, false), - v1_16_R4(false, true, false, false), - v1_17_R1(false, true, false, true), - v1_18_R1(false, true, false, true), - v1_18_R2(true, true, true, true), - v1_19_R1(true, true, true, true), - v1_19_R2(true, true, true, true), - v1_19_R3(true, true, true, true), - v1_20_R1(true, true, true, true), - v1_20_R2(true, false, true, true), - v1_20_R3(true, false, true, true), - v1_20_R4(true, false, false, true), - UNKNOWN(true, false, false, true); + v1_18_R1(new String[]{"1.18", "1.18.1"}, false, true, false, true), + v1_18_R2(new String[]{"1.18.2"}, true, true, true, true), + v1_19_R1(new String[]{"1.19", "1.19.1"}, true, true, true, true), + v1_19_R2(new String[]{"1.19.2"}, true, true, true, true), + v1_19_R3(new String[]{"1.19.3", "1.19.4"}, true, true, true, true), + v1_20_R1(new String[]{"1.20", "1.20.1"}, true, true, true, true), + v1_20_R2(new String[]{"1.20.2", "1.20.3"}, true, false, true, true), + v1_20_R3(new String[]{"1.20.4", "1.20.5"}, true, false, true, true), + v1_20_R4(new String[]{"1.20.6"}, true, false, true, true), + UNKNOWN(new String[0], true, false, false, true); + private final String[] mcVersion; /** * CoreSupports - Check does QuickShop most features supports this server version */ @@ -70,7 +43,8 @@ public enum GameVersion { */ private final boolean newNmsName; - GameVersion(boolean coreSupports, boolean endOfLife, boolean virtualDisplaySupports, boolean newNmsName) { + GameVersion(String[] mcVersion, boolean coreSupports, boolean endOfLife, boolean virtualDisplaySupports, boolean newNmsName) { + this.mcVersion = mcVersion; this.coreSupports = coreSupports; this.endOfLife = endOfLife; this.virtualDisplaySupports = virtualDisplaySupports; @@ -90,6 +64,9 @@ public static GameVersion get(@NotNull String nmsVersion) { if (version.name().equals(nmsVersion)) { return version; } + if(Arrays.asList(version.mcVersion).contains(nmsVersion)){ + return version; + } } return UNKNOWN; } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java index 2dfcc350b0..135315f69b 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java @@ -476,6 +476,9 @@ public DatabaseHelper getDatabaseHelper() { public GameVersion getGameVersion() { if (gameVersion == null) { gameVersion = GameVersion.get(ReflectFactory.getNMSVersion()); + if(gameVersion == GameVersion.UNKNOWN) { + gameVersion = GameVersion.get(platform.getMinecraftVersion()); + } } return this.gameVersion; } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java index 63572955af..df59ebe053 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/envcheck/EnvironmentChecker.java @@ -59,13 +59,11 @@ public void registerTest(@NotNull Method method) { @EnvCheckEntry(name = "CoreSupport Test", priority = 6) public ResultContainer coreSupportTest() { - String nmsVersion = ReflectFactory.getNMSVersion(); - GameVersion gameVersion = GameVersion.get(nmsVersion); - if (!gameVersion.isCoreSupports()) { - return new ResultContainer(CheckResult.STOP_WORKING, "Your Minecraft version is no longer supported: " + plugin.getPlatform().getMinecraftVersion() + " (" + nmsVersion + ")"); + if (!plugin.getGameVersion().isCoreSupports()) { + return new ResultContainer(CheckResult.STOP_WORKING, "Your Minecraft version is no longer supported: " + plugin.getPlatform().getMinecraftVersion() + " (" + ReflectFactory.getNMSVersion() + ")"); } - if (gameVersion == GameVersion.UNKNOWN) { - return new ResultContainer(CheckResult.WARNING, "QuickShop may not fully support version " + nmsVersion + "/" + plugin.getPlatform().getMinecraftVersion() + ", Some features may not work."); + if (plugin.getGameVersion() == GameVersion.UNKNOWN) { + return new ResultContainer(CheckResult.WARNING, "QuickShop may not fully support version " + ReflectFactory.getNMSVersion() + "/" + plugin.getPlatform().getMinecraftVersion() + ", Some features may not work."); } return new ResultContainer(CheckResult.PASSED, CHECK_PASSED_RETURNS); } @@ -80,9 +78,7 @@ public ResultContainer eolTest() { @EnvCheckEntry(name = "GameVersion supporting Test", priority = 9) public ResultContainer gamerVersionSupportTest() { - String nmsVersion = ReflectFactory.getNMSVersion(); - GameVersion gameVersion = GameVersion.get(nmsVersion); - if (gameVersion == GameVersion.UNKNOWN) { + if (plugin.getGameVersion() == GameVersion.UNKNOWN) { return new ResultContainer(CheckResult.WARNING, "Your Minecraft server version not tested by developers, QuickShop may ran into issues on this version."); } return new ResultContainer(CheckResult.PASSED, CHECK_PASSED_RETURNS); @@ -335,15 +331,13 @@ public ResultContainer spigotBasedServer() { @EnvCheckEntry(name = "Virtual DisplayItem Support Test", priority = 7, stage = EnvCheckEntry.Stage.ON_ENABLE) public ResultContainer virtualDisplaySupportTest() { - String nmsVersion = ReflectFactory.getNMSVersion(); - GameVersion gameVersion = GameVersion.get(nmsVersion); if (!plugin.isDisplayEnabled()) { return new ResultContainer(CheckResult.PASSED, "The display are disabled."); } if (AbstractDisplayItem.getNowUsing() != DisplayType.VIRTUALITEM) { return new ResultContainer(CheckResult.PASSED, "The display type is not virtual item."); } - if (!gameVersion.isVirtualDisplaySupports()) { + if (!plugin.getGameVersion().isVirtualDisplaySupports()) { AbstractDisplayItem.setVirtualDisplayDoesntWork(true); return new ResultContainer(CheckResult.WARNING, "Your server version are not supports Virtual DisplayItem, resetting to RealDisplayItem..."); } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/paste/item/ServerInfoItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/paste/item/ServerInfoItem.java index 7d62caea7a..7a4cca6329 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/paste/item/ServerInfoItem.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/paste/item/ServerInfoItem.java @@ -25,7 +25,7 @@ public ServerInfoItem() { QuickShop plugin = QuickShop.getInstance(); this.serverName = Bukkit.getServer().getName(); this.build = Bukkit.getServer().getVersion(); - this.nmsVersion = ReflectFactory.getNMSVersion(); + this.nmsVersion = ReflectFactory.getNMSVersion()+"/"+plugin.getPlatform().getMinecraftVersion(); this.dataVersion = String.valueOf(Bukkit.getServer().getUnsafe().getDataVersion()); this.moddedServerType = "Bukkit"; if (PaperLib.isSpigot()) { From b738cfd7cc85b9402bfb98637cad19b32d0db2a9 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 18:30:08 +0800 Subject: [PATCH 59/81] Disable VDS on 1.20.6 due ProtocolLib not available yet --- .../src/main/java/com/ghostchu/quickshop/api/GameVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java index a2b5cd8fec..6b116af1d6 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java @@ -20,7 +20,7 @@ public enum GameVersion { v1_20_R1(new String[]{"1.20", "1.20.1"}, true, true, true, true), v1_20_R2(new String[]{"1.20.2", "1.20.3"}, true, false, true, true), v1_20_R3(new String[]{"1.20.4", "1.20.5"}, true, false, true, true), - v1_20_R4(new String[]{"1.20.6"}, true, false, true, true), + v1_20_R4(new String[]{"1.20.6"}, true, false, false, true), UNKNOWN(new String[0], true, false, false, true); private final String[] mcVersion; /** From c8c7a3415fa7f13e57ba3881b77f38894e711354 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Tue, 14 May 2024 18:35:49 +0800 Subject: [PATCH 60/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/af-ZA/messages.yml | 1 + crowdin/lang/ar-SA/messages.yml | 1 + crowdin/lang/bg-BG/messages.yml | 1 + crowdin/lang/ca-ES/messages.yml | 1 + crowdin/lang/cs-CZ/messages.yml | 1 + crowdin/lang/da-DK/messages.yml | 1 + crowdin/lang/de-DE/messages.yml | 1 + crowdin/lang/el-GR/messages.yml | 1 + crowdin/lang/en-US/messages.yml | 1 + crowdin/lang/es-ES/messages.yml | 1 + crowdin/lang/fa-IR/messages.yml | 1 + crowdin/lang/fi-FI/messages.yml | 1 + crowdin/lang/fr-FR/messages.yml | 1 + crowdin/lang/he-IL/messages.yml | 1 + crowdin/lang/hi-IN/messages.yml | 1 + crowdin/lang/hu-HU/messages.yml | 1 + crowdin/lang/it-IT/messages.yml | 1 + crowdin/lang/ja-JP/messages.yml | 1 + crowdin/lang/ko-KR/messages.yml | 1 + crowdin/lang/lt-LT/messages.yml | 1 + crowdin/lang/nl-NL/messages.yml | 1 + crowdin/lang/no-NO/messages.yml | 1 + crowdin/lang/pl-PL/messages.yml | 1 + crowdin/lang/pt-BR/messages.yml | 1 + crowdin/lang/pt-PT/messages.yml | 1 + crowdin/lang/ro-RO/messages.yml | 1 + crowdin/lang/ru-RU/messages.yml | 1 + crowdin/lang/sr-SP/messages.yml | 1 + crowdin/lang/sv-SE/messages.yml | 1 + crowdin/lang/th-TH/messages.yml | 1 + crowdin/lang/tr-TR/messages.yml | 1 + crowdin/lang/uk-UA/messages.yml | 1 + crowdin/lang/vi-VN/messages.yml | 1 + crowdin/lang/zh-CN/messages.yml | 1 + crowdin/lang/zh-HK/messages.yml | 1 + crowdin/lang/zh-TW/messages.yml | 1 + 36 files changed, 36 insertions(+) diff --git a/crowdin/lang/af-ZA/messages.yml b/crowdin/lang/af-ZA/messages.yml index cbe617741c..6cef467e7c 100644 --- a/crowdin/lang/af-ZA/messages.yml +++ b/crowdin/lang/af-ZA/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ar-SA/messages.yml b/crowdin/lang/ar-SA/messages.yml index 5ec108f0fc..a09253938e 100644 --- a/crowdin/lang/ar-SA/messages.yml +++ b/crowdin/lang/ar-SA/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/bg-BG/messages.yml b/crowdin/lang/bg-BG/messages.yml index 98f3a89e9b..fd424c1be9 100644 --- a/crowdin/lang/bg-BG/messages.yml +++ b/crowdin/lang/bg-BG/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ca-ES/messages.yml b/crowdin/lang/ca-ES/messages.yml index f157a9b194..ff9125be97 100644 --- a/crowdin/lang/ca-ES/messages.yml +++ b/crowdin/lang/ca-ES/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/cs-CZ/messages.yml b/crowdin/lang/cs-CZ/messages.yml index a961a6bee6..a284ac8439 100644 --- a/crowdin/lang/cs-CZ/messages.yml +++ b/crowdin/lang/cs-CZ/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/da-DK/messages.yml b/crowdin/lang/da-DK/messages.yml index e0741ec338..65a30003a5 100644 --- a/crowdin/lang/da-DK/messages.yml +++ b/crowdin/lang/da-DK/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index 8a54ca90ef..a99b632c58 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanne die isolierten Daten in der QuickShop Datenbank. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern... scanning-async: Scanne die isolierten Daten in der QuickShop Datenbank auf einem Asyncronen Auftrags-Thread. Die Datenbankauslastung kann eventuell den Scanvorgang ehöhen. Dies kann eine Weile dauern. Wenn es schiefgeht, versuch es später erneut. diff --git a/crowdin/lang/el-GR/messages.yml b/crowdin/lang/el-GR/messages.yml index 20b6807c88..12242ecf5c 100644 --- a/crowdin/lang/el-GR/messages.yml +++ b/crowdin/lang/el-GR/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/en-US/messages.yml b/crowdin/lang/en-US/messages.yml index e70c50ede6..a98b42a5ca 100644 --- a/crowdin/lang/en-US/messages.yml +++ b/crowdin/lang/en-US/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/es-ES/messages.yml b/crowdin/lang/es-ES/messages.yml index 78d829b630..28e83f62f0 100644 --- a/crowdin/lang/es-ES/messages.yml +++ b/crowdin/lang/es-ES/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fa-IR/messages.yml b/crowdin/lang/fa-IR/messages.yml index 8b46d5ac5e..bc0b576489 100644 --- a/crowdin/lang/fa-IR/messages.yml +++ b/crowdin/lang/fa-IR/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in the QuickShop Database. The database load may increase the scanning progress. This may take a while... scanning-async: Scanning the isolated data in the QuickShop Database on an async Task-Thread. The database load may increase the scanning progress. This may take a while. If it fails, try again later. diff --git a/crowdin/lang/fi-FI/messages.yml b/crowdin/lang/fi-FI/messages.yml index 73bfb90905..383d0f59b1 100644 --- a/crowdin/lang/fi-FI/messages.yml +++ b/crowdin/lang/fi-FI/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/fr-FR/messages.yml b/crowdin/lang/fr-FR/messages.yml index 6ff974fd76..10e6c36b38 100644 --- a/crowdin/lang/fr-FR/messages.yml +++ b/crowdin/lang/fr-FR/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/he-IL/messages.yml b/crowdin/lang/he-IL/messages.yml index 393ef64cf2..1ca38b28b2 100644 --- a/crowdin/lang/he-IL/messages.yml +++ b/crowdin/lang/he-IL/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hi-IN/messages.yml b/crowdin/lang/hi-IN/messages.yml index a3308b873d..008e316b99 100644 --- a/crowdin/lang/hi-IN/messages.yml +++ b/crowdin/lang/hi-IN/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/hu-HU/messages.yml b/crowdin/lang/hu-HU/messages.yml index 8acd663a8a..3f73d2dbef 100644 --- a/crowdin/lang/hu-HU/messages.yml +++ b/crowdin/lang/hu-HU/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index 5571b71d08..3cb05882d5 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ja-JP/messages.yml b/crowdin/lang/ja-JP/messages.yml index 507db5ce1e..a1c3950565 100644 --- a/crowdin/lang/ja-JP/messages.yml +++ b/crowdin/lang/ja-JP/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ko-KR/messages.yml b/crowdin/lang/ko-KR/messages.yml index b16e753f07..769e1b3913 100644 --- a/crowdin/lang/ko-KR/messages.yml +++ b/crowdin/lang/ko-KR/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/lt-LT/messages.yml b/crowdin/lang/lt-LT/messages.yml index ba7f304cda..ed0c0012b0 100644 --- a/crowdin/lang/lt-LT/messages.yml +++ b/crowdin/lang/lt-LT/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/nl-NL/messages.yml b/crowdin/lang/nl-NL/messages.yml index 6e51f813d9..c672c94e57 100644 --- a/crowdin/lang/nl-NL/messages.yml +++ b/crowdin/lang/nl-NL/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/no-NO/messages.yml b/crowdin/lang/no-NO/messages.yml index 41bcf8c90b..c267df140b 100644 --- a/crowdin/lang/no-NO/messages.yml +++ b/crowdin/lang/no-NO/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Skanner de isolerte dataene i QuickShop-databasen. Databasebelastningen kan øke skanneprosessen. Dette kan ta litt tid... scanning-async: Skanner de isolerte dataene i QuickShop-databasen på en asynkron oppgavetråd. Databasebelastningen kan øke skannesprosessen. Dette kan ta litt tid. Hvis det mislykkes, prøv igjen senere. diff --git a/crowdin/lang/pl-PL/messages.yml b/crowdin/lang/pl-PL/messages.yml index 8390681040..ca3f65d406 100644 --- a/crowdin/lang/pl-PL/messages.yml +++ b/crowdin/lang/pl-PL/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-BR/messages.yml b/crowdin/lang/pt-BR/messages.yml index f778ed8364..f61a8a1c5d 100644 --- a/crowdin/lang/pt-BR/messages.yml +++ b/crowdin/lang/pt-BR/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/pt-PT/messages.yml b/crowdin/lang/pt-PT/messages.yml index ed58fef477..aeeac8afc7 100644 --- a/crowdin/lang/pt-PT/messages.yml +++ b/crowdin/lang/pt-PT/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Verificando os dados isolados nos bancos de dados QuickShop, o carregamento do banco de dados pode aumentar em progresso de verificação, isso pode demorar um pouco... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ro-RO/messages.yml b/crowdin/lang/ro-RO/messages.yml index 6629555b29..649b41f93d 100644 --- a/crowdin/lang/ro-RO/messages.yml +++ b/crowdin/lang/ro-RO/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/ru-RU/messages.yml b/crowdin/lang/ru-RU/messages.yml index dc83f42dac..2d570981ca 100644 --- a/crowdin/lang/ru-RU/messages.yml +++ b/crowdin/lang/ru-RU/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sr-SP/messages.yml b/crowdin/lang/sr-SP/messages.yml index 7314cf0207..dee8dd8fcd 100644 --- a/crowdin/lang/sr-SP/messages.yml +++ b/crowdin/lang/sr-SP/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/sv-SE/messages.yml b/crowdin/lang/sv-SE/messages.yml index 91dee34c5e..cca17024e5 100644 --- a/crowdin/lang/sv-SE/messages.yml +++ b/crowdin/lang/sv-SE/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/th-TH/messages.yml b/crowdin/lang/th-TH/messages.yml index 6ffec97a3e..6b4d05ed40 100644 --- a/crowdin/lang/th-TH/messages.yml +++ b/crowdin/lang/th-TH/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/tr-TR/messages.yml b/crowdin/lang/tr-TR/messages.yml index 97f99d6e24..d34afdcfbf 100644 --- a/crowdin/lang/tr-TR/messages.yml +++ b/crowdin/lang/tr-TR/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/uk-UA/messages.yml b/crowdin/lang/uk-UA/messages.yml index 924ab49b3b..297634a70c 100644 --- a/crowdin/lang/uk-UA/messages.yml +++ b/crowdin/lang/uk-UA/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/vi-VN/messages.yml b/crowdin/lang/vi-VN/messages.yml index cda81bcd53..43460d60fe 100644 --- a/crowdin/lang/vi-VN/messages.yml +++ b/crowdin/lang/vi-VN/messages.yml @@ -622,6 +622,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-CN/messages.yml b/crowdin/lang/zh-CN/messages.yml index 7f672ce756..71b31ba860 100644 --- a/crowdin/lang/zh-CN/messages.yml +++ b/crowdin/lang/zh-CN/messages.yml @@ -632,6 +632,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: 正在 QuickShop 数据库中扫描孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间... scanning-async: 正在异步任务线程上扫描 QuickShop 数据库中孤立的数据,扫描过程中数据库负载可能会增加,这可能需要一段时间,请稍后再试。 diff --git a/crowdin/lang/zh-HK/messages.yml b/crowdin/lang/zh-HK/messages.yml index 3e56681203..025dafbb36 100644 --- a/crowdin/lang/zh-HK/messages.yml +++ b/crowdin/lang/zh-HK/messages.yml @@ -635,6 +635,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: Scanning the isolated data in QuickShop databases, the database load may increase in scan progress, this might need a while... scanning-async: Scanning the isolated data in QuickShop databases on async task thread, the database load may increase in scan progress, this might need a while, try again later. diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 03fa66716b..2acf40a9c3 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -634,6 +634,7 @@ debug: property-removed: "Removed property key {0}" property-changed: "Property key {0} was changed from {1} to {2}" marked-as-dirty: "Marked all stores as dirty status, they will be force save in next auto-save task. (Restart the server to force execute store saving task)" + display-removed: "Successfully removed {0} QuickShop display items/entities from the worlds." database: scanning: 正在掃描 QuickShop 資料庫中的孤立資料,在掃描過程中資料庫負載可能會增加,且這可能需要等候一段時間…… scanning-async: 正在掃描異步任務線程上 QuickShop 資料庫中的孤立資料,掃描過程中資料庫負載可能會增加,這可能需要等候一段時間,請稍後再試。 From b08a0145701bdfdfd8b8a382be325e8a6c4551a5 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 18:44:11 +0800 Subject: [PATCH 61/81] clean up --- .../java/com/ghostchu/quickshop/util/updater/NexusManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java index f10a1e8603..eccf1c2806 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/updater/NexusManager.java @@ -79,7 +79,7 @@ private void updateCacheIfRequired() { } @Nullable - public NexusMetadata fetchMetadata() { + private NexusMetadata fetchMetadata() { try { HttpResponse resp = Unirest.get(NEXUS_ROOT_METADATA_URL).asString(); if (!resp.isSuccess()) { From e84a290ce8f7ae5356e8db6ef63f17d5841d7fff Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 21:19:08 +0800 Subject: [PATCH 62/81] Fix double-chest sometimes only can detect half of contents --- .../migratecomponent/ShopMigrate.java | 3 +- .../ghostchu/quickshop/api/GameVersion.java | 25 +- .../com/ghostchu/quickshop/QuickShop.java | 9 +- .../command/subcommand/SubCommand_Debug.java | 24 +- .../quickshop/shop/ContainerShop.java | 90 ++++--- .../quickshop/shop/SimpleShopManager.java | 127 ++++++--- .../inventory/BukkitInventoryWrapper.java | 9 + .../BukkitInventoryWrapperManager.java | 18 +- ...BukkitListenerDrivenInventoryListener.java | 30 +-- .../BukkitListenerDrivenInventoryWrapper.java | 250 +++++++++--------- .../InventoryWrapperUpdateManager.java | 150 +++++------ 11 files changed, 401 insertions(+), 334 deletions(-) diff --git a/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java b/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java index ef80889234..4f23477548 100644 --- a/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java +++ b/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java @@ -9,6 +9,7 @@ import com.ghostchu.quickshop.economy.SimpleBenefit; import com.ghostchu.quickshop.obj.QUserImpl; import com.ghostchu.quickshop.shop.ContainerShop; +import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapper; import com.ghostchu.quickshop.shop.inventory.BukkitListenerDrivenInventoryWrapper; import com.ghostchu.quickshop.util.ProgressMonitor; import com.ghostchu.quickshop.util.performance.BatchBukkitExecutor; @@ -83,7 +84,7 @@ public boolean migrate() { reremakeShop.isDisableDisplay(), reremakeShop.getTaxAccountActual() == null ? null : QUserImpl.createSync(getHikari().getPlayerFinder(), reremakeShop.getTaxAccountActual()), getHikari().getJavaPlugin().getName(), - getHikari().getInventoryWrapperManager().mklink(new BukkitListenerDrivenInventoryWrapper(container.getInventory(), block.getLocation())), + getHikari().getInventoryWrapperManager().mklink(new BukkitInventoryWrapper(container.getInventory())), null, Collections.emptyMap(), new SimpleBenefit() diff --git a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java index 6b116af1d6..4c5383afaf 100644 --- a/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java +++ b/quickshop-api/src/main/java/com/ghostchu/quickshop/api/GameVersion.java @@ -12,16 +12,16 @@ */ @Getter public enum GameVersion { - v1_18_R1(new String[]{"1.18", "1.18.1"}, false, true, false, true), - v1_18_R2(new String[]{"1.18.2"}, true, true, true, true), - v1_19_R1(new String[]{"1.19", "1.19.1"}, true, true, true, true), - v1_19_R2(new String[]{"1.19.2"}, true, true, true, true), - v1_19_R3(new String[]{"1.19.3", "1.19.4"}, true, true, true, true), - v1_20_R1(new String[]{"1.20", "1.20.1"}, true, true, true, true), - v1_20_R2(new String[]{"1.20.2", "1.20.3"}, true, false, true, true), - v1_20_R3(new String[]{"1.20.4", "1.20.5"}, true, false, true, true), - v1_20_R4(new String[]{"1.20.6"}, true, false, false, true), - UNKNOWN(new String[0], true, false, false, true); + v1_18_R1(new String[]{"1.18", "1.18.1"}, false, true, false, true,false), + v1_18_R2(new String[]{"1.18.2"}, true, true, true, true,false), + v1_19_R1(new String[]{"1.19", "1.19.1"}, true, true, true, true,false), + v1_19_R2(new String[]{"1.19.2"}, true, true, true, true,false), + v1_19_R3(new String[]{"1.19.3", "1.19.4"}, true, true, true, true,false), + v1_20_R1(new String[]{"1.20", "1.20.1"}, true, true, true, true,false), + v1_20_R2(new String[]{"1.20.2", "1.20.3"}, true, false, true, true,false), + v1_20_R3(new String[]{"1.20.4", "1.20.5"}, true, false, true, true,false), + v1_20_R4(new String[]{"1.20.6"}, true, false, false, true,true), + UNKNOWN(new String[0], true, false, false, true, true); private final String[] mcVersion; /** * CoreSupports - Check does QuickShop most features supports this server version @@ -43,12 +43,15 @@ public enum GameVersion { */ private final boolean newNmsName; - GameVersion(String[] mcVersion, boolean coreSupports, boolean endOfLife, boolean virtualDisplaySupports, boolean newNmsName) { + private final boolean newPotionAPI; + + GameVersion(String[] mcVersion, boolean coreSupports, boolean endOfLife, boolean virtualDisplaySupports, boolean newNmsName, boolean newPotionAPI) { this.mcVersion = mcVersion; this.coreSupports = coreSupports; this.endOfLife = endOfLife; this.virtualDisplaySupports = virtualDisplaySupports; this.newNmsName = newNmsName; + this.newPotionAPI = newPotionAPI; } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java index 135315f69b..3d48f9e647 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java @@ -49,7 +49,6 @@ import com.ghostchu.quickshop.shop.display.AbstractDisplayItem; import com.ghostchu.quickshop.shop.display.virtual.VirtualDisplayItemManager; import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapperManager; -import com.ghostchu.quickshop.shop.inventory.InventoryWrapperUpdateManager; import com.ghostchu.quickshop.shop.signhooker.SignHooker; import com.ghostchu.quickshop.util.*; import com.ghostchu.quickshop.util.config.ConfigUpdateScript; @@ -247,8 +246,8 @@ public class QuickShop implements QuickShopAPI, Reloadable { @Getter private RegistryManager registry; private DonationInfo donationInfo; - @Getter - private InventoryWrapperUpdateManager invWrapperUpdateManager; +// @Getter +// private InventoryWrapperUpdateManager invWrapperUpdateManager; public QuickShop(QuickShopBukkit javaPlugin, Logger logger, Platform platform) { this.javaPlugin = javaPlugin; @@ -618,8 +617,8 @@ public final void onEnable() { logger.info("Registering commands..."); this.permissionChecker = new PermissionChecker(this); loadCommandHandler(); - this.invWrapperUpdateManager = new InventoryWrapperUpdateManager(this); - this.invWrapperUpdateManager.register(); +// this.invWrapperUpdateManager = new InventoryWrapperUpdateManager(this); +// this.invWrapperUpdateManager.register(); this.shopManager = new SimpleShopManager(this); // Limit //this.registerLimitRanks(); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index 7dde0c79eb..923d9f4dc4 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -9,6 +9,7 @@ import com.ghostchu.quickshop.api.command.CommandParser; import com.ghostchu.quickshop.api.shop.Shop; import com.ghostchu.quickshop.common.util.QuickExecutor; +import com.ghostchu.quickshop.shop.ContainerShop; import com.ghostchu.quickshop.shop.SimpleShopManager; import com.ghostchu.quickshop.shop.cache.SimpleShopCache; import com.ghostchu.quickshop.shop.display.AbstractDisplayItem; @@ -75,6 +76,27 @@ public SubCommand_Debug(QuickShop plugin) { subParamMapping.put("item-info", this::handleItemInfo); subParamMapping.put("mark-all-shops-dirty", this::handleShopsDirtyAndSave); subParamMapping.put("clean-display-entities", this::handleDisplayEntities); + subParamMapping.put("remove-container-shop-inventory-wrapper-cache", this::handleRemoveInventoryWrapperCache); + } + + private void handleRemoveInventoryWrapperCache(CommandSender sender, List strings) { + Shop shop = getLookingShop(sender); + if (shop == null) { + plugin.text().of(sender, "not-looking-at-shop").send(); + return; + } + ContainerShop containerShop = (ContainerShop) shop; + + try { + Field f = containerShop.getClass().getDeclaredField("inventoryWrapper"); + f.setAccessible(true); + f.set(containerShop, null); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + + sender.sendMessage("Cleared! Re-locating InventoryWrapper..."); + shop.getInventory(); } private void handleDisplayEntities(CommandSender sender, List strings) { @@ -420,7 +442,7 @@ public void printHandlerList(@NotNull CommandSender sender, String event) { public List onTabComplete( @NotNull CommandSender sender, @NotNull String commandLabel, @NotNull CommandParser parser) { if (parser.getArgs().size() == 1) { - return List.copyOf(subParamMapping.keySet()); + return List.copyOf(subParamMapping.keySet()).stream().filter(s->s.startsWith(parser.getArgs().get(0))).toList(); } return Collections.emptyList(); } 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 e987d0cad6..099207a9b7 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 @@ -33,7 +33,6 @@ import io.papermc.lib.PaperLib; import lombok.EqualsAndHashCode; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.apache.commons.lang3.StringUtils; import org.bukkit.*; import org.bukkit.block.Block; @@ -103,8 +102,6 @@ public class ContainerShop implements Shop, Reloadable { private QUser taxAccount; @NotNull private String inventoryWrapperProvider; - @EqualsAndHashCode.Exclude - private InventoryWrapper inventoryWrapper; @NotNull private String symbolLink; @Nullable @@ -431,23 +428,15 @@ public short getDurability() { */ @Override public @Nullable InventoryWrapper getInventory() { - if (inventoryWrapper == null || inventoryWrapper.isNeedUpdate()) { - Util.ensureThread(false); - if (inventoryWrapper != null && inventoryWrapper.isNeedUpdate()) { - Log.debug("(Re-)loading inventory from symbol link: " + symbolLink + " (InventoryWrapper declared it need to be re-newed)"); - } else { - Log.debug("Loading inventory from symbol link: " + symbolLink); - } - - try { - inventoryWrapper = locateInventory(symbolLink); - } catch (Exception e) { - Log.debug("Cannot locate the Inventory with symbol link: " + symbolLink + ", provider: " + inventoryWrapperProvider); - return null; + Util.ensureThread(false); + try { + InventoryWrapper inventoryWrapper = locateInventory(symbolLink); + if (inventoryWrapper.isValid()) { + return inventoryWrapper; } - } - if (inventoryWrapper.isValid()) { - return inventoryWrapper; + } catch (Exception e) { + Log.debug("Cannot locate the Inventory with symbol link: " + symbolLink + ", provider: " + inventoryWrapperProvider); + return null; } if (!createBackup) { createBackup = false; @@ -1050,17 +1039,17 @@ public void handleLoading() { return; } try (PerfMonitor ignored = new PerfMonitor("Shop Inventory Locate", Duration.of(1, ChronoUnit.SECONDS))) { - inventoryWrapper = locateInventory(symbolLink); - } catch (Exception e) { - plugin.logger().warn("Failed to load shop: {}: {}: {}", symbolLink, e.getClass().getName(), e.getMessage()); - if (plugin.getConfig().getBoolean("debug.delete-corrupt-shops")) { - plugin.logger().warn("Deleting corrupt shop..."); - plugin.getShopManager().deleteShop(this); - } else { - plugin.logger().warn("Unloading shops from memory, set `debug.delete-corrupt-shops` to true to delete corrupted shops."); - plugin.getShopManager().deleteShop(this); + if (getInventory() == null) { + plugin.logger().warn("Failed to load shop: {}: {}: {}", symbolLink, this.getClass().getName(), "Inventory is null"); + if (plugin.getConfig().getBoolean("debug.delete-corrupt-shops")) { + plugin.logger().warn("Deleting corrupt shop..."); + plugin.getShopManager().deleteShop(this); + } else { + plugin.logger().warn("Unloading shops from memory, set `debug.delete-corrupt-shops` to true to delete corrupted shops."); + plugin.getShopManager().unloadShop(this); + } + return; } - return; } if (Util.fireCancellableEvent(new ShopLoadEvent(this))) { return; @@ -1368,7 +1357,6 @@ public void setInventory(@NotNull InventoryWrapper wrapper, @NotNull InventoryWr if (provider == null) { throw new IllegalArgumentException("The manager " + manager.getClass().getName() + " not registered in registry."); } - this.inventoryWrapper = wrapper; this.inventoryWrapperProvider = provider; this.symbolLink = manager.mklink(wrapper); setDirty(); @@ -1581,19 +1569,33 @@ private ShopSignStorage saveToShopSignStorage() { @Override public String toString() { - - return "Shop " + - (location.getWorld() == null ? "unloaded world" : location.getWorld().getName()) + - "(" + - location.getBlockX() + - ", " + - location.getBlockY() + - ", " + - location.getBlockZ() + - ")" + - " Owner: " + LegacyComponentSerializer.legacySection().serialize(this.ownerName(false, MsgUtil.getDefaultGameLanguageLocale())) + " - " + getOwner() + - ", Unlimited: " + isUnlimited() + - ", Item: " + LegacyComponentSerializer.legacySection().serialize(Util.getItemStackName(getItem())) + - ", Price: " + getPrice(); + return "ContainerShop{" + + "location=" + location + + ", plugin=" + plugin + + ", runtimeRandomUniqueId=" + runtimeRandomUniqueId + + ", playerGroup=" + playerGroup + + ", isDeleted=" + isDeleted + + ", extra=" + extra + + ", shopId=" + shopId + + ", owner=" + owner + + ", price=" + price + + ", shopType=" + shopType + + ", unlimited=" + unlimited + + ", item=" + item + + ", originalItem=" + originalItem + + ", displayItem=" + displayItem + + ", isLoaded=" + isLoaded + + ", createBackup=" + createBackup + + ", inventoryPreview=" + inventoryPreview + + ", dirty=" + dirty + + ", updating=" + updating + + ", currency='" + currency + '\'' + + ", disableDisplay=" + disableDisplay + + ", taxAccount=" + taxAccount + + ", inventoryWrapperProvider='" + inventoryWrapperProvider + '\'' + + ", symbolLink='" + symbolLink + '\'' + + ", shopName='" + shopName + '\'' + + ", benefit=" + benefit + + '}'; } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 0356e15c87..dae22e69e1 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -20,7 +20,6 @@ import com.ghostchu.quickshop.shop.cache.BoxedShop; import com.ghostchu.quickshop.shop.cache.SimpleShopCache; import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapper; -import com.ghostchu.quickshop.shop.inventory.BukkitListenerDrivenInventoryWrapper; import com.ghostchu.quickshop.util.ChatSheetPrinter; import com.ghostchu.quickshop.util.MsgUtil; import com.ghostchu.quickshop.util.PackageUtil; @@ -56,16 +55,18 @@ import org.bukkit.block.data.Waterlogged; import org.bukkit.block.data.type.WallSign; import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; + import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -279,20 +280,20 @@ private void notifySold(@NotNull QUser buyerQUser, @NotNull Shop shop, int amoun String langCode = plugin.text().findRelativeLanguages(buyerQUser, true).getLocale(); List sendList = new ArrayList<>(); Component notify = plugin.text().of("player-sold-to-your-store", buyerQUser.getDisplay(), - amount, - Util.getItemStackName(shop.getItem())).forLocale(langCode); + amount, + Util.getItemStackName(shop.getItem())).forLocale(langCode); notify = plugin.getPlatform().setItemStackHoverEvent(notify, shop.getItem()); sendList.add(notify); if (space == amount) { Component spaceWarn; if (shop.getShopName() == null) { spaceWarn = plugin.text().of("shop-out-of-space", - shop.getLocation().getBlockX(), - shop.getLocation().getBlockY(), - shop.getLocation().getBlockZ()).forLocale(langCode); + shop.getLocation().getBlockX(), + shop.getLocation().getBlockY(), + shop.getLocation().getBlockZ()).forLocale(langCode); } else { spaceWarn = plugin.text().of("shop-out-of-space-name", shop.getShopName(), - Util.getItemStackName(shop.getItem())).forLocale(langCode); + Util.getItemStackName(shop.getItem())).forLocale(langCode); } spaceWarn = plugin.getPlatform().setItemStackHoverEvent(spaceWarn, shop.getItem()); sendList.add(spaceWarn); @@ -373,7 +374,7 @@ public void actionCreate(@NotNull Player p, Info info, @NotNull String message) false, null, plugin.getJavaPlugin().getName(), - plugin.getInventoryWrapperManager().mklink(new BukkitListenerDrivenInventoryWrapper((holder).getInventory(), state.getLocation())), + plugin.getInventoryWrapperManager().mklink(new BukkitInventoryWrapper((holder).getInventory())), null, Collections.emptyMap(), new SimpleBenefit()); @@ -1323,6 +1324,7 @@ public void sendSellSuccess(@NotNull QUser seller, @NotNull Shop shop, int amoun * @param p Target player * @param shop The shop */ + @SuppressWarnings("removal") @Override public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { if (!shop.playerAuthorize(p.getUniqueId(), BuiltInShopPermission.SHOW_INFORMATION) @@ -1408,7 +1410,7 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { ItemFlag hidePotionEffect; try { hidePotionEffect = ItemFlag.valueOf("HIDE_ADDITIONAL_TOOLTIP"); - }catch (Exception e){ + } catch (Exception e) { hidePotionEffect = ItemFlag.valueOf("HIDE_POTION_EFFECTS"); // Remove this when we dropped 1.20.x support } shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(hidePotionEffect); @@ -1419,27 +1421,66 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { MsgUtil.printEnchantment(shop, chatSheetPrinter); } if (shouldDisplayPotionEffects) { - if (items.hasItemMeta() && (items.getItemMeta() instanceof PotionMeta potionMeta)) { - List effects = new ArrayList<>(); - if (potionMeta.getBasePotionType() != null) { - effects.addAll(potionMeta.getBasePotionType().getPotionEffects()); - } - if (potionMeta.hasCustomEffects()) { - effects.addAll(potionMeta.getCustomEffects()); + if (plugin.getGameVersion().isNewPotionAPI()) { + if (items.hasItemMeta() && (items.getItemMeta() instanceof PotionMeta potionMeta)) { + List effects = new ArrayList<>(); + if (potionMeta.getBasePotionType() != null) { + effects.addAll(potionMeta.getBasePotionType().getPotionEffects()); + } + if (potionMeta.hasCustomEffects()) { + effects.addAll(potionMeta.getCustomEffects()); + } + for (PotionEffect potionEffect : effects) { + int level = potionEffect.getAmplifier(); + Component translation; + try { + translation = plugin.getPlatform().getTranslation(potionEffect.getType()); + } catch (Throwable th) { + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); + } + chatSheetPrinter.printLine(Component.empty() + .color(NamedTextColor.YELLOW) + .append(translation) + .append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); + } } - for (PotionEffect potionEffect : effects) { - int level = potionEffect.getAmplifier(); - Component translation; - try { - translation = plugin.getPlatform().getTranslation(potionEffect.getType()); - } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); + } else { + if (shouldDisplayPotionEffects) { + if (items.getItemMeta() instanceof PotionMeta potionMeta) { + PotionData potionData = potionMeta.getBasePotionData(); + PotionEffectType potionEffectType = potionData.getType().getEffectType(); + if (potionEffectType != null) { + Component translation; + try { + translation = plugin.getPlatform().getTranslation(potionEffectType); + } catch (Throwable th) { + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffectType.getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffectType.getKey(), th); + } + chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); + //Because the bukkit API limit, we can't get the actual effect level + chatSheetPrinter.printLine(Component.empty() + .color(NamedTextColor.YELLOW) + .append(translation) + ); + } + if (potionMeta.hasCustomEffects()) { + for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { + int level = potionEffect.getAmplifier(); + Component translation; + try { + translation = plugin.getPlatform().getTranslation(potionEffect.getType()); + } catch (Throwable th) { + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); + } + chatSheetPrinter.printLine(Component.empty() + .color(NamedTextColor.YELLOW) + .append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); + } + } } - chatSheetPrinter.printLine(Component.empty() - .color(NamedTextColor.YELLOW) - .append(translation) - .append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } } } @@ -1460,17 +1501,17 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, Component notify; if (plugin.getConfig().getBoolean("show-tax")) { notify = plugin.text().of("player-bought-from-your-store-tax", - seller, - amount * shop.getItem().getAmount(), - Util.getItemStackName(shop.getItem()), - this.formatter.format(total - tax, shop), - this.formatter.format(tax, shop)).forLocale(langCode); + seller, + amount * shop.getItem().getAmount(), + Util.getItemStackName(shop.getItem()), + this.formatter.format(total - tax, shop), + this.formatter.format(tax, shop)).forLocale(langCode); } else { notify = plugin.text().of("player-bought-from-your-store", - seller, - amount * shop.getItem().getAmount(), - Util.getItemStackName(shop.getItem()), - this.formatter.format(total - tax, shop)).forLocale(langCode); + seller, + amount * shop.getItem().getAmount(), + Util.getItemStackName(shop.getItem()), + this.formatter.format(total - tax, shop)).forLocale(langCode); } notify = plugin.getPlatform().setItemStackHoverEvent(notify, shop.getItem()); sendList.add(notify); @@ -1479,13 +1520,13 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, Component stockWarn; if (shop.getShopName() == null) { stockWarn = plugin.text().of("shop-out-of-stock", - shop.getLocation().getBlockX(), - shop.getLocation().getBlockY(), - shop.getLocation().getBlockZ(), - Util.getItemStackName(shop.getItem())).forLocale(langCode); + shop.getLocation().getBlockX(), + shop.getLocation().getBlockY(), + shop.getLocation().getBlockZ(), + Util.getItemStackName(shop.getItem())).forLocale(langCode); } else { stockWarn = plugin.text().of("shop-out-of-stock-name", shop.getShopName(), - Util.getItemStackName(shop.getItem())).forLocale(langCode); + Util.getItemStackName(shop.getItem())).forLocale(langCode); } stockWarn = plugin.getPlatform().setItemStackHoverEvent(stockWarn, shop.getItem()); sendList.add(stockWarn); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapper.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapper.java index e6b6742071..3a7ad0f7fb 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapper.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapper.java @@ -5,6 +5,7 @@ import com.ghostchu.quickshop.api.inventory.InventoryWrapperIterator; import com.ghostchu.quickshop.api.inventory.InventoryWrapperManager; import com.ghostchu.quickshop.api.inventory.InventoryWrapperType; +import com.ghostchu.quickshop.common.util.JsonUtil; import org.bukkit.Location; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; @@ -12,6 +13,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.function.Supplier; @@ -107,4 +109,11 @@ public boolean restoreSnapshot(@NotNull ItemStack[] snapshot) { public void setContents(ItemStack[] itemStacks) { inventory.setStorageContents(itemStacks); } + @Override + public String toString() { + Map map = new HashMap<>(); + map.put("inventory", inventory.toString()); + map.put("inventoryType", inventory.getClass().getName()); + return JsonUtil.getGson().toJson(map); + } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java index 53c20470ca..e4725f577b 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java @@ -46,7 +46,7 @@ private InventoryWrapper locateNew(String symbolLink) { if (!(state instanceof InventoryHolder holder)) { throw new IllegalArgumentException("Invalid symbol link: Target block not a InventoryHolder (map changed/resetted?)"); } - return new BukkitListenerDrivenInventoryWrapper(holder.getInventory(), state.getLocation()); + return new BukkitInventoryWrapper(holder.getInventory()); } @Deprecated @@ -61,24 +61,10 @@ private InventoryWrapper locateOld(String symbolLink) { throw new IllegalArgumentException("Invalid symbol link: Invalid world name."); } BlockState block = world.getBlockAt(blockHolder.getX(), blockHolder.getY(), blockHolder.getZ()).getState(); - if (PackageUtil.parsePackageProperly("forceLoadAnotherSideWhenInventoryLocate").asBoolean(false)) { - BlockData blockData = block.getBlockData(); - if (blockData instanceof Chest chest) { - if (chest.getType() != Chest.Type.SINGLE) { - // try load another side - Block anotherBlock = Util.getSecondHalf(block.getBlock()); - anotherBlock.getChunk().load(); - if (PackageUtil.parsePackageProperly("forceUpdateAnotherSideAfterForceLoadAnotherSide").asBoolean(false)) { - block.update(); - block = world.getBlockAt(blockHolder.getX(), blockHolder.getY(), blockHolder.getZ()).getState(); - } - } - } - } if (!(block instanceof InventoryHolder holder)) { throw new IllegalArgumentException("Invalid symbol link: Target block not a Container (map changed/resetted?)"); } - return new BukkitListenerDrivenInventoryWrapper(holder.getInventory(), block.getLocation()); + return new BukkitInventoryWrapper(holder.getInventory()); } default -> throw new IllegalArgumentException("Invalid symbol link: Invalid holder type."); } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryListener.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryListener.java index 551002e9de..d2ffebbae4 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryListener.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryListener.java @@ -1,15 +1,15 @@ -package com.ghostchu.quickshop.shop.inventory; - -import org.bukkit.Location; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public interface BukkitListenerDrivenInventoryListener { - // This listener to fix for: - //https://discord.com/channels/942378696415797298/942378809632649256/1156394450570969089 - //https://discord.com/channels/942378696415797298/942378809632649256/1207787041992216586 - //https://discord.com/channels/942378696415797298/942378809632649256/1207783977352437881 - //https://discord.com/channels/942378696415797298/942378809632649256/1208807999003562044 - //https://discord.com/channels/942378696415797298/942378809632649256/1221584126432514110 - boolean notify(Location updated); // May call from async thread -} +//package com.ghostchu.quickshop.shop.inventory; +// +//import org.bukkit.Location; +//import org.jetbrains.annotations.ApiStatus; +// +//@ApiStatus.Internal +//public interface BukkitListenerDrivenInventoryListener { +// // This listener to fix for: +// //https://discord.com/channels/942378696415797298/942378809632649256/1156394450570969089 +// //https://discord.com/channels/942378696415797298/942378809632649256/1207787041992216586 +// //https://discord.com/channels/942378696415797298/942378809632649256/1207783977352437881 +// //https://discord.com/channels/942378696415797298/942378809632649256/1208807999003562044 +// //https://discord.com/channels/942378696415797298/942378809632649256/1221584126432514110 +// boolean notify(Location updated); // May call from async thread +//} diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryWrapper.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryWrapper.java index 42e24886aa..d368e582e3 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryWrapper.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitListenerDrivenInventoryWrapper.java @@ -1,123 +1,127 @@ -package com.ghostchu.quickshop.shop.inventory; - -import com.ghostchu.quickshop.QuickShop; -import com.ghostchu.quickshop.api.inventory.InventoryWrapper; -import com.ghostchu.quickshop.api.inventory.InventoryWrapperIterator; -import com.ghostchu.quickshop.api.inventory.InventoryWrapperManager; -import com.ghostchu.quickshop.api.inventory.InventoryWrapperType; -import org.bukkit.Location; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; -import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Map; - -@ApiStatus.Internal -public class BukkitListenerDrivenInventoryWrapper implements InventoryWrapper, BukkitListenerDrivenInventoryListener { - private final Inventory inventory; - private final InventoryWrapperManager manager; - private final Location location; - private boolean needUpdate; - - public BukkitListenerDrivenInventoryWrapper(@NotNull Inventory inventory, Location location) { - this.inventory = inventory; - this.manager = QuickShop.getInstance().getInventoryWrapperManager(); - this.location = location.clone(); - QuickShop.getInstance().getInvWrapperUpdateManager().registerListener(this); - } - - @Override - public boolean notify(Location updated) { - if (location.equals(updated)) { - needUpdate = true; - return true; - } - return false; - } - - - @Override - public @NotNull InventoryWrapperIterator iterator() { - return InventoryWrapperIterator.ofBukkitInventory(inventory); - } - - @Override - public void clear() { - inventory.clear(); - } - - @Override - public @NotNull ItemStack[] createSnapshot() { - ItemStack[] content = this.inventory.getContents(); - ItemStack[] snapshot = new ItemStack[content.length]; - for (int i = 0; i < content.length; i++) { - if (content[i] != null) { - snapshot[i] = content[i].clone(); - } else { - snapshot[i] = null; - } - - } - return snapshot; - } - - @Override - public @NotNull InventoryWrapperManager getWrapperManager() { - return this.manager; - } - - @Override - public InventoryHolder getHolder() { - return inventory.getHolder(); - } - - @Override - public @NotNull InventoryWrapperType getInventoryType() { - return InventoryWrapperType.BUKKIT; - } - - @Override - public @Nullable Location getLocation() { - return inventory.getLocation(); - } - - @Override - public boolean isValid() { - if (this.inventory.getHolder() != null) { - return true; - } else { - return this.inventory instanceof InventoryHolder; - } - } - - @Override - public boolean isNeedUpdate() { - return needUpdate; - } - - @Override - public boolean restoreSnapshot(@NotNull ItemStack[] snapshot) { - this.inventory.setContents(snapshot); - return true; - } - - @Override - public @NotNull Map addItem(ItemStack... itemStacks) { - return inventory.addItem(itemStacks); - } - - @Override - public void setContents(ItemStack[] itemStacks) { - inventory.setStorageContents(itemStacks); - } - - @Override - public String toString() { - return "BukkitListenerDrivenInventoryWrapper{" + - "inventory=" + inventory + - '}'; - } -} +//package com.ghostchu.quickshop.shop.inventory; +// +//import com.ghostchu.quickshop.QuickShop; +//import com.ghostchu.quickshop.api.inventory.InventoryWrapper; +//import com.ghostchu.quickshop.api.inventory.InventoryWrapperIterator; +//import com.ghostchu.quickshop.api.inventory.InventoryWrapperManager; +//import com.ghostchu.quickshop.api.inventory.InventoryWrapperType; +//import com.ghostchu.quickshop.common.util.JsonUtil; +//import org.bukkit.Location; +//import org.bukkit.inventory.Inventory; +//import org.bukkit.inventory.InventoryHolder; +//import org.bukkit.inventory.ItemStack; +//import org.jetbrains.annotations.ApiStatus; +//import org.jetbrains.annotations.NotNull; +//import org.jetbrains.annotations.Nullable; +// +//import java.util.HashMap; +//import java.util.Map; +// +//@ApiStatus.Internal +//public class BukkitListenerDrivenInventoryWrapper implements InventoryWrapper, BukkitListenerDrivenInventoryListener { +// private final Inventory inventory; +// private final InventoryWrapperManager manager; +// private final Location location; +// private boolean needUpdate; +// +// public BukkitListenerDrivenInventoryWrapper(@NotNull Inventory inventory, Location location) { +// this.inventory = inventory; +// this.manager = QuickShop.getInstance().getInventoryWrapperManager(); +// this.location = location.clone(); +// QuickShop.getInstance().getInvWrapperUpdateManager().registerListener(this); +// } +// +// @Override +// public boolean notify(Location updated) { +// if (location.equals(updated)) { +// needUpdate = true; +// return true; +// } +// return false; +// } +// +// +// @Override +// public @NotNull InventoryWrapperIterator iterator() { +// return InventoryWrapperIterator.ofBukkitInventory(inventory); +// } +// +// @Override +// public void clear() { +// inventory.clear(); +// } +// +// @Override +// public @NotNull ItemStack[] createSnapshot() { +// ItemStack[] content = this.inventory.getContents(); +// ItemStack[] snapshot = new ItemStack[content.length]; +// for (int i = 0; i < content.length; i++) { +// if (content[i] != null) { +// snapshot[i] = content[i].clone(); +// } else { +// snapshot[i] = null; +// } +// +// } +// return snapshot; +// } +// +// @Override +// public @NotNull InventoryWrapperManager getWrapperManager() { +// return this.manager; +// } +// +// @Override +// public InventoryHolder getHolder() { +// return inventory.getHolder(); +// } +// +// @Override +// public @NotNull InventoryWrapperType getInventoryType() { +// return InventoryWrapperType.BUKKIT; +// } +// +// @Override +// public @Nullable Location getLocation() { +// return inventory.getLocation(); +// } +// +// @Override +// public boolean isValid() { +// if (this.inventory.getHolder() != null) { +// return true; +// } else { +// return this.inventory instanceof InventoryHolder; +// } +// } +// +// @Override +// public boolean isNeedUpdate() { +// return needUpdate; +// } +// +// @Override +// public boolean restoreSnapshot(@NotNull ItemStack[] snapshot) { +// this.inventory.setContents(snapshot); +// return true; +// } +// +// @Override +// public @NotNull Map addItem(ItemStack... itemStacks) { +// return inventory.addItem(itemStacks); +// } +// +// @Override +// public void setContents(ItemStack[] itemStacks) { +// inventory.setStorageContents(itemStacks); +// } +// +// @Override +// public String toString() { +// Map map = new HashMap<>(); +// map.put("inventory", inventory.toString()); +// map.put("location", location.toString()); +// map.put("inventoryType", inventory.getClass().getName()); +// return JsonUtil.getGson().toJson(map); +// } +//} diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/InventoryWrapperUpdateManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/InventoryWrapperUpdateManager.java index 0ed4ebfa3f..c2b3bc9a66 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/InventoryWrapperUpdateManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/InventoryWrapperUpdateManager.java @@ -1,75 +1,75 @@ -package com.ghostchu.quickshop.shop.inventory; - -import com.ghostchu.quickshop.QuickShop; -import com.ghostchu.quickshop.listener.AbstractQSListener; -import com.ghostchu.quickshop.util.Util; -import com.ghostchu.quickshop.util.logger.Log; -import com.google.common.collect.Lists; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.block.BlockPlaceEvent; -import org.bukkit.inventory.DoubleChestInventory; -import org.bukkit.inventory.InventoryHolder; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public class InventoryWrapperUpdateManager extends AbstractQSListener { - private final List checkList = Lists.newArrayList(Material.CHEST, Material.TRAPPED_CHEST); - private final List> registeredListeners = new ArrayList<>(); - - public InventoryWrapperUpdateManager(QuickShop plugin) { - super(plugin); - } - - private synchronized void notifyAllListeners(Location... locs) { - synchronized (registeredListeners) { - Iterator> it = registeredListeners.iterator(); - while (it.hasNext()) { - WeakReference ref = it.next(); - BukkitListenerDrivenInventoryListener listener = ref.get(); - if (listener == null) { - it.remove(); - continue; - } - for (Location loc : locs) { - try { - if (listener.notify(loc)) { - Log.debug("Successfully notified listener " + listener + " which need to be update"); - } - } catch (Throwable e) { - plugin.logger().warn("Failed to notify inventory possible update to listener: {}", listener, e); - } - } - } - } - } - - public void registerListener(BukkitListenerDrivenInventoryListener listener) { - this.registeredListeners.add(new WeakReference<>(listener)); - } - - @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onInventoryRelatedBlockPlaced(BlockPlaceEvent event) { - Block placed = event.getBlockPlaced(); - if (!checkList.contains(placed.getType())) { - return; - } - // Delay 1 tick to allow chest merge - Bukkit.getScheduler().runTaskLater(plugin.getJavaPlugin(), () -> { - BlockState state = placed.getState(); - if (state instanceof InventoryHolder holder) { - if (holder.getInventory() instanceof DoubleChestInventory doubleChestInventory) { - Util.asyncThreadRun(() -> notifyAllListeners(doubleChestInventory.getLeftSide().getLocation(), doubleChestInventory.getRightSide().getLocation())); - } - } - }, 1L); - } -} +//package com.ghostchu.quickshop.shop.inventory; +// +//import com.ghostchu.quickshop.QuickShop; +//import com.ghostchu.quickshop.listener.AbstractQSListener; +//import com.ghostchu.quickshop.util.Util; +//import com.ghostchu.quickshop.util.logger.Log; +//import com.google.common.collect.Lists; +//import org.bukkit.Bukkit; +//import org.bukkit.Location; +//import org.bukkit.Material; +//import org.bukkit.block.Block; +//import org.bukkit.block.BlockState; +//import org.bukkit.event.EventHandler; +//import org.bukkit.event.EventPriority; +//import org.bukkit.event.block.BlockPlaceEvent; +//import org.bukkit.inventory.DoubleChestInventory; +//import org.bukkit.inventory.InventoryHolder; +// +//import java.lang.ref.WeakReference; +//import java.util.ArrayList; +//import java.util.Iterator; +//import java.util.List; +// +//public class InventoryWrapperUpdateManager extends AbstractQSListener { +// private final List checkList = Lists.newArrayList(Material.CHEST, Material.TRAPPED_CHEST); +// private final List> registeredListeners = new ArrayList<>(); +// +// public InventoryWrapperUpdateManager(QuickShop plugin) { +// super(plugin); +// } +// +// private synchronized void notifyAllListeners(Location... locs) { +// synchronized (registeredListeners) { +// Iterator> it = registeredListeners.iterator(); +// while (it.hasNext()) { +// WeakReference ref = it.next(); +// BukkitListenerDrivenInventoryListener listener = ref.get(); +// if (listener == null) { +// it.remove(); +// continue; +// } +// for (Location loc : locs) { +// try { +// if (listener.notify(loc)) { +// Log.debug("Successfully notified listener " + listener + " which need to be update"); +// } +// } catch (Throwable e) { +// plugin.logger().warn("Failed to notify inventory possible update to listener: {}", listener, e); +// } +// } +// } +// } +// } +// +// public void registerListener(BukkitListenerDrivenInventoryListener listener) { +// this.registeredListeners.add(new WeakReference<>(listener)); +// } +// +// @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) +// public void onInventoryRelatedBlockPlaced(BlockPlaceEvent event) { +// Block placed = event.getBlockPlaced(); +// if (!checkList.contains(placed.getType())) { +// return; +// } +// // Delay 1 tick to allow chest merge +// Bukkit.getScheduler().runTaskLater(plugin.getJavaPlugin(), () -> { +// BlockState state = placed.getState(); +// if (state instanceof InventoryHolder holder) { +// if (holder.getInventory() instanceof DoubleChestInventory doubleChestInventory) { +// Util.asyncThreadRun(() -> notifyAllListeners(doubleChestInventory.getLeftSide().getLocation(), doubleChestInventory.getRightSide().getLocation())); +// } +// } +// }, 1L); +// } +//} From adfa26430633bbe26b31893e8d5140b4bf953d26 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 21:20:36 +0800 Subject: [PATCH 63/81] clean up --- .../java/com/ghostchu/quickshop/shop/SimpleShopManager.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index dae22e69e1..474bd4b45b 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -94,6 +94,7 @@ public class SimpleShopManager implements ShopManager, Reloadable { .initialCapacity(50) .build(); private final EconomyFormatter formatter; + @Getter private ShopCache shopCache; @Getter @Nullable @@ -166,10 +167,6 @@ private void init() { this.shopCache = new SimpleShopCache(plugin, map); } - public ShopCache getShopCache() { - return shopCache; - } - @Override public void actionBuying( @NotNull Player buyer, From 3c68a7827a17917a10bd58c5e1d256ed4620dceb Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 21:22:28 +0800 Subject: [PATCH 64/81] fix debug command --- .../quickshop/command/subcommand/SubCommand_Debug.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index 923d9f4dc4..b904ccae84 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -64,8 +64,7 @@ public SubCommand_Debug(QuickShop plugin) { subParamMapping.put("check-shop-status", this::handleShopDebug); subParamMapping.put("toggle-shop-load-status", this::handleShopLoading); subParamMapping.put("check-shop-debug", this::handleShopInfo); - subParamMapping.put("set-property", this::handleShopsReload); - subParamMapping.put("force-shops-reload", this::handleProperty); + subParamMapping.put("set-property", this::handleProperty); subParamMapping.put("reset-shop-caches", this::handleShopCacheResetting); subParamMapping.put("reset-dbmanager", this::handleDbManagerReset); subParamMapping.put("dump-db-connections", this::handleDumpDbConnections); From befb092ce67ce84d11fd85406de072b9789dc041 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 21:32:43 +0800 Subject: [PATCH 65/81] fix sql resources leak --- .../quickshop/shop/history/ShopHistory.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java index e37adbb276..19373df746 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistory.java @@ -1,6 +1,5 @@ package com.ghostchu.quickshop.shop.history; -import cc.carm.lib.easysql.api.SQLQuery; import com.ghostchu.quickshop.QuickShop; import com.ghostchu.quickshop.api.database.ShopOperationEnum; import com.ghostchu.quickshop.api.shop.Shop; @@ -26,8 +25,8 @@ public ShopHistory(QuickShop plugin, List shops) { this.plugin = plugin; this.shops = shops; for (Shop shop : shops) { - long shopId= shop.getShopId(); - if(shopId <= 0){ + long shopId = shop.getShopId(); + if (shopId <= 0) { continue; } shopsMapping.put(shopId, shop); @@ -136,7 +135,7 @@ private CompletableFuture summaryUniquePurchasers() { try (PerfMonitor perfMonitor = new PerfMonitor("summaryUniquePurchasers"); Connection connection = plugin.getSqlManager().getConnection(); PreparedStatement ps = connection.prepareStatement(SQL)) { - perfMonitor.setContext("shopIds=" +shopsMapping.keySet()); + perfMonitor.setContext("shopIds=" + shopsMapping.keySet()); mappingPreparedStatement(ps, 1); @Cleanup ResultSet set = ps.executeQuery(); @@ -284,14 +283,13 @@ public CompletableFuture generateSummary() { public List query(int page, int pageSize) throws SQLException { Util.ensureThread(true); List historyRecords = new ArrayList<>(pageSize); - String SQL = "SELECT * FROM %s WHERE `shop` IN ("+shopIdsPlaceHolders+") ORDER BY `time` DESC LIMIT "+(page - 1) * pageSize+","+pageSize; + String SQL = "SELECT * FROM %s WHERE `shop` IN (" + shopIdsPlaceHolders + ") ORDER BY `time` DESC LIMIT " + (page - 1) * pageSize + "," + pageSize; SQL = String.format(SQL, DataTables.LOG_PURCHASE.getName()); - try (PerfMonitor perfMonitor = new PerfMonitor("historyPageableQuery")) { - Connection connection = plugin.getSqlManager().getConnection(); - PreparedStatement ps = connection.prepareStatement(SQL); + try (PerfMonitor perfMonitor = new PerfMonitor("historyPageableQuery"); + Connection connection = plugin.getSqlManager().getConnection(); + PreparedStatement ps = connection.prepareStatement(SQL)) { mappingPreparedStatement(ps, 1); perfMonitor.setContext("shopIds=" + shopsMapping.keySet() + ", page=" + page + ", pageSize=" + pageSize); - try (ResultSet set = ps.executeQuery()) { while (set.next()) { if (!isValidSummaryRecordType(set.getString("type"))) { From b9cd99eb254a52f2cdf30c9da1b634339b925c4f Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 21:46:12 +0800 Subject: [PATCH 66/81] Fix GUI paging --- .../ghostchu/quickshop/shop/history/ShopHistoryGUI.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java index c9882c7af9..9f56663efe 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java @@ -19,6 +19,7 @@ import com.github.stefvanschie.inventoryframework.pane.StaticPane; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.entity.Player; @@ -69,7 +70,7 @@ public ShopHistoryGUI(QuickShop plugin, Player player, ShopHistory shopHistory) private void reQuery() { Util.ensureThread(true); try { - this.queryResult = shopHistory.query(page, body.getLength() * body.getLength()); + this.queryResult = shopHistory.query(page, body.getLength() * body.getHeight()); if (summary == null) { summary = shopHistory.generateSummary().join(); Log.debug(summary.toString()); @@ -233,14 +234,14 @@ private void updateFooterPageIcons() { e.setResult(Event.Result.DENY); e.setCancelled(true); page = Math.max(1, page - 1); - refreshGui(); + Util.mainThreadRun(this::refreshGui); }), 0, 0); footer.addItem(new GuiItem(currentPage, cancelEvent()), 4, 0); footer.addItem(new GuiItem(nextPage, e -> { e.setResult(Event.Result.DENY); e.setCancelled(true); page = page + 1; - refreshGui(); + Util.mainThreadRun(this::refreshGui); }), 8, 0); } From a2ccc66c1e79ae4518969cc7abbb10a6bd7d9db4 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 22:08:31 +0800 Subject: [PATCH 67/81] Extract some parts of code from AbstractShopManager --- .../quickshop/shop/AbstractShopManager.java | 585 +++++++ .../quickshop/shop/SimpleShopManager.java | 1380 ++++------------- .../src/main/resources/lang/messages.yml | 3 +- 3 files changed, 929 insertions(+), 1039 deletions(-) create mode 100644 quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java new file mode 100644 index 0000000000..911fb24746 --- /dev/null +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java @@ -0,0 +1,585 @@ +package com.ghostchu.quickshop.shop; + +import com.ghostchu.quickshop.QuickShop; +import com.ghostchu.quickshop.api.event.ShopCreateSuccessEvent; +import com.ghostchu.quickshop.api.obj.QUser; +import com.ghostchu.quickshop.api.shop.Shop; +import com.ghostchu.quickshop.api.shop.ShopChunk; +import com.ghostchu.quickshop.api.shop.ShopManager; +import com.ghostchu.quickshop.api.shop.cache.ShopCache; +import com.ghostchu.quickshop.api.shop.cache.ShopCacheNamespacedKey; +import com.ghostchu.quickshop.api.shop.cache.ShopInventoryCountCache; +import com.ghostchu.quickshop.common.util.QuickExecutor; +import com.ghostchu.quickshop.shop.cache.BoxedShop; +import com.ghostchu.quickshop.shop.cache.SimpleShopCache; +import com.ghostchu.quickshop.util.Util; +import com.ghostchu.quickshop.util.economyformatter.EconomyFormatter; +import com.ghostchu.quickshop.util.logger.Log; +import com.ghostchu.quickshop.util.performance.PerfMonitor; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.MapMaker; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import io.papermc.lib.PaperLib; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.bukkit.Chunk; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; +import org.bukkit.inventory.InventoryHolder; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.text.DecimalFormat; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +// This class is extract from SimpleShopManager because it is too big... +public abstract class AbstractShopManager implements ShopManager { + @Getter + protected ShopCache shopCache; + protected static final DecimalFormat STANDARD_FORMATTER = new DecimalFormat("#.#########"); + // the performance impact on busy server + protected final Cache shopRuntimeUUIDCaching = + CacheBuilder.newBuilder() + .expireAfterAccess(10, TimeUnit.MINUTES) + .maximumSize(50) + .weakValues() + .initialCapacity(50) + .build(); + protected final QuickShop plugin; + + protected final EconomyFormatter formatter; + protected final Map>> shops = Maps.newConcurrentMap(); + protected final Set loadedShops = Sets.newConcurrentHashSet(); // Handle it by collection to reduce + + + public AbstractShopManager(@NotNull QuickShop plugin) { + Util.ensureThread(false); + this.plugin = plugin; + this.formatter = new EconomyFormatter(plugin, plugin::getEconomy); + + } + + public void init(){ + Map<@NotNull ShopCacheNamespacedKey, @NotNull Pair<@NotNull Function, @Nullable Cache>> map = new HashMap<>(); + // SINGLE + map.put(ShopCacheNamespacedKey.SINGLE, new ImmutablePair<>(this::getShop, null)); + map.put(ShopCacheNamespacedKey.INCLUDE_ATTACHED, new ImmutablePair<>(this::getShopIncludeAttached, null)); + shopCache = new SimpleShopCache(plugin, map); + } + + /** + * Adds a shop to the world. Does NOT require the chunk or world to be loaded Call shop.onLoad + * by yourself + * + * @param shop The shop to add + */ + protected void addShopToLookupTable(@NotNull Shop shop) { + String world = shop.getLocation().getWorld().getName(); + Map> inWorld = shops.computeIfAbsent(world, k -> new MapMaker().initialCapacity(3).makeMap()); + // There's no world storage yet. We need to create that map. + // Put it in the data universe + // Calculate the chunks coordinates. These are 1,2,3 for each chunk, NOT + // location rounded to the nearest 16. + int x = (int) Math.floor((shop.getLocation().getBlockX()) / 16.0); + int z = (int) Math.floor((shop.getLocation().getBlockZ()) / 16.0); + // Get the chunk set from the world info + ShopChunk shopChunk = new SimpleShopChunk(world, x, z); + Map inChunk = + inWorld.computeIfAbsent(shopChunk, k -> new MapMaker().initialCapacity(1).makeMap()); + // That chunk data hasn't been created yet - Create it! + // Put it in the world + // Put the shop in its location in the chunk list. + inChunk.put(shop.getLocation(), shop); + } + + @Override + public void bakeShopRuntimeRandomUniqueIdCache(@NotNull Shop shop) { + shopRuntimeUUIDCaching.put(shop.getRuntimeRandomUniqueId(), shop); + } + + /** + * Format the price use formatter + * + * @param d price + * @return formatted price + */ + @Override + public @NotNull String format(double d, @NotNull World world, @Nullable String currency) { + return formatter.format(d, world, currency); + } + + /** + * Format the price use formatter + * + * @param d price + * @return formatted price + */ + @Override + public @NotNull String format(double d, @NotNull Shop shop) { + return formatter.format(d, shop); + } + + @NotNull + @Override + public CompletableFuture<@NotNull List> queryTaggedShops(@NotNull UUID tagger, @NotNull String tag) { + Util.ensureThread(true); + return CompletableFuture.supplyAsync(() -> plugin.getDatabaseHelper().listShopsTaggedBy(tagger, tag).stream().map(this::getShop).toList(), QuickExecutor.getCommonExecutor()); + + } + + @Override + public void loadShop(@NotNull Shop shop) { + //noinspection deprecation + shop.handleLoading(); + this.loadedShops.add(shop); + } + + @Override + public void unloadShop(@NotNull Shop shop) { + unloadShop(shop, false); + } + + @Override + public void unloadShop(@NotNull Shop shop, boolean dontTouchWorld) { + //noinspection deprecation + shop.handleUnloading(dontTouchWorld); + this.loadedShops.remove(shop); + } + + /** + * Removes a shop from the world. Does NOT remove it from the database. * REQUIRES * the world + * to be loaded Call shop.onUnload by your self. + * + * @param shop The shop to remove + */ + private void removeShopFromLookupTable(@NotNull Shop shop) { + Location loc = shop.getLocation(); + String world = Objects.requireNonNull(loc.getWorld()).getName(); + Map> inWorld = this.getShops().get(world); + if (inWorld == null) { + return; + } + int x = (int) Math.floor((loc.getBlockX()) / 16.0); + int z = (int) Math.floor((loc.getBlockZ()) / 16.0); + ShopChunk shopChunk = new SimpleShopChunk(world, x, z); + Map inChunk = inWorld.get(shopChunk); + if (inChunk == null) { + return; + } + inChunk.remove(loc); + shopCache.invalidate(null, shop.getLocation()); + } + + + protected void processCreationFail(@NotNull Shop shop, @NotNull QUser owner, @NotNull Throwable e2) { + plugin.logger().error("Shop create failed, auto fix failed, the changes may won't commit to database.", e2); + plugin.text().of(owner, "shop-creation-failed").send(); + Util.mainThreadRun(() -> { + unloadShop(shop); + unregisterShop(shop, true); + removeShopFromLookupTable(shop); + }); + } + + @Override + public CompletableFuture<@Nullable Integer> clearShopTags(@NotNull UUID tagger, @NotNull Shop shop) { + return plugin.getDatabaseHelper().removeShopAllTag(tagger, shop.getShopId()); + } + + @Override + public CompletableFuture<@Nullable Integer> clearTagFromShops(@NotNull UUID tagger, @NotNull String tag) { + tag = tag.trim().toLowerCase(Locale.ROOT); + tag = tag.replace(" ", "_"); + return plugin.getDatabaseHelper().removeTagFromShops(tagger, tag); + } + + @Override + public CompletableFuture<@Nullable Integer> removeTag(@NotNull UUID tagger, @NotNull Shop shop, @NotNull String tag) { + tag = tag.trim().toLowerCase(Locale.ROOT); + tag = tag.replace(" ", "_"); + return plugin.getDatabaseHelper().removeShopTag(tagger, shop.getShopId(), tag); + } + + @Override + public CompletableFuture<@Nullable Integer> tagShop(@NotNull UUID tagger, @NotNull Shop shop, @NotNull String tag) { + tag = tag.trim().toLowerCase(Locale.ROOT); + tag = tag.replace(" ", "_"); + return plugin.getDatabaseHelper().tagShop(tagger, shop.getShopId(), tag); + } + + @Override + @NotNull + public List listTags(@NotNull UUID tagger) { + Util.ensureThread(true); + return plugin.getDatabaseHelper().listTags(tagger); + } + + @Override + public CompletableFuture unregisterShop(@NotNull Shop shop, boolean persist) { + removeShopFromLookupTable(shop); + if (!persist) return CompletableFuture.completedFuture(null); + Location loc = shop.getLocation(); + return plugin.getDatabaseHelper().removeShopMap(loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()) + .thenCombine(plugin.getDatabaseHelper().removeShop(shop.getShopId()), (a, b) -> null) + .exceptionally(throwable -> { + plugin.logger().warn("Failed to remove shop from database", throwable); + return null; + }); + } + + + + /** + * Returns all shops in the memory, include unloaded. + * + *

Make sure you have caching this, because this need a while to get all shops + * + * @return All shop in the database + */ + @Override + public @NotNull List getAllShops() { + try (PerfMonitor ignored = new PerfMonitor("Getting all shops")) { + final List shopsCollected = new ArrayList<>(); + for (final Map> shopMapData : getShops().values()) { + for (final Map shopData : shopMapData.values()) { + shopsCollected.addAll(shopData.values()); + } + } + return shopsCollected; + } + } + + /** + * Get all loaded shops. + * + * @return All loaded shops. + */ + @Override + public @NotNull Set getLoadedShops() { + return this.loadedShops; + } + + /** + * Get a players all shops. + * + *

Make sure you have caching this, because this need a while to get player's all shops + * + * @param playerUUID The player's uuid. + * @return The list have this player's all shops. + */ + @Override + public @NotNull List getAllShops(@NotNull QUser playerUUID) { + final List playerShops = new ArrayList<>(10); + for (final Shop shop : getAllShops()) { + if (shop.getOwner().equals(playerUUID)) { + playerShops.add(shop); + } + } + return playerShops; + } + + @Override + public @NotNull List getAllShops(@NotNull UUID playerUUID) { + final List playerShops = new ArrayList<>(10); + for (final Shop shop : getAllShops()) { + UUID shopUuid = shop.getOwner().getUniqueIdIfRealPlayer().orElse(null); + if (playerUUID.equals(shopUuid)) { + playerShops.add(shop); + } + } + return playerShops; + } + + + /** + * Gets a shop by shop Id + * + * @param shopId shop Id + * @return The shop object + */ + @Override + public @Nullable Shop getShop(long shopId) { + for (Shop shop : getAllShops()) { + if (shop.getShopId() == shopId) { + return shop; + } + } + return null; + } + + /** + * Gets a shop in a specific location + * + * @param loc The location to get the shop from + * @param skipShopableChecking whether to check is shopable, this will cause chunk loading + * @return The shop at that location + */ + @Override + public @Nullable Shop getShop(@NotNull Location loc, boolean skipShopableChecking) { + if (!skipShopableChecking && !Util.isShoppables(loc.getBlock().getType())) { + return null; + } + ShopChunk shopChunk = SimpleShopChunk.fromLocation(loc); + final Map inChunk = getShops(shopChunk); + if (inChunk == null) { + return null; + } + loc = loc.clone(); + // Fix double chest XYZ issue + loc.setX(loc.getBlockX()); + loc.setY(loc.getBlockY()); + loc.setZ(loc.getBlockZ()); + // We can do this because WorldListener updates the world reference so + // the world in loc is the same as world in inChunk.get(loc) + return inChunk.get(loc); + } + + @Override + @Nullable + public Shop getShopFromRuntimeRandomUniqueId(@NotNull UUID runtimeRandomUniqueId) { + return getShopFromRuntimeRandomUniqueId(runtimeRandomUniqueId, false); + } + + @Override + @Nullable + public Shop getShopFromRuntimeRandomUniqueId( + @NotNull UUID runtimeRandomUniqueId, boolean includeInvalid) { + Shop shop = shopRuntimeUUIDCaching.getIfPresent(runtimeRandomUniqueId); + if (shop == null) { + for (Shop shopWithoutCache : this.getLoadedShops()) { + if (shopWithoutCache.getRuntimeRandomUniqueId().equals(runtimeRandomUniqueId)) { + return shopWithoutCache; + } + } + return null; + } + if (includeInvalid) { + return shop; + } + if (shop.isValid()) { + return shop; + } + return null; + } + @Nullable + public Shop findShopIncludeAttached(@NotNull Location loc, boolean fromAttach) { + Shop shop = getShop(loc); + + // failed, get attached shop + if (shop == null) { + Block block = loc.getBlock(); + if (!Util.isShoppables(block.getType())) { + return null; + } + final Block currentBlock = loc.getBlock(); + if (!fromAttach) { + // sign + if (Util.isWallSign(currentBlock.getType())) { + final Block attached = Util.getAttached(currentBlock); + if (attached != null) { + shop = this.findShopIncludeAttached(attached.getLocation(), true); + } + } else { + // optimize for performance + BlockState state = PaperLib.getBlockState(currentBlock, false).getState(); + if (!(state instanceof InventoryHolder holder)) { + return null; + } + @Nullable final Block half = Util.getSecondHalf(currentBlock); + if (half != null) { + shop = getShop(half.getLocation()); + } + } + } + } + return shop; + } + /** + * Gets a shop in a specific location Include the attached shop, e.g DoubleChest shop. + * + * @param loc The location to get the shop from + * @return The shop at that location + */ + @Override + public @Nullable Shop getShopIncludeAttached(@Nullable Location loc) { + if (loc == null) { + Log.debug("Location is null."); + return null; + } + return findShopIncludeAttached(loc, false); + } + + @Override + public CompletableFuture registerShop(@NotNull Shop shop, boolean persist) { + // save to database + addShopToLookupTable(shop); + if (!persist) return CompletableFuture.completedFuture(null); + return plugin.getDatabaseHelper().createData(shop).thenCompose(plugin.getDatabaseHelper()::createShop) + .thenAccept(id -> { + Log.debug("DEBUG: Setting shop id"); + shop.setShopId(id); + Log.debug("DEBUG: Creating shop map"); + plugin.getDatabaseHelper().createShopMap(id, shop.getLocation()).join(); + Log.debug("DEBUG: Creating shop successfully"); + shop.setDirty(); + new ShopCreateSuccessEvent(shop, shop.getOwner()).callEvent(); + }) + .exceptionally(err -> { + processCreationFail(shop, shop.getOwner(), err); + return null; + }); + } + + + + + /** + * Returns a map of World - Chunk - Shop + * + * @return a map of World - Chunk - Shop + */ + @Override + public @NotNull Map>> getShops() { + return this.shops; + } + + /** + * Returns a map of Shops + * + * @param c The chunk to search. Referencing doesn't matter, only coordinates and world are + * used. + * @return Shops + */ + @Override + public @Nullable Map getShops(@NotNull Chunk c) { + return getShops(c.getWorld().getName(), c.getX(), c.getZ()); + } + + @Override + public @Nullable Map getShops(@NotNull String world, int chunkX, int chunkZ) { + final Map> inWorld = this.getShops(world); + if (inWorld == null) { + return null; + } + return inWorld.get(new SimpleShopChunk(world, chunkX, chunkZ)); + } + + @Override + public @Nullable Map getShops(@NotNull ShopChunk shopChunk) { + return getShops(shopChunk.getWorld(), shopChunk.getX(), shopChunk.getZ()); + } + + /** + * Returns a map of Chunk - Shop + * + * @param world The name of the world (case sensitive) to get the list of shops from + * @return a map of Chunk - Shop + */ + @Override + public @Nullable Map> getShops(@NotNull String world) { + return this.shops.get(world); + } + + /** + * Get the all shops in the world. + * + * @param world The world you want get the shops. + * @return The list have this world all shops + */ + @Override + public @NotNull List getShopsInWorld(@NotNull World world) { + final List worldShops = new ArrayList<>(); + for (final Shop shop : getAllShops()) { + Location location = shop.getLocation(); + if (location.isWorldLoaded() && Objects.equals(location.getWorld(), world)) { + worldShops.add(shop); + } + } + return worldShops; + } + + @Override + public @NotNull List getShopsInWorld(@NotNull String worldName) { + final List worldShops = new ArrayList<>(); + for (final Shop shop : getAllShops()) { + Location location = shop.getLocation(); + if (location.isWorldLoaded() && StringUtils.equals(worldName, location.getWorld().getName())) { + worldShops.add(shop); + } + } + return worldShops; + } + + + @Override + @NotNull + public CompletableFuture<@NotNull ShopInventoryCountCache> queryShopInventoryCacheInDatabase(@NotNull Shop shop) { + Util.ensureThread(true); + return plugin.getDatabaseHelper().queryInventoryCache(shop.getShopId()); + } + + + static class TagParser { + private final List tags; + private final ShopManager shopManager; + private final UUID tagger; + private final Map> singleCaching = new HashMap<>(); + + public TagParser(UUID tagger, ShopManager shopManager, List tags) { + Util.ensureThread(true); + this.shopManager = shopManager; + this.tags = tags; + this.tagger = tagger; + } + + public List parseTags() { + List finalShop = new ArrayList<>(); + for (String tag : tags) { + ParseResult result = parseSingleTag(tag); + if (result.getBehavior() == Behavior.INCLUDE) { + finalShop.addAll(result.getShops()); + } else if (result.getBehavior() == Behavior.EXCLUDE) { + finalShop.removeAll(result.getShops()); + } + } + return finalShop; + } + + public ParseResult parseSingleTag(String tag) throws IllegalArgumentException { + Util.ensureThread(true); + Behavior behavior = Behavior.INCLUDE; + if (tag.startsWith("-")) { + behavior = Behavior.EXCLUDE; + } + String tagName = tag.substring(1); + if (tagName.isEmpty()) { + throw new IllegalArgumentException("Tag name can't be empty"); + } + List shops = singleCaching.computeIfAbsent(tag, (t) -> shopManager.queryTaggedShops(tagger, t).join()); + return new ParseResult(behavior, shops); + } + + enum Behavior { + INCLUDE, + EXCLUDE + } + + @AllArgsConstructor + @Data + static class ParseResult { + private final Behavior behavior; + private final List shops; + } + } + +} diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 474bd4b45b..98e15c9ff8 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -7,45 +7,29 @@ import com.ghostchu.quickshop.api.localization.text.ProxiedLocale; import com.ghostchu.quickshop.api.obj.QUser; import com.ghostchu.quickshop.api.shop.*; -import com.ghostchu.quickshop.api.shop.cache.ShopCache; import com.ghostchu.quickshop.api.shop.cache.ShopCacheNamespacedKey; -import com.ghostchu.quickshop.api.shop.cache.ShopInventoryCountCache; import com.ghostchu.quickshop.api.shop.permission.BuiltInShopPermission; import com.ghostchu.quickshop.common.util.CalculateUtil; -import com.ghostchu.quickshop.common.util.QuickExecutor; import com.ghostchu.quickshop.common.util.RomanNumber; import com.ghostchu.quickshop.economy.SimpleBenefit; import com.ghostchu.quickshop.economy.SimpleEconomyTransaction; import com.ghostchu.quickshop.obj.QUserImpl; -import com.ghostchu.quickshop.shop.cache.BoxedShop; -import com.ghostchu.quickshop.shop.cache.SimpleShopCache; import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapper; import com.ghostchu.quickshop.util.ChatSheetPrinter; import com.ghostchu.quickshop.util.MsgUtil; import com.ghostchu.quickshop.util.PackageUtil; import com.ghostchu.quickshop.util.Util; -import com.ghostchu.quickshop.util.economyformatter.EconomyFormatter; import com.ghostchu.quickshop.util.holder.Result; import com.ghostchu.quickshop.util.logger.Log; -import com.ghostchu.quickshop.util.performance.PerfMonitor; import com.ghostchu.simplereloadlib.ReloadResult; import com.ghostchu.simplereloadlib.ReloadStatus; import com.ghostchu.simplereloadlib.Reloadable; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.collect.MapMaker; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import io.papermc.lib.PaperLib; -import lombok.AllArgsConstructor; -import lombok.Data; import lombok.Getter; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.format.NamedTextColor; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -67,35 +51,17 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import java.util.function.Function; /** * Manage a lot of shops. */ -public class SimpleShopManager implements ShopManager, Reloadable { - - private static final DecimalFormat STANDARD_FORMATTER = new DecimalFormat("#.#########"); - private final Map>> shops = Maps.newConcurrentMap(); - private final Set loadedShops = Sets.newConcurrentHashSet(); // Handle it by collection to reduce - // the performance impact on busy server - private final InteractiveManager interactiveManager; - private final QuickShop plugin; - private final Cache shopRuntimeUUIDCaching = - CacheBuilder.newBuilder() - .expireAfterAccess(10, TimeUnit.MINUTES) - .maximumSize(50) - .weakValues() - .initialCapacity(50) - .build(); - private final EconomyFormatter formatter; - @Getter - private ShopCache shopCache; +public class SimpleShopManager extends AbstractShopManager implements ShopManager, Reloadable { + protected final InteractiveManager interactiveManager; @Getter @Nullable private QUser cacheTaxAccount; @@ -119,15 +85,23 @@ public class SimpleShopManager implements ShopManager, Reloadable { private boolean useShopCache; public SimpleShopManager(@NotNull QuickShop plugin) { + super(plugin); Util.ensureThread(false); - this.plugin = plugin; - this.interactiveManager = new InteractiveManager(plugin); - this.formatter = new EconomyFormatter(plugin, plugin::getEconomy); plugin.getReloadManager().register(this); + this.interactiveManager = new InteractiveManager(plugin); init(); } - private void init() { + + @Override + public @NotNull ShopManager.InteractiveManager getInteractiveManager() { + return this.interactiveManager; + } + + + @Override + public void init() { + super.init(); Log.debug("Loading caching tax account..."); String taxAccount = plugin.getConfig().getString("tax-account", "tax"); if (!taxAccount.isEmpty()) { @@ -160,21 +134,11 @@ private void init() { this.sendStockMessageToStaff = plugin.getConfig().getBoolean("shop.sending-stock-message-to-staffs"); this.useShopableChecks = PackageUtil.parsePackageProperly("shoppableChecks").asBoolean(false); this.useShopCache = plugin.getConfig().getBoolean("shop.use-cache", true); - Map<@NotNull ShopCacheNamespacedKey, @NotNull Pair<@NotNull Function, @Nullable Cache>> map = new HashMap<>(); - // SINGLE - map.put(ShopCacheNamespacedKey.SINGLE, new ImmutablePair<>(this::getShop, null)); - map.put(ShopCacheNamespacedKey.INCLUDE_ATTACHED, new ImmutablePair<>(this::getShopIncludeAttached, null)); - this.shopCache = new SimpleShopCache(plugin, map); + } @Override - public void actionBuying( - @NotNull Player buyer, - @NotNull InventoryWrapper buyerInventory, - @NotNull AbstractEconomy eco, - @NotNull Info info, - @NotNull Shop shop, - int amount) { + public void actionBuying(@NotNull Player buyer, @NotNull InventoryWrapper buyerInventory, @NotNull AbstractEconomy eco, @NotNull Info info, @NotNull Shop shop, int amount) { QUser buyerQUser = QUserImpl.createFullFilled(buyer); if (!plugin.perm().hasPermission(buyer, "quickshop.other.use") && !shop.playerAuthorize(buyer.getUniqueId(), BuiltInShopPermission.PURCHASE)) { plugin.text().of("no-permission").send(); @@ -194,10 +158,7 @@ public void actionBuying( int count = Util.countItems(buyerInventory, shop); // Not enough items if (amount > count) { - plugin.text().of(buyer, - "you-dont-have-that-many-items", - Component.text(count), - Util.getItemStackName(shop.getItem())).send(); + plugin.text().of(buyer, "you-dont-have-that-many-items", Component.text(count), Util.getItemStackName(shop.getItem())).send(); return; } if (amount < 1) { @@ -226,29 +187,17 @@ public void actionBuying( } } SimpleEconomyTransaction transaction; - SimpleEconomyTransaction.SimpleEconomyTransactionBuilder builder = SimpleEconomyTransaction.builder() - .core(eco) - .amount(total) - .taxModifier(taxModifier) - .taxAccount(taxAccount) - .currency(shop.getCurrency()) - .world(shop.getLocation().getWorld()) - .to(buyerQUser); + SimpleEconomyTransaction.SimpleEconomyTransactionBuilder builder = SimpleEconomyTransaction.builder().core(eco).amount(total).taxModifier(taxModifier).taxAccount(taxAccount).currency(shop.getCurrency()).world(shop.getLocation().getWorld()).to(buyerQUser); if (shop.isUnlimited() && plugin.getConfig().getBoolean("tax-free-for-unlimited-shop", false)) { builder.taxModifier(0.0d); } - if (!shop.isUnlimited() - || (plugin.getConfig().getBoolean("shop.pay-unlimited-shop-owners") - && shop.isUnlimited())) { + if (!shop.isUnlimited() || (plugin.getConfig().getBoolean("shop.pay-unlimited-shop-owners") && shop.isUnlimited())) { transaction = builder.from(shop.getOwner()).build(); } else { transaction = builder.from(null).build(); } if (!transaction.checkBalance()) { - plugin.text().of(buyer, "the-owner-cant-afford-to-buy-from-you", - format(total, shop.getLocation().getWorld(), shop.getCurrency()), - format(eco.getBalance(shop.getOwner(), shop.getLocation().getWorld(), - shop.getCurrency()), shop.getLocation().getWorld(), shop.getCurrency())).send(); + plugin.text().of(buyer, "the-owner-cant-afford-to-buy-from-you", format(total, shop.getLocation().getWorld(), shop.getCurrency()), format(eco.getBalance(shop.getOwner(), shop.getLocation().getWorld(), shop.getCurrency()), shop.getLocation().getWorld(), shop.getCurrency())).send(); return; } if (!transaction.failSafeCommit()) { @@ -276,21 +225,15 @@ private void notifySold(@NotNull QUser buyerQUser, @NotNull Shop shop, int amoun Util.asyncThreadRun(() -> { String langCode = plugin.text().findRelativeLanguages(buyerQUser, true).getLocale(); List sendList = new ArrayList<>(); - Component notify = plugin.text().of("player-sold-to-your-store", buyerQUser.getDisplay(), - amount, - Util.getItemStackName(shop.getItem())).forLocale(langCode); + Component notify = plugin.text().of("player-sold-to-your-store", buyerQUser.getDisplay(), amount, Util.getItemStackName(shop.getItem())).forLocale(langCode); notify = plugin.getPlatform().setItemStackHoverEvent(notify, shop.getItem()); sendList.add(notify); if (space == amount) { Component spaceWarn; if (shop.getShopName() == null) { - spaceWarn = plugin.text().of("shop-out-of-space", - shop.getLocation().getBlockX(), - shop.getLocation().getBlockY(), - shop.getLocation().getBlockZ()).forLocale(langCode); + spaceWarn = plugin.text().of("shop-out-of-space", shop.getLocation().getBlockX(), shop.getLocation().getBlockY(), shop.getLocation().getBlockZ()).forLocale(langCode); } else { - spaceWarn = plugin.text().of("shop-out-of-space-name", shop.getShopName(), - Util.getItemStackName(shop.getItem())).forLocale(langCode); + spaceWarn = plugin.text().of("shop-out-of-space-name", shop.getShopName(), Util.getItemStackName(shop.getItem())).forLocale(langCode); } spaceWarn = plugin.getPlatform().setItemStackHoverEvent(spaceWarn, shop.getItem()); sendList.add(spaceWarn); @@ -357,24 +300,7 @@ public void actionCreate(@NotNull Player p, Info info, @NotNull String message) BlockState state = info.getLocation().getBlock().getState(); if (state instanceof InventoryHolder holder) { // Create the basic shop - ContainerShop shop = new ContainerShop( - plugin, - -1, - info.getLocation(), - price, - info.getItem(), - createQUser, - false, - ShopType.SELLING, - new YamlConfiguration(), - null, - false, - null, - plugin.getJavaPlugin().getName(), - plugin.getInventoryWrapperManager().mklink(new BukkitInventoryWrapper((holder).getInventory())), - null, - Collections.emptyMap(), - new SimpleBenefit()); + ContainerShop shop = new ContainerShop(plugin, -1, info.getLocation(), price, info.getItem(), createQUser, false, ShopType.SELLING, new YamlConfiguration(), null, false, null, plugin.getJavaPlugin().getName(), plugin.getInventoryWrapperManager().mklink(new BukkitInventoryWrapper((holder).getInventory())), null, Collections.emptyMap(), new SimpleBenefit()); createShop(shop, info.getSignBlock(), info.isBypassed()); } else { plugin.text().of(p, "invalid-container").send(); @@ -382,13 +308,7 @@ public void actionCreate(@NotNull Player p, Info info, @NotNull String message) } @Override - public void actionSelling( - @NotNull Player seller, - @NotNull InventoryWrapper sellerInventory, - @NotNull AbstractEconomy eco, - @NotNull Info info, - @NotNull Shop shop, - int amount) { + public void actionSelling(@NotNull Player seller, @NotNull InventoryWrapper sellerInventory, @NotNull AbstractEconomy eco, @NotNull Info info, @NotNull Shop shop, int amount) { Util.ensureThread(false); QUser sellerQUser = QUserImpl.createFullFilled(seller); @@ -404,8 +324,7 @@ public void actionSelling( stock = 10000; } if (stock < amount) { - plugin.text().of(seller, "shop-stock-too-low", Component.text(stock), - Util.getItemStackName(shop.getItem())).send(); + plugin.text().of(seller, "shop-stock-too-low", Component.text(stock), Util.getItemStackName(shop.getItem())).send(); return; } int playerSpace = Util.countSpace(sellerInventory, shop); @@ -445,32 +364,18 @@ public void actionSelling( taxAccount = this.cacheTaxAccount; } } - SimpleEconomyTransaction.SimpleEconomyTransactionBuilder builder = SimpleEconomyTransaction.builder() - .core(eco) - .from(sellerQUser) - .amount(total) - .taxModifier(taxModifier) - .taxAccount(taxAccount) - .benefit(shop.getShopBenefit()) - .world(shop.getLocation().getWorld()) - .currency(shop.getCurrency()); + SimpleEconomyTransaction.SimpleEconomyTransactionBuilder builder = SimpleEconomyTransaction.builder().core(eco).from(sellerQUser).amount(total).taxModifier(taxModifier).taxAccount(taxAccount).benefit(shop.getShopBenefit()).world(shop.getLocation().getWorld()).currency(shop.getCurrency()); if (shop.isUnlimited() && plugin.getConfig().getBoolean("tax-free-for-unlimited-shop", false)) { builder.taxModifier(0.0d); } - if (!shop.isUnlimited() - || (plugin.getConfig().getBoolean("shop.pay-unlimited-shop-owners") - && shop.isUnlimited())) { + if (!shop.isUnlimited() || (plugin.getConfig().getBoolean("shop.pay-unlimited-shop-owners") && shop.isUnlimited())) { transaction = builder.to(shop.getOwner()).build(); } else { transaction = builder.to(null).build(); } if (!transaction.checkBalance()) { - plugin.text().of(seller, "you-cant-afford-to-buy", - format(total, shop.getLocation().getWorld(), shop.getCurrency()), - format(eco.getBalance(sellerQUser, shop.getLocation().getWorld(), - shop.getCurrency()), shop.getLocation().getWorld(), - shop.getCurrency())).send(); + plugin.text().of(seller, "you-cant-afford-to-buy", format(total, shop.getLocation().getWorld(), shop.getCurrency()), format(eco.getBalance(sellerQUser, shop.getLocation().getWorld(), shop.getCurrency()), shop.getLocation().getWorld(), shop.getCurrency())).send(); return; } if (!transaction.failSafeCommit()) { @@ -492,37 +397,6 @@ public void actionSelling( notifyBought(sellerQUser, shop, amount, stock, transaction.getTax(), total); } - /** - * Adds a shop to the world. Does NOT require the chunk or world to be loaded Call shop.onLoad - * by yourself - * - * @param shop The shop to add - */ - private void addShopToLookupTable(@NotNull Shop shop) { - String world = shop.getLocation().getWorld().getName(); - Map> inWorld = - this.getShops() - .computeIfAbsent(world, k -> new MapMaker().initialCapacity(3).makeMap()); - // There's no world storage yet. We need to create that map. - // Put it in the data universe - // Calculate the chunks coordinates. These are 1,2,3 for each chunk, NOT - // location rounded to the nearest 16. - int x = (int) Math.floor((shop.getLocation().getBlockX()) / 16.0); - int z = (int) Math.floor((shop.getLocation().getBlockZ()) / 16.0); - // Get the chunk set from the world info - ShopChunk shopChunk = new SimpleShopChunk(world, x, z); - Map inChunk = - inWorld.computeIfAbsent(shopChunk, k -> new MapMaker().initialCapacity(1).makeMap()); - // That chunk data hasn't been created yet - Create it! - // Put it in the world - // Put the shop in its location in the chunk list. - inChunk.put(shop.getLocation(), shop); - } - - @Override - public void bakeShopRuntimeRandomUniqueIdCache(@NotNull Shop shop) { - shopRuntimeUUIDCaching.put(shop.getRuntimeRandomUniqueId(), shop); - } /** * Removes all shops from memory and the world. Does not delete them from the database. Call @@ -534,10 +408,7 @@ public void clear() { plugin.logger().info("Unloading loaded shops..."); getLoadedShops().forEach(this::unloadShop); plugin.logger().info("Saving shops, please allow up to 30 seconds for flush changes into database..."); - CompletableFuture saveTask = CompletableFuture.allOf( - plugin.getShopManager().getAllShops().stream().filter(Shop::isDirty) - .map(Shop::update) - .toArray(CompletableFuture[]::new)); + CompletableFuture saveTask = CompletableFuture.allOf(plugin.getShopManager().getAllShops().stream().filter(Shop::isDirty).map(Shop::update).toArray(CompletableFuture[]::new)); try { if (PackageUtil.parsePackageProperly("unlimitedWait").asBoolean()) { saveTask.get(); @@ -551,7 +422,7 @@ public void clear() { } this.interactiveManager.reset(); this.shops.clear(); - this.shopCache.invalidateAll(null); + shopCache.invalidateAll(null); } /** @@ -588,9 +459,7 @@ public void createShop(@NotNull Shop shop, @Nullable Block signBlock, boolean by return; } // Check if item has been blacklisted - if (plugin.getShopItemBlackList().isBlacklisted(shop.getItem()) - && !plugin.perm() - .hasPermission(p, "quickshop.bypass." + shop.getItem().getType().name().toLowerCase(Locale.ROOT))) { + if (plugin.getShopItemBlackList().isBlacklisted(shop.getItem()) && !plugin.perm().hasPermission(p, "quickshop.bypass." + shop.getItem().getType().name().toLowerCase(Locale.ROOT))) { plugin.text().of(p, "blacklisted-item").send(); return; } @@ -623,8 +492,7 @@ public void createShop(@NotNull Shop shop, @Nullable Block signBlock, boolean by } // Check if player and server allow double chest shop - if (Util.isDoubleChest(shop.getLocation().getBlock().getBlockData()) - && !plugin.perm().hasPermission(p, "quickshop.create.double")) { + if (Util.isDoubleChest(shop.getLocation().getBlock().getBlockData()) && !plugin.perm().hasPermission(p, "quickshop.create.double")) { plugin.text().of(p, "no-double-chests").send(); return; } @@ -638,9 +506,7 @@ public void createShop(@NotNull Shop shop, @Nullable Block signBlock, boolean by } } else { Material signType = signBlock.getType(); - if (signType != Material.WATER - && !signType.isAir() - && !allowNoSpaceForSign) { + if (signType != Material.WATER && !signType.isAir() && !allowNoSpaceForSign) { plugin.text().of(p, "failed-to-put-sign").send(); return; } @@ -650,16 +516,12 @@ public void createShop(@NotNull Shop shop, @Nullable Block signBlock, boolean by // Price limit checking PriceLimiterCheckResult priceCheckResult = this.priceLimiter.check(p, shop.getItem(), plugin.getCurrency(), shop.getPrice()); switch (priceCheckResult.getStatus()) { - case REACHED_PRICE_MIN_LIMIT -> plugin.text().of(p, "price-too-cheap", - Component.text((useDecFormat) ? MsgUtil.decimalFormat(priceCheckResult.getMax()) - : Double.toString(priceCheckResult.getMin()))).send(); - case REACHED_PRICE_MAX_LIMIT -> plugin.text().of(p, "price-too-high", - Component.text((useDecFormat) ? MsgUtil.decimalFormat(priceCheckResult.getMax()) - : Double.toString(priceCheckResult.getMin()))).send(); - case PRICE_RESTRICTED -> plugin.text().of(p, "restricted-prices", - Util.getItemStackName(shop.getItem()), - Component.text(priceCheckResult.getMin()), - Component.text(priceCheckResult.getMax())).send(); + case REACHED_PRICE_MIN_LIMIT -> + plugin.text().of(p, "price-too-cheap", Component.text((useDecFormat) ? MsgUtil.decimalFormat(priceCheckResult.getMax()) : Double.toString(priceCheckResult.getMin()))).send(); + case REACHED_PRICE_MAX_LIMIT -> + plugin.text().of(p, "price-too-high", Component.text((useDecFormat) ? MsgUtil.decimalFormat(priceCheckResult.getMax()) : Double.toString(priceCheckResult.getMin()))).send(); + case PRICE_RESTRICTED -> + plugin.text().of(p, "restricted-prices", Util.getItemStackName(shop.getItem()), Component.text(priceCheckResult.getMin()), Component.text(priceCheckResult.getMax())).send(); case NOT_VALID -> plugin.text().of(p, "not-a-number", shop.getPrice()).send(); case NOT_A_WHOLE_NUMBER -> plugin.text().of(p, "not-a-integer", shop.getPrice()).send(); case PASS -> { @@ -678,21 +540,9 @@ public void createShop(@NotNull Shop shop, @Nullable Block signBlock, boolean by createCost = 0; } if (createCost > 0) { - SimpleEconomyTransaction economyTransaction = - SimpleEconomyTransaction.builder() - .taxAccount(cacheTaxAccount) - .taxModifier(0.0) - .core(plugin.getEconomy()) - .from(QUserImpl.createFullFilled(p)) - .to(null) - .amount(createCost) - .currency(plugin.getCurrency()) - .world(shop.getLocation().getWorld()) - .build(); + SimpleEconomyTransaction economyTransaction = SimpleEconomyTransaction.builder().taxAccount(cacheTaxAccount).taxModifier(0.0).core(plugin.getEconomy()).from(QUserImpl.createFullFilled(p)).to(null).amount(createCost).currency(plugin.getCurrency()).world(shop.getLocation().getWorld()).build(); if (!economyTransaction.checkBalance()) { - plugin.text().of(p, "you-cant-afford-a-new-shop", - format(createCost, shop.getLocation().getWorld(), - shop.getCurrency())).send(); + plugin.text().of(p, "you-cant-afford-a-new-shop", format(createCost, shop.getLocation().getWorld(), shop.getCurrency())).send(); return; } if (!economyTransaction.failSafeCommit()) { @@ -729,308 +579,42 @@ public void createShop(@NotNull Shop shop, @Nullable Block signBlock, boolean by } /** - * Format the price use formatter - * - * @param d price - * @return formatted price - */ - @Override - public @NotNull String format(double d, @NotNull World world, @Nullable String currency) { - return formatter.format(d, world, currency); - } - - /** - * Format the price use formatter - * - * @param d price - * @return formatted price - */ - @Override - public @NotNull String format(double d, @NotNull Shop shop) { - return formatter.format(d, shop); - } - - /** - * @return Returns the Map. Info contains what their last question etc was. - * @deprecated Use getInteractiveManager instead. This way won't trigger the BungeeCord notification. - */ - @SuppressWarnings("removal") - @Override - @Deprecated(forRemoval = true) - public @NotNull Map getActions() { - return this.interactiveManager.actions; - } - - /** - * Returns all shops in the memory, include unloaded. - * - *

Make sure you have caching this, because this need a while to get all shops - * - * @return All shop in the database - */ - @Override - public @NotNull List getAllShops() { - try (PerfMonitor ignored = new PerfMonitor("Getting all shops")) { - final List shopsCollected = new ArrayList<>(); - for (final Map> shopMapData : getShops().values()) { - for (final Map shopData : shopMapData.values()) { - shopsCollected.addAll(shopData.values()); - } - } - return shopsCollected; - } - } - - /** - * Get all loaded shops. - * - * @return All loaded shops. - */ - @Override - public @NotNull Set getLoadedShops() { - return this.loadedShops; - } - - /** - * Get a players all shops. - * - *

Make sure you have caching this, because this need a while to get player's all shops - * - * @param playerUUID The player's uuid. - * @return The list have this player's all shops. - */ - @Override - public @NotNull List getAllShops(@NotNull QUser playerUUID) { - final List playerShops = new ArrayList<>(10); - for (final Shop shop : getAllShops()) { - if (shop.getOwner().equals(playerUUID)) { - playerShops.add(shop); - } - } - return playerShops; - } - - @Override - public @NotNull List getAllShops(@NotNull UUID playerUUID) { - final List playerShops = new ArrayList<>(10); - for (final Shop shop : getAllShops()) { - UUID shopUuid = shop.getOwner().getUniqueIdIfRealPlayer().orElse(null); - if (playerUUID.equals(shopUuid)) { - playerShops.add(shop); - } - } - return playerShops; - } - - @Override - public @NotNull PriceLimiter getPriceLimiter() { - return this.priceLimiter; - } - - /** - * Gets a shop by shop Id - * - * @param shopId shop Id - * @return The shop object - */ - @Override - public @Nullable Shop getShop(long shopId) { - for (Shop shop : getAllShops()) { - if (shop.getShopId() == shopId) { - return shop; - } - } - return null; - } - - /** - * Gets a shop in a specific location - * - * @param loc The location to get the shop from - * @return The shop at that location - */ - @Override - public @Nullable Shop getShop(@NotNull Location loc) { - return getShop(loc, !useShopableChecks); - } - - @Override - public @Nullable Shop getShopViaCache(@NotNull Location loc) { - if (!this.useShopCache) { - return getShop(loc); - } - return shopCache.get(ShopCacheNamespacedKey.SINGLE, loc, true); - } - - /** - * Gets a shop in a specific location + * Checks other plugins to make sure they can use the chest they're making a shop. * - * @param loc The location to get the shop from - * @param skipShopableChecking whether to check is shopable, this will cause chunk loading - * @return The shop at that location + * @param p The player to check + * @return True if they're allowed to place a shop there. */ @Override - public @Nullable Shop getShop(@NotNull Location loc, boolean skipShopableChecking) { - if (!skipShopableChecking && !Util.isShoppables(loc.getBlock().getType())) { - return null; - } - ShopChunk shopChunk = SimpleShopChunk.fromLocation(loc); - final Map inChunk = getShops(shopChunk); - if (inChunk == null) { - return null; - } - loc = loc.clone(); - // Fix double chest XYZ issue - loc.setX(loc.getBlockX()); - loc.setY(loc.getBlockY()); - loc.setZ(loc.getBlockZ()); - // We can do this because WorldListener updates the world reference so - // the world in loc is the same as world in inChunk.get(loc) - return inChunk.get(loc); - } - - @Override - @Nullable - public Shop getShopFromRuntimeRandomUniqueId(@NotNull UUID runtimeRandomUniqueId) { - return getShopFromRuntimeRandomUniqueId(runtimeRandomUniqueId, false); - } - - @Override - @Nullable - public Shop getShopFromRuntimeRandomUniqueId( - @NotNull UUID runtimeRandomUniqueId, boolean includeInvalid) { - Shop shop = shopRuntimeUUIDCaching.getIfPresent(runtimeRandomUniqueId); - if (shop == null) { - for (Shop shopWithoutCache : this.getLoadedShops()) { - if (shopWithoutCache.getRuntimeRandomUniqueId().equals(runtimeRandomUniqueId)) { - return shopWithoutCache; + public boolean isReachedLimit(@NotNull QUser p) { + Util.ensureThread(false); + if (plugin.getRankLimiter().isLimit()) { + int owned = 0; + if (useOldCanBuildAlgorithm) { + owned = getAllShops(p).size(); + } else { + for (final Shop shop : getAllShops(p)) { + if (!shop.isUnlimited()) { + owned++; + } } } - return null; - } - if (includeInvalid) { - return shop; - } - if (shop.isValid()) { - return shop; - } - return null; - } - - /** - * Gets a shop in a specific location Include the attached shop, e.g DoubleChest shop. - * - * @param loc The location to get the shop from - * @return The shop at that location - */ - @Override - public @Nullable Shop getShopIncludeAttached(@Nullable Location loc) { - if (loc == null) { - Log.debug("Location is null."); - return null; - } - return findShopIncludeAttached(loc, false); - } - - @Override - public @Nullable Shop getShopIncludeAttachedViaCache(@Nullable Location loc) { - if (loc == null) { - Log.debug("Location is null."); - return null; - } - if (!this.useShopCache) { - return getShopIncludeAttached(loc); - } - return shopCache.get(ShopCacheNamespacedKey.INCLUDE_ATTACHED, loc, true); - } - - /** - * Returns a new shop iterator object, allowing iteration over shops easily, instead of sorting - * through a 3D map. - * - * @return a new shop iterator object. - */ - @Override - public @NotNull Iterator getShopIterator() { - return new ShopIterator(); - } - - /** - * Returns a map of World - Chunk - Shop - * - * @return a map of World - Chunk - Shop - */ - @Override - public @NotNull Map>> getShops() { - return this.shops; - } - - /** - * Returns a map of Shops - * - * @param c The chunk to search. Referencing doesn't matter, only coordinates and world are - * used. - * @return Shops - */ - @Override - public @Nullable Map getShops(@NotNull Chunk c) { - return getShops(c.getWorld().getName(), c.getX(), c.getZ()); - } - - @Override - public @Nullable Map getShops(@NotNull String world, int chunkX, int chunkZ) { - final Map> inWorld = this.getShops(world); - if (inWorld == null) { - return null; + int max = plugin.getRankLimiter().getShopLimit(p); + Log.debug("CanBuildShop check for " + p.getDisplay() + " owned: " + owned + "; max: " + max); + return owned + 1 > max; } - return inWorld.get(new SimpleShopChunk(world, chunkX, chunkZ)); - } - - @Override - public @Nullable Map getShops(@NotNull ShopChunk shopChunk) { - return getShops(shopChunk.getWorld(), shopChunk.getX(), shopChunk.getZ()); - } - - /** - * Returns a map of Chunk - Shop - * - * @param world The name of the world (case sensitive) to get the list of shops from - * @return a map of Chunk - Shop - */ - @Override - public @Nullable Map> getShops(@NotNull String world) { - return this.shops.get(world); + return false; } /** - * Get the all shops in the world. - * - * @param world The world you want get the shops. - * @return The list have this world all shops + * Change the owner to unlimited shop owner. + * It defined in configuration. */ @Override - public @NotNull List getShopsInWorld(@NotNull World world) { - final List worldShops = new ArrayList<>(); - for (final Shop shop : getAllShops()) { - Location location = shop.getLocation(); - if (location.isWorldLoaded() && Objects.equals(location.getWorld(), world)) { - worldShops.add(shop); - } - } - return worldShops; + public void migrateOwnerToUnlimitedShopOwner(@NotNull Shop shop) { + shop.setOwner(this.cacheUnlimitedShopAccount); + shop.setSignText(plugin.text().findRelativeLanguages(shop.getOwner(), false)); } - @Override - public @NotNull List getShopsInWorld(@NotNull String worldName) { - final List worldShops = new ArrayList<>(); - for (final Shop shop : getAllShops()) { - Location location = shop.getLocation(); - if (location.isWorldLoaded() && StringUtils.equals(worldName, location.getWorld().getName())) { - worldShops.add(shop); - } - } - return worldShops; - } @Override public double getTax(@NotNull Shop shop, @NotNull QUser p) { @@ -1080,8 +664,7 @@ public void handleChat(@NotNull Player p, @NotNull String msg) { if (info == null) { return; // multithreaded means this can happen } - if (info.getLocation().getWorld() != p.getLocation().getWorld() - || info.getLocation().distanceSquared(p.getLocation()) > 25) { + if (info.getLocation().getWorld() != p.getLocation().getWorld() || info.getLocation().distanceSquared(p.getLocation()) > 25) { plugin.text().of(p, "not-looking-at-shop").send(); return; } @@ -1094,166 +677,24 @@ public void handleChat(@NotNull Player p, @NotNull String msg) { }); } - /** - * Checks other plugins to make sure they can use the chest they're making a shop. - * - * @param p The player to check - * @return True if they're allowed to place a shop there. - */ - @Override - public boolean isReachedLimit(@NotNull QUser p) { - Util.ensureThread(false); - if (plugin.getRankLimiter().isLimit()) { - int owned = 0; - if (useOldCanBuildAlgorithm) { - owned = getAllShops(p).size(); + + private void refundShop(Shop shop) { + World world = shop.getLocation().getWorld(); + if (plugin.getConfig().getBoolean("shop.refund")) { + double cost = plugin.getConfig().getDouble("shop.cost"); + SimpleEconomyTransaction transaction; + if (plugin.getConfig().getBoolean("shop.refund-from-tax-account", false) && shop.getTaxAccountActual() != null) { + cost = Math.min(cost, plugin.getEconomy().getBalance(shop.getTaxAccountActual(), world, plugin.getCurrency())); + transaction = SimpleEconomyTransaction.builder().amount(cost).core(plugin.getEconomy()).currency(plugin.getCurrency()).world(world).from(shop.getTaxAccountActual()).to(shop.getOwner()).build(); } else { - for (final Shop shop : getAllShops(p)) { - if (!shop.isUnlimited()) { - owned++; - } - } + transaction = SimpleEconomyTransaction.builder().amount(cost).core(plugin.getEconomy()).currency(plugin.getCurrency()).world(world).to(shop.getOwner()).build(); + } + if (!transaction.failSafeCommit()) { + plugin.logger().warn("Shop deletion refund failed. Reason: {}", transaction.getLastError()); } - int max = plugin.getRankLimiter().getShopLimit(p); - Log.debug("CanBuildShop check for " + p.getDisplay() + " owned: " + owned + "; max: " + max); - return owned + 1 > max; } - return false; - } - - @Override - public void loadShop(@NotNull Shop shop) { - //noinspection deprecation - shop.handleLoading(); - this.loadedShops.add(shop); - } - - @Override - public void unloadShop(@NotNull Shop shop) { - unloadShop(shop, false); } - @Override - public void unloadShop(@NotNull Shop shop, boolean dontTouchWorld) { - //noinspection deprecation - shop.handleUnloading(dontTouchWorld); - this.loadedShops.remove(shop); - } - - /** - * Change the owner to unlimited shop owner. - * It defined in configuration. - */ - @Override - public void migrateOwnerToUnlimitedShopOwner(@NotNull Shop shop) { - shop.setOwner(this.cacheUnlimitedShopAccount); - shop.setSignText(plugin.text().findRelativeLanguages(shop.getOwner(), false)); - } - - @Override - public CompletableFuture registerShop(@NotNull Shop shop, boolean persist) { - // save to database - addShopToLookupTable(shop); - if (!persist) return CompletableFuture.completedFuture(null); - return plugin.getDatabaseHelper().createData(shop).thenCompose(plugin.getDatabaseHelper()::createShop) - .thenAccept(id -> { - Log.debug("DEBUG: Setting shop id"); - shop.setShopId(id); - Log.debug("DEBUG: Creating shop map"); - plugin.getDatabaseHelper().createShopMap(id, shop.getLocation()).join(); - Log.debug("DEBUG: Creating shop successfully"); - shop.setDirty(); - new ShopCreateSuccessEvent(shop, shop.getOwner()).callEvent(); - }) - .exceptionally(err -> { - processCreationFail(shop, shop.getOwner(), err); - return null; - }); - } - - @Override - public CompletableFuture unregisterShop(@NotNull Shop shop, boolean persist) { - removeShopFromLookupTable(shop); - if (!persist) return CompletableFuture.completedFuture(null); - Location loc = shop.getLocation(); - return plugin.getDatabaseHelper().removeShopMap(loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()) - .thenCombine(plugin.getDatabaseHelper().removeShop(shop.getShopId()), (a, b) -> null) - .exceptionally(throwable -> { - plugin.logger().warn("Failed to remove shop from database", throwable); - return null; - }); - } - - @Override - public void deleteShop(@NotNull Shop shop) { - ShopDeleteEvent shopDeleteEvent = new ShopDeleteEvent(shop, false); - if (shopDeleteEvent.callCancellableEvent()) { - Log.debug("Shop delete was cancelled by 3rd-party plugin"); - return; - } - for (Sign s : shop.getSigns()) { - s.getBlock().setType(Material.AIR); - } - refundShop(shop); - unloadShop(shop); - unregisterShop(shop, true); - } - - private void refundShop(Shop shop) { - World world = shop.getLocation().getWorld(); - if (plugin.getConfig().getBoolean("shop.refund")) { - double cost = plugin.getConfig().getDouble("shop.cost"); - SimpleEconomyTransaction transaction; - if (plugin.getConfig().getBoolean("shop.refund-from-tax-account", false) && shop.getTaxAccountActual() != null) { - cost = Math.min(cost, plugin.getEconomy().getBalance(shop.getTaxAccountActual(), world, plugin.getCurrency())); - transaction = - SimpleEconomyTransaction.builder() - .amount(cost) - .core(plugin.getEconomy()) - .currency(plugin.getCurrency()) - .world(world) - .from(shop.getTaxAccountActual()) - .to(shop.getOwner()) - .build(); - } else { - transaction = - SimpleEconomyTransaction.builder() - .amount(cost) - .core(plugin.getEconomy()) - .currency(plugin.getCurrency()) - .world(world) - .to(shop.getOwner()) - .build(); - } - if (!transaction.failSafeCommit()) { - plugin.logger().warn("Shop deletion refund failed. Reason: {}", transaction.getLastError()); - } - } - } - - /** - * Removes a shop from the world. Does NOT remove it from the database. * REQUIRES * the world - * to be loaded Call shop.onUnload by your self. - * - * @param shop The shop to remove - */ - private void removeShopFromLookupTable(@NotNull Shop shop) { - Location loc = shop.getLocation(); - String world = Objects.requireNonNull(loc.getWorld()).getName(); - Map> inWorld = this.getShops().get(world); - if (inWorld == null) { - return; - } - int x = (int) Math.floor((loc.getBlockX()) / 16.0); - int z = (int) Math.floor((loc.getBlockZ()) / 16.0); - ShopChunk shopChunk = new SimpleShopChunk(world, x, z); - Map inChunk = inWorld.get(shopChunk); - if (inChunk == null) { - return; - } - inChunk.remove(loc); - shopCache.invalidate(null, shop.getLocation()); - } /** * Send a purchaseSuccess message for a player. @@ -1268,16 +709,9 @@ public void sendPurchaseSuccess(@NotNull QUser purchaser, @NotNull Shop shop, in chatSheetPrinter.printHeader(); chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.successful-purchase").forLocale()); if (showTax) { - chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price-tax", - Component.text(amount * shop.getItem().getAmount()), - Util.getItemStackName(shop.getItem()), - format(total, shop), - tax).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price-tax", Component.text(amount * shop.getItem().getAmount()), Util.getItemStackName(shop.getItem()), format(total, shop), tax).forLocale()); } else { - chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price", - Component.text(amount * shop.getItem().getAmount()), - Util.getItemStackName(shop.getItem()), - format(total, shop)).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price", Component.text(amount * shop.getItem().getAmount()), Util.getItemStackName(shop.getItem()), format(total, shop)).forLocale()); } MsgUtil.printEnchantment(shop, chatSheetPrinter); chatSheetPrinter.printFooter(); @@ -1295,17 +729,11 @@ public void sendSellSuccess(@NotNull QUser seller, @NotNull Shop shop, int amoun ChatSheetPrinter chatSheetPrinter = new ChatSheetPrinter(seller); chatSheetPrinter.printHeader(); chatSheetPrinter.printLine(plugin.text().of(seller, "menu.successfully-sold").forLocale()); - chatSheetPrinter.printLine( - plugin.text().of(seller, - "menu.item-name-and-price", - amount, - Util.getItemStackName(shop.getItem()), - format(total, shop)).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(seller, "menu.item-name-and-price", amount, Util.getItemStackName(shop.getItem()), format(total, shop)).forLocale()); if (showTax) { if (tax != 0) { if (!seller.equals(shop.getOwner())) { - chatSheetPrinter.printLine( - plugin.text().of(seller, "menu.sell-tax", format(tax, shop)).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(seller, "menu.sell-tax", format(tax, shop)).forLocale()); } else { chatSheetPrinter.printLine(plugin.text().of(seller, "menu.sell-tax-self").forLocale()); } @@ -1324,170 +752,150 @@ public void sendSellSuccess(@NotNull QUser seller, @NotNull Shop shop, int amoun @SuppressWarnings("removal") @Override public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { - if (!shop.playerAuthorize(p.getUniqueId(), BuiltInShopPermission.SHOW_INFORMATION) - && !plugin.perm().hasPermission(p, "quickshop.other.use")) { - return; - } - if (Util.fireCancellableEvent(new ShopInfoPanelEvent(shop, p.getUniqueId()))) { - Log.debug("ShopInfoPanelEvent cancelled by some plugin"); - return; - } - ProxiedLocale locale = plugin.text().findRelativeLanguages(p); - // Potentially faster with an array? - ItemStack items = shop.getItem(); - ChatSheetPrinter chatSheetPrinter = new ChatSheetPrinter(p); - chatSheetPrinter.printHeader(); - chatSheetPrinter.printLine(plugin.text().of(p, "menu.shop-information").forLocale()); - chatSheetPrinter.printLine(plugin.text().of(p, "menu.owner", shop.ownerName(locale)).forLocale()); - // Enabled - if (shop.playerAuthorize(p.getUniqueId(), BuiltInShopPermission.PREVIEW_SHOP) - || plugin.perm().hasPermission(p, "quickshop.other.preview")) { - ItemStack previewItemStack = shop.getItem().clone(); - ItemPreviewComponentPrePopulateEvent previewComponentPrePopulateEvent = new ItemPreviewComponentPrePopulateEvent(previewItemStack, p); - previewComponentPrePopulateEvent.callEvent(); - previewItemStack = previewComponentPrePopulateEvent.getItemStack(); - Component previewComponent = plugin.text().of(p, "menu.preview", Component.text(previewItemStack.getAmount())).forLocale() - .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, MsgUtil.fillArgs("/quickshop silentpreview {0}", shop.getRuntimeRandomUniqueId().toString()))); - previewComponent = plugin.getPlatform().setItemStackHoverEvent(previewComponent, shop.getItem()); - ItemPreviewComponentPopulateEvent itemPreviewComponentPopulateEvent = new ItemPreviewComponentPopulateEvent(previewComponent, p); - itemPreviewComponentPopulateEvent.callEvent(); - previewComponent = itemPreviewComponentPopulateEvent.getComponent(); - chatSheetPrinter.printLine(plugin.text().of(p, "menu.item", Util.getItemStackName(shop.getItem())).forLocale() - .append(Component.text(" ")) - .append(previewComponent) - ); - } else { - ItemStack previewItemStack = shop.getItem().clone(); - ItemPreviewComponentPrePopulateEvent previewComponentPrePopulateEvent = new ItemPreviewComponentPrePopulateEvent(previewItemStack, p); - previewComponentPrePopulateEvent.callEvent(); - chatSheetPrinter.printLine(plugin.text().of(p, "menu.item", plugin.getPlatform().setItemStackHoverEvent(Util.getItemStackName(previewComponentPrePopulateEvent.getItemStack()), previewComponentPrePopulateEvent.getItemStack())).forLocale()); - } + try { + if (!shop.playerAuthorize(p.getUniqueId(), BuiltInShopPermission.SHOW_INFORMATION) && !plugin.perm().hasPermission(p, "quickshop.other.use")) { + return; + } + if (Util.fireCancellableEvent(new ShopInfoPanelEvent(shop, p.getUniqueId()))) { + Log.debug("ShopInfoPanelEvent cancelled by some plugin"); + return; + } + ProxiedLocale locale = plugin.text().findRelativeLanguages(p); + // Potentially faster with an array? + ItemStack items = shop.getItem(); + ChatSheetPrinter chatSheetPrinter = new ChatSheetPrinter(p); + chatSheetPrinter.printHeader(); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.shop-information").forLocale()); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.owner", shop.ownerName(locale)).forLocale()); + // Enabled + if (shop.playerAuthorize(p.getUniqueId(), BuiltInShopPermission.PREVIEW_SHOP) || plugin.perm().hasPermission(p, "quickshop.other.preview")) { + ItemStack previewItemStack = shop.getItem().clone(); + ItemPreviewComponentPrePopulateEvent previewComponentPrePopulateEvent = new ItemPreviewComponentPrePopulateEvent(previewItemStack, p); + previewComponentPrePopulateEvent.callEvent(); + previewItemStack = previewComponentPrePopulateEvent.getItemStack(); + Component previewComponent = plugin.text().of(p, "menu.preview", Component.text(previewItemStack.getAmount())).forLocale().clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, MsgUtil.fillArgs("/quickshop silentpreview {0}", shop.getRuntimeRandomUniqueId().toString()))); + previewComponent = plugin.getPlatform().setItemStackHoverEvent(previewComponent, shop.getItem()); + ItemPreviewComponentPopulateEvent itemPreviewComponentPopulateEvent = new ItemPreviewComponentPopulateEvent(previewComponent, p); + itemPreviewComponentPopulateEvent.callEvent(); + previewComponent = itemPreviewComponentPopulateEvent.getComponent(); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.item", Util.getItemStackName(shop.getItem())).forLocale().append(Component.text(" ")).append(previewComponent)); + } else { + ItemStack previewItemStack = shop.getItem().clone(); + ItemPreviewComponentPrePopulateEvent previewComponentPrePopulateEvent = new ItemPreviewComponentPrePopulateEvent(previewItemStack, p); + previewComponentPrePopulateEvent.callEvent(); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.item", plugin.getPlatform().setItemStackHoverEvent(Util.getItemStackName(previewComponentPrePopulateEvent.getItemStack()), previewComponentPrePopulateEvent.getItemStack())).forLocale()); + } - if (Util.isTool(items.getType()) && plugin.getConfig().getBoolean("shop.info-panel.show-durability")) { - chatSheetPrinter.printLine( - plugin.text().of(p, "menu.damage-percent-remaining", Component.text(Util.getToolPercentage(items))).forLocale()); - } - if (shop.isSelling()) { - if (shop.getRemainingStock() == -1) { - chatSheetPrinter.printLine( - plugin.text().of(p, "menu.stock", plugin.text().of(p, "signs.unlimited").forLocale()).forLocale()); + if (Util.isTool(items.getType()) && plugin.getConfig().getBoolean("shop.info-panel.show-durability")) { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.damage-percent-remaining", Component.text(Util.getToolPercentage(items))).forLocale()); + } + if (shop.isSelling()) { + if (shop.getRemainingStock() == -1) { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.stock", plugin.text().of(p, "signs.unlimited").forLocale()).forLocale()); + } else { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.stock", Component.text(shop.getRemainingStock())).forLocale()); + } + } else { + if (shop.getRemainingSpace() == -1) { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.space", plugin.text().of(p, "signs.unlimited").forLocale()).forLocale()); + } else { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.space", Component.text(shop.getRemainingSpace())).forLocale()); + } + } + if (shop.getItem().getAmount() == 1) { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.price-per", Util.getItemStackName(shop.getItem()), format(shop.getPrice(), shop)).forLocale()); } else { - chatSheetPrinter.printLine( - plugin.text().of(p, "menu.stock", Component.text(shop.getRemainingStock())).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.price-per-stack", Util.getItemStackName(shop.getItem()), format(shop.getPrice(), shop), shop.getItem().getAmount()).forLocale()); } - } else { - if (shop.getRemainingSpace() == -1) { - chatSheetPrinter.printLine( - plugin.text().of(p, "menu.space", plugin.text().of(p, "signs.unlimited").forLocale()).forLocale()); + if (shop.isBuying()) { + chatSheetPrinter.printLine(plugin.text().of(p, "menu.this-shop-is-buying").forLocale()); } else { - chatSheetPrinter.printLine( - plugin.text().of(p, "menu.space", Component.text(shop.getRemainingSpace())).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(p, "menu.this-shop-is-selling").forLocale()); } - } - if (shop.getItem().getAmount() == 1) { - chatSheetPrinter.printLine(plugin.text().of(p, "menu.price-per", Util.getItemStackName(shop.getItem()), format(shop.getPrice(), shop)).forLocale()); - } else { - chatSheetPrinter.printLine(plugin.text().of(p, "menu.price-per-stack", Util.getItemStackName(shop.getItem()), format(shop.getPrice(), shop), shop.getItem().getAmount()).forLocale()); - } - if (shop.isBuying()) { - chatSheetPrinter.printLine(plugin.text().of(p, "menu.this-shop-is-buying").forLocale()); - } else { - chatSheetPrinter.printLine(plugin.text().of(p, "menu.this-shop-is-selling").forLocale()); - } - boolean respectItemFlag = plugin.getConfig().getBoolean("respect-item-flag"); + boolean respectItemFlag = plugin.getConfig().getBoolean("respect-item-flag"); - boolean shouldDisplayEnchantments = plugin.getConfig().getBoolean("shop.info-panel.show-enchantments"); - boolean shouldDisplayPotionEffects = plugin.getConfig().getBoolean("shop.info-panel.show-effects"); + boolean shouldDisplayEnchantments = plugin.getConfig().getBoolean("shop.info-panel.show-enchantments"); + boolean shouldDisplayPotionEffects = plugin.getConfig().getBoolean("shop.info-panel.show-effects"); - if (respectItemFlag) { - if (items.hasItemMeta()) { - ItemMeta shopItemMeta = shop.getItem().getItemMeta(); - shouldDisplayEnchantments = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ENCHANTS); - ItemFlag hidePotionEffect; - try { - hidePotionEffect = ItemFlag.valueOf("HIDE_ADDITIONAL_TOOLTIP"); - } catch (Exception e) { - hidePotionEffect = ItemFlag.valueOf("HIDE_POTION_EFFECTS"); // Remove this when we dropped 1.20.x support + if (respectItemFlag) { + if (items.hasItemMeta()) { + ItemMeta shopItemMeta = shop.getItem().getItemMeta(); + shouldDisplayEnchantments = !shopItemMeta.hasItemFlag(ItemFlag.HIDE_ENCHANTS); + ItemFlag hidePotionEffect; + try { + hidePotionEffect = ItemFlag.valueOf("HIDE_ADDITIONAL_TOOLTIP"); + } catch (Exception e) { + hidePotionEffect = ItemFlag.valueOf("HIDE_POTION_EFFECTS"); // Remove this when we dropped 1.20.x support + } + shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(hidePotionEffect); } - shouldDisplayPotionEffects = !shopItemMeta.hasItemFlag(hidePotionEffect); } - } - if (shouldDisplayEnchantments) { - MsgUtil.printEnchantment(shop, chatSheetPrinter); - } - if (shouldDisplayPotionEffects) { - if (plugin.getGameVersion().isNewPotionAPI()) { - if (items.hasItemMeta() && (items.getItemMeta() instanceof PotionMeta potionMeta)) { - List effects = new ArrayList<>(); - if (potionMeta.getBasePotionType() != null) { - effects.addAll(potionMeta.getBasePotionType().getPotionEffects()); - } - if (potionMeta.hasCustomEffects()) { - effects.addAll(potionMeta.getCustomEffects()); - } - for (PotionEffect potionEffect : effects) { - int level = potionEffect.getAmplifier(); - Component translation; - try { - translation = plugin.getPlatform().getTranslation(potionEffect.getType()); - } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); + if (shouldDisplayEnchantments) { + MsgUtil.printEnchantment(shop, chatSheetPrinter); + } + if (shouldDisplayPotionEffects) { + if (plugin.getGameVersion().isNewPotionAPI()) { + if (items.hasItemMeta() && (items.getItemMeta() instanceof PotionMeta potionMeta)) { + List effects = new ArrayList<>(); + if (potionMeta.getBasePotionType() != null) { + effects.addAll(potionMeta.getBasePotionType().getPotionEffects()); } - chatSheetPrinter.printLine(Component.empty() - .color(NamedTextColor.YELLOW) - .append(translation) - .append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); - } - } - } else { - if (shouldDisplayPotionEffects) { - if (items.getItemMeta() instanceof PotionMeta potionMeta) { - PotionData potionData = potionMeta.getBasePotionData(); - PotionEffectType potionEffectType = potionData.getType().getEffectType(); - if (potionEffectType != null) { + if (potionMeta.hasCustomEffects()) { + effects.addAll(potionMeta.getCustomEffects()); + } + for (PotionEffect potionEffect : effects) { + int level = potionEffect.getAmplifier(); Component translation; try { - translation = plugin.getPlatform().getTranslation(potionEffectType); + translation = plugin.getPlatform().getTranslation(potionEffect.getType()); } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffectType.getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffectType.getKey(), th); + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); } - chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); - //Because the bukkit API limit, we can't get the actual effect level - chatSheetPrinter.printLine(Component.empty() - .color(NamedTextColor.YELLOW) - .append(translation) - ); + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } - if (potionMeta.hasCustomEffects()) { - for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { - int level = potionEffect.getAmplifier(); + } + } else { + if (shouldDisplayPotionEffects) { + if (items.getItemMeta() instanceof PotionMeta potionMeta) { + PotionData potionData = potionMeta.getBasePotionData(); + PotionEffectType potionEffectType = potionData.getType().getEffectType(); + if (potionEffectType != null) { Component translation; try { - translation = plugin.getPlatform().getTranslation(potionEffect.getType()); + translation = plugin.getPlatform().getTranslation(potionEffectType); } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffectType.getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffectType.getKey(), th); + } + chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); + //Because the bukkit API limit, we can't get the actual effect level + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation)); + } + if (potionMeta.hasCustomEffects()) { + for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { + int level = potionEffect.getAmplifier(); + Component translation; + try { + translation = plugin.getPlatform().getTranslation(potionEffect.getType()); + } catch (Throwable th) { + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); + } + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } - chatSheetPrinter.printLine(Component.empty() - .color(NamedTextColor.YELLOW) - .append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } } } } } + chatSheetPrinter.printFooter(); + } catch (Exception e) { + plugin.text().of(p, "shop-information-not-shown-due-an-internal-error").send(); + plugin.logger().warn("Unable to show shop information panel to player {}", p.getName(), e); } - chatSheetPrinter.printFooter(); - - } - - @Override - public @NotNull ShopManager.InteractiveManager getInteractiveManager() { - return this.interactiveManager; } @@ -1497,18 +905,9 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, List sendList = new ArrayList<>(); Component notify; if (plugin.getConfig().getBoolean("show-tax")) { - notify = plugin.text().of("player-bought-from-your-store-tax", - seller, - amount * shop.getItem().getAmount(), - Util.getItemStackName(shop.getItem()), - this.formatter.format(total - tax, shop), - this.formatter.format(tax, shop)).forLocale(langCode); + notify = plugin.text().of("player-bought-from-your-store-tax", seller, amount * shop.getItem().getAmount(), Util.getItemStackName(shop.getItem()), this.formatter.format(total - tax, shop), this.formatter.format(tax, shop)).forLocale(langCode); } else { - notify = plugin.text().of("player-bought-from-your-store", - seller, - amount * shop.getItem().getAmount(), - Util.getItemStackName(shop.getItem()), - this.formatter.format(total - tax, shop)).forLocale(langCode); + notify = plugin.text().of("player-bought-from-your-store", seller, amount * shop.getItem().getAmount(), Util.getItemStackName(shop.getItem()), this.formatter.format(total - tax, shop)).forLocale(langCode); } notify = plugin.getPlatform().setItemStackHoverEvent(notify, shop.getItem()); sendList.add(notify); @@ -1516,14 +915,9 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, if (stock == amount) { Component stockWarn; if (shop.getShopName() == null) { - stockWarn = plugin.text().of("shop-out-of-stock", - shop.getLocation().getBlockX(), - shop.getLocation().getBlockY(), - shop.getLocation().getBlockZ(), - Util.getItemStackName(shop.getItem())).forLocale(langCode); + stockWarn = plugin.text().of("shop-out-of-stock", shop.getLocation().getBlockX(), shop.getLocation().getBlockY(), shop.getLocation().getBlockZ(), Util.getItemStackName(shop.getItem())).forLocale(langCode); } else { - stockWarn = plugin.text().of("shop-out-of-stock-name", shop.getShopName(), - Util.getItemStackName(shop.getItem())).forLocale(langCode); + stockWarn = plugin.text().of("shop-out-of-stock-name", shop.getShopName(), Util.getItemStackName(shop.getItem())).forLocale(langCode); } stockWarn = plugin.getPlatform().setItemStackHoverEvent(stockWarn, shop.getItem()); sendList.add(stockWarn); @@ -1556,8 +950,7 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, signBlockState.setBlockData(wallSignBlockData); } } else { - plugin.logger().warn( - "Sign material {} not a WallSign, make sure you using correct sign material.", signBlockState.getType().name()); + plugin.logger().warn("Sign material {} not a WallSign, make sure you using correct sign material.", signBlockState.getType().name()); } signBlockState.update(true); return signBlockState; @@ -1566,13 +959,10 @@ private void notifyBought(@NotNull QUser seller, @NotNull Shop shop, int amount, private int buyingShopAllCalc(@NotNull AbstractEconomy eco, @NotNull Shop shop, @NotNull Player p) { int amount; - int shopHaveSpaces = - Util.countSpace(shop.getInventory(), shop); + int shopHaveSpaces = Util.countSpace(shop.getInventory(), shop); int invHaveItems = Util.countItems(new BukkitInventoryWrapper(p.getInventory()), shop); // Check if shop owner has enough money - double ownerBalance = eco - .getBalance(shop.getOwner(), shop.getLocation().getWorld(), - shop.getCurrency()); + double ownerBalance = eco.getBalance(shop.getOwner(), shop.getLocation().getWorld(), shop.getCurrency()); int ownerCanAfford; if (shop.getPrice() != 0) { ownerCanAfford = (int) (ownerBalance / shop.getPrice()); @@ -1594,63 +984,96 @@ private int buyingShopAllCalc(@NotNull AbstractEconomy eco, @NotNull Shop shop, if (amount < 1) { // typed 'all' but the auto set amount is 0 if (shopHaveSpaces == 0) { // when typed 'all' but the shop doesn't have any empty space - plugin.text().of(p, "shop-has-no-space", Component.text(shopHaveSpaces), - Util.getItemStackName(shop.getItem())).send(); + plugin.text().of(p, "shop-has-no-space", Component.text(shopHaveSpaces), Util.getItemStackName(shop.getItem())).send(); return 0; } if (ownerCanAfford == 0 && (!shop.isUnlimited() || payUnlimitedShopOwner)) { // when typed 'all' but the shop owner doesn't have enough money to buy at least 1 // item (and shop isn't unlimited or pay-unlimited is true) - plugin.text().of(p, "the-owner-cant-afford-to-buy-from-you", - plugin.getShopManager().format(shop.getPrice(), shop.getLocation().getWorld(), - shop.getCurrency()), - plugin.getShopManager().format(ownerBalance, shop.getLocation().getWorld(), - shop.getCurrency())).send(); + plugin.text().of(p, "the-owner-cant-afford-to-buy-from-you", plugin.getShopManager().format(shop.getPrice(), shop.getLocation().getWorld(), shop.getCurrency()), plugin.getShopManager().format(ownerBalance, shop.getLocation().getWorld(), shop.getCurrency())).send(); return 0; } // when typed 'all' but player doesn't have any items to sell - plugin.text().of(p, "you-dont-have-that-many-items", - Component.text(amount), - Util.getItemStackName(shop.getItem())).send(); + plugin.text().of(p, "you-dont-have-that-many-items", Component.text(amount), Util.getItemStackName(shop.getItem())).send(); return 0; } return amount; } - @Nullable - public Shop findShopIncludeAttached(@NotNull Location loc, boolean fromAttach) { - Shop shop = getShop(loc); - - // failed, get attached shop - if (shop == null) { - Block block = loc.getBlock(); - if (!Util.isShoppables(block.getType())) { - return null; - } - final Block currentBlock = loc.getBlock(); - if (!fromAttach) { - // sign - if (Util.isWallSign(currentBlock.getType())) { - final Block attached = Util.getAttached(currentBlock); - if (attached != null) { - shop = this.findShopIncludeAttached(attached.getLocation(), true); - } - } else { - // optimize for performance - BlockState state = PaperLib.getBlockState(currentBlock, false).getState(); - if (!(state instanceof InventoryHolder holder)) { - return null; - } - @Nullable final Block half = Util.getSecondHalf(currentBlock); - if (half != null) { - shop = getShop(half.getLocation()); - } - } - } + /** + * @return Returns the Map. Info contains what their last question etc was. + * @deprecated Use getInteractiveManager instead. This way won't trigger the BungeeCord notification. + */ + @SuppressWarnings("removal") + @Override + @Deprecated(forRemoval = true) + public @NotNull Map getActions() { + return this.interactiveManager.actions; + } + + + @Override + public @Nullable Shop getShopIncludeAttachedViaCache(@Nullable Location loc) { + if (loc == null) { + Log.debug("Location is null."); + return null; + } + if (!this.useShopCache) { + return getShopIncludeAttached(loc); } - return shop; + return shopCache.get(ShopCacheNamespacedKey.INCLUDE_ATTACHED, loc, true); + } + + /** + * Returns a new shop iterator object, allowing iteration over shops easily, instead of sorting + * through a 3D map. + * + * @return a new shop iterator object. + */ + @Override + public @NotNull Iterator getShopIterator() { + return new SimpleShopManager.ShopIterator(); + } + + @Override + public @NotNull PriceLimiter getPriceLimiter() { + return this.priceLimiter; + } + /** + * Gets a shop in a specific location + * + * @param loc The location to get the shop from + * @return The shop at that location + */ + @Override + public @Nullable Shop getShop(@NotNull Location loc) { + return getShop(loc, !useShopableChecks); } + @Override + public @Nullable Shop getShopViaCache(@NotNull Location loc) { + if (!this.useShopCache) { + return getShop(loc); + } + return shopCache.get(ShopCacheNamespacedKey.SINGLE, loc, true); + } + + @Override + public void deleteShop(@NotNull Shop shop) { + ShopDeleteEvent shopDeleteEvent = new ShopDeleteEvent(shop, false); + if (shopDeleteEvent.callCancellableEvent()) { + Log.debug("Shop delete was cancelled by 3rd-party plugin"); + return; + } + for (Sign s : shop.getSigns()) { + s.getBlock().setType(Material.AIR); + } + refundShop(shop); + unloadShop(shop); + unregisterShop(shop, true); + } + + private void actionTrade(@NotNull Player p, Info info, @NotNull String message) { Util.ensureThread(false); if (plugin.getEconomy() == null) { @@ -1685,8 +1108,7 @@ private void actionTrade(@NotNull Player p, Info info, @NotNull String message) // instead of output cancelled message (when typed neither integer or 'all'), just let // player know that there should be positive number or 'all' plugin.text().of(p, "not-a-integer", message).send(); - Log.debug( - "Receive the chat " + message + " and it format failed: " + message); + Log.debug("Receive the chat " + message + " and it format failed: " + message); return; } } @@ -1712,59 +1134,6 @@ private void actionTrade(@NotNull Player p, Info info, @NotNull String message) } } - @NotNull - @Override - public CompletableFuture<@NotNull List> queryTaggedShops(@NotNull UUID tagger, @NotNull String tag) { - Util.ensureThread(true); - return CompletableFuture.supplyAsync(() -> plugin.getDatabaseHelper().listShopsTaggedBy(tagger, tag) - .stream() - .map(this::getShop).toList() - , QuickExecutor.getCommonExecutor()); - - } - - @Override - public CompletableFuture<@Nullable Integer> clearShopTags(@NotNull UUID tagger, @NotNull Shop shop) { - return plugin.getDatabaseHelper().removeShopAllTag(tagger, shop.getShopId()); - } - - @Override - public CompletableFuture<@Nullable Integer> clearTagFromShops(@NotNull UUID tagger, @NotNull String tag) { - tag = tag.trim().toLowerCase(Locale.ROOT); - tag = tag.replace(" ", "_"); - return plugin.getDatabaseHelper().removeTagFromShops(tagger, tag); - } - - @Override - public CompletableFuture<@Nullable Integer> removeTag(@NotNull UUID tagger, @NotNull Shop shop, @NotNull String tag) { - tag = tag.trim().toLowerCase(Locale.ROOT); - tag = tag.replace(" ", "_"); - return plugin.getDatabaseHelper().removeShopTag(tagger, shop.getShopId(), tag); - } - - @Override - public CompletableFuture<@Nullable Integer> tagShop(@NotNull UUID tagger, @NotNull Shop shop, @NotNull String tag) { - tag = tag.trim().toLowerCase(Locale.ROOT); - tag = tag.replace(" ", "_"); - return plugin.getDatabaseHelper().tagShop(tagger, shop.getShopId(), tag); - } - - @Override - @NotNull - public List listTags(@NotNull UUID tagger) { - Util.ensureThread(true); - return plugin.getDatabaseHelper().listTags(tagger); - } - - private void processCreationFail(@NotNull Shop shop, @NotNull QUser owner, @NotNull Throwable e2) { - plugin.logger().error("Shop create failed, auto fix failed, the changes may won't commit to database.", e2); - plugin.text().of(owner, "shop-creation-failed").send(); - Util.mainThreadRun(() -> { - unloadShop(shop); - unregisterShop(shop, true); - removeShopFromLookupTable(shop); - }); - } @Override public ReloadResult reloadModule() { @@ -1785,43 +1154,81 @@ private int sellingShopAllCalc(@NotNull AbstractEconomy eco, @NotNull Shop shop, } // typed 'all', check if player has enough money than price * amount double price = shop.getPrice(); - double balance = eco.getBalance(QUserImpl.createFullFilled(p), shop.getLocation().getWorld(), - shop.getCurrency()); + double balance = eco.getBalance(QUserImpl.createFullFilled(p), shop.getLocation().getWorld(), shop.getCurrency()); amount = Math.min(amount, (int) Math.floor(balance / price)); if (amount < 1) { // typed 'all' but the auto set amount is 0 // when typed 'all' but player can't buy any items if (!shop.isUnlimited() && shopHaveItems < 1) { // but also the shop's stock is 0 - plugin.text().of(p, "shop-stock-too-low", - Component.text(shop.getRemainingStock()), - Util.getItemStackName(shop.getItem())).send(); + plugin.text().of(p, "shop-stock-too-low", Component.text(shop.getRemainingStock()), Util.getItemStackName(shop.getItem())).send(); return 0; } else { // when if player's inventory is full if (invHaveSpaces <= 0) { - plugin.text().of(p, "not-enough-space", - Component.text(invHaveSpaces)).send(); + plugin.text().of(p, "not-enough-space", Component.text(invHaveSpaces)).send(); return 0; } - plugin.text().of(p, "you-cant-afford-to-buy", - plugin.getShopManager().format(price, shop.getLocation().getWorld(), - shop.getCurrency()), - plugin.getShopManager().format(balance, shop.getLocation().getWorld(), - shop.getCurrency())).send(); + plugin.text().of(p, "you-cant-afford-to-buy", plugin.getShopManager().format(price, shop.getLocation().getWorld(), shop.getCurrency()), plugin.getShopManager().format(balance, shop.getLocation().getWorld(), shop.getCurrency())).send(); } return 0; } return amount; } - @Override - @NotNull - public CompletableFuture<@NotNull ShopInventoryCountCache> queryShopInventoryCacheInDatabase(@NotNull Shop shop) { - Util.ensureThread(true); - return plugin.getDatabaseHelper().queryInventoryCache(shop.getShopId()); - } + public class ShopIterator implements Iterator { + + protected final Iterator>> worlds; + + protected Iterator> chunks; + + protected Iterator shops; + + public ShopIterator() { + worlds = getShops().values().iterator(); + } + + /** + * Returns true if there is still more shops to iterate over. + */ + @Override + public boolean hasNext() { + if (shops == null || !shops.hasNext()) { + if (chunks == null || !chunks.hasNext()) { + if (!worlds.hasNext()) { + return false; + } else { + chunks = worlds.next().values().iterator(); + return hasNext(); + } + } else { + shops = chunks.next().values().iterator(); + return hasNext(); + } + } + return true; + } + /** + * Fetches the next shop. Throws NoSuchElementException if there are no more shops. + */ + @Override + public @NotNull Shop next() { + if (shops == null || !shops.hasNext()) { + if (chunks == null || !chunks.hasNext()) { + if (!worlds.hasNext()) { + throw new NoSuchElementException("No more shops to iterate over!"); + } + chunks = worlds.next().values().iterator(); + } + shops = chunks.next().values().iterator(); + } + if (!shops.hasNext()) { + return this.next(); // Skip to the next one (Empty iterator?) + } + return shops.next(); + } + } public static class InteractiveManager implements ShopManager.InteractiveManager { private final Map actions = Maps.newConcurrentMap(); private final QuickShop plugin; @@ -1867,6 +1274,10 @@ public void reset() { this.actions.clear(); } + public Map getActions() { + return actions; + } + @Override public Info get(UUID uuid) { return this.actions.get(uuid); @@ -1902,111 +1313,4 @@ private void sendRequest(UUID uuid) { } } } - - static class TagParser { - private final List tags; - private final ShopManager shopManager; - private final UUID tagger; - private final Map> singleCaching = new HashMap<>(); - - public TagParser(UUID tagger, ShopManager shopManager, List tags) { - Util.ensureThread(true); - this.shopManager = shopManager; - this.tags = tags; - this.tagger = tagger; - } - - public List parseTags() { - List finalShop = new ArrayList<>(); - for (String tag : tags) { - ParseResult result = parseSingleTag(tag); - if (result.getBehavior() == Behavior.INCLUDE) { - finalShop.addAll(result.getShops()); - } else if (result.getBehavior() == Behavior.EXCLUDE) { - finalShop.removeAll(result.getShops()); - } - } - return finalShop; - } - - public ParseResult parseSingleTag(String tag) throws IllegalArgumentException { - Util.ensureThread(true); - Behavior behavior = Behavior.INCLUDE; - if (tag.startsWith("-")) { - behavior = Behavior.EXCLUDE; - } - String tagName = tag.substring(1); - if (tagName.isEmpty()) { - throw new IllegalArgumentException("Tag name can't be empty"); - } - List shops = singleCaching.computeIfAbsent(tag, (t) -> shopManager.queryTaggedShops(tagger, t).join()); - return new ParseResult(behavior, shops); - } - - enum Behavior { - INCLUDE, - EXCLUDE - } - - @AllArgsConstructor - @Data - static class ParseResult { - private final Behavior behavior; - private final List shops; - } - } - - public class ShopIterator implements Iterator { - - private final Iterator>> worlds; - - private Iterator> chunks; - - private Iterator shops; - - public ShopIterator() { - worlds = getShops().values().iterator(); - } - - /** - * Returns true if there is still more shops to iterate over. - */ - @Override - public boolean hasNext() { - if (shops == null || !shops.hasNext()) { - if (chunks == null || !chunks.hasNext()) { - if (!worlds.hasNext()) { - return false; - } else { - chunks = worlds.next().values().iterator(); - return hasNext(); - } - } else { - shops = chunks.next().values().iterator(); - return hasNext(); - } - } - return true; - } - - /** - * Fetches the next shop. Throws NoSuchElementException if there are no more shops. - */ - @Override - public @NotNull Shop next() { - if (shops == null || !shops.hasNext()) { - if (chunks == null || !chunks.hasNext()) { - if (!worlds.hasNext()) { - throw new NoSuchElementException("No more shops to iterate over!"); - } - chunks = worlds.next().values().iterator(); - } - shops = chunks.next().values().iterator(); - } - if (!shops.hasNext()) { - return this.next(); // Skip to the next one (Empty iterator?) - } - return shops.next(); - } - } } diff --git a/quickshop-bukkit/src/main/resources/lang/messages.yml b/quickshop-bukkit/src/main/resources/lang/messages.yml index 4e9b20ef5c..a1b6086a95 100644 --- a/quickshop-bukkit/src/main/resources/lang/messages.yml +++ b/quickshop-bukkit/src/main/resources/lang/messages.yml @@ -1814,4 +1814,5 @@ about: valid-donation-key: "Bound to {0}" invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" -history-command-leave-blank: "" \ No newline at end of file +history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." \ No newline at end of file From b94bf45646afd6a43e81814bbf1584afac3aaf16 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 22:10:22 +0800 Subject: [PATCH 68/81] mark annotation --- .../java/com/ghostchu/quickshop/shop/AbstractShopManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java index 911fb24746..2e5b50fe6e 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/AbstractShopManager.java @@ -34,6 +34,7 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.inventory.InventoryHolder; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -43,6 +44,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; // This class is extract from SimpleShopManager because it is too big... +@ApiStatus.Experimental public abstract class AbstractShopManager implements ShopManager { @Getter protected ShopCache shopCache; From b71ed59b1279ea9b03087d2fc90659c0af05e873 Mon Sep 17 00:00:00 2001 From: Ghost_chu <30802565+Ghost-chu@users.noreply.github.com> Date: Tue, 14 May 2024 22:50:55 +0800 Subject: [PATCH 69/81] [ci skip] Automatically merge Crowdin translations --- crowdin/lang/af-ZA/messages.yml | 1 + crowdin/lang/ar-SA/messages.yml | 1 + crowdin/lang/bg-BG/messages.yml | 1 + crowdin/lang/ca-ES/messages.yml | 1 + crowdin/lang/cs-CZ/messages.yml | 1 + crowdin/lang/da-DK/messages.yml | 1 + crowdin/lang/de-DE/messages.yml | 1 + crowdin/lang/el-GR/messages.yml | 1 + crowdin/lang/en-US/messages.yml | 1 + crowdin/lang/es-ES/messages.yml | 1 + crowdin/lang/fa-IR/messages.yml | 1 + crowdin/lang/fi-FI/messages.yml | 1 + crowdin/lang/fr-FR/messages.yml | 1 + crowdin/lang/he-IL/messages.yml | 1 + crowdin/lang/hi-IN/messages.yml | 1 + crowdin/lang/hu-HU/messages.yml | 1 + crowdin/lang/it-IT/messages.yml | 1 + crowdin/lang/ja-JP/messages.yml | 1 + crowdin/lang/ko-KR/messages.yml | 1 + crowdin/lang/lt-LT/messages.yml | 1 + crowdin/lang/nl-NL/messages.yml | 1 + crowdin/lang/no-NO/messages.yml | 1 + crowdin/lang/pl-PL/messages.yml | 1 + crowdin/lang/pt-BR/messages.yml | 1 + crowdin/lang/pt-PT/messages.yml | 1 + crowdin/lang/ro-RO/messages.yml | 1 + crowdin/lang/ru-RU/messages.yml | 1 + crowdin/lang/sr-SP/messages.yml | 1 + crowdin/lang/sv-SE/messages.yml | 1 + crowdin/lang/th-TH/messages.yml | 1 + crowdin/lang/tr-TR/messages.yml | 1 + crowdin/lang/uk-UA/messages.yml | 1 + crowdin/lang/vi-VN/messages.yml | 1 + crowdin/lang/zh-CN/messages.yml | 1 + crowdin/lang/zh-HK/messages.yml | 1 + crowdin/lang/zh-TW/messages.yml | 1 + 36 files changed, 36 insertions(+) diff --git a/crowdin/lang/af-ZA/messages.yml b/crowdin/lang/af-ZA/messages.yml index 6cef467e7c..dc2609357a 100644 --- a/crowdin/lang/af-ZA/messages.yml +++ b/crowdin/lang/af-ZA/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/ar-SA/messages.yml b/crowdin/lang/ar-SA/messages.yml index a09253938e..06a4ff2709 100644 --- a/crowdin/lang/ar-SA/messages.yml +++ b/crowdin/lang/ar-SA/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/bg-BG/messages.yml b/crowdin/lang/bg-BG/messages.yml index fd424c1be9..b984ec0f0b 100644 --- a/crowdin/lang/bg-BG/messages.yml +++ b/crowdin/lang/bg-BG/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/ca-ES/messages.yml b/crowdin/lang/ca-ES/messages.yml index ff9125be97..a265a291af 100644 --- a/crowdin/lang/ca-ES/messages.yml +++ b/crowdin/lang/ca-ES/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/cs-CZ/messages.yml b/crowdin/lang/cs-CZ/messages.yml index a284ac8439..fe6b0b40a7 100644 --- a/crowdin/lang/cs-CZ/messages.yml +++ b/crowdin/lang/cs-CZ/messages.yml @@ -1567,3 +1567,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/da-DK/messages.yml b/crowdin/lang/da-DK/messages.yml index 65a30003a5..2abd82edd6 100644 --- a/crowdin/lang/da-DK/messages.yml +++ b/crowdin/lang/da-DK/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/de-DE/messages.yml b/crowdin/lang/de-DE/messages.yml index a99b632c58..320b54b762 100644 --- a/crowdin/lang/de-DE/messages.yml +++ b/crowdin/lang/de-DE/messages.yml @@ -1566,3 +1566,4 @@ about: invalid-donation-key: "Ungültiger Spendenschlüssel" kofi-thanks: "Besonderer Dank geht an alle, welche QuickShop auf Ko-fi unterstützen :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/el-GR/messages.yml b/crowdin/lang/el-GR/messages.yml index 12242ecf5c..46731d7e40 100644 --- a/crowdin/lang/el-GR/messages.yml +++ b/crowdin/lang/el-GR/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/en-US/messages.yml b/crowdin/lang/en-US/messages.yml index a98b42a5ca..c3cfee2ebf 100644 --- a/crowdin/lang/en-US/messages.yml +++ b/crowdin/lang/en-US/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/es-ES/messages.yml b/crowdin/lang/es-ES/messages.yml index 28e83f62f0..cea10c9669 100644 --- a/crowdin/lang/es-ES/messages.yml +++ b/crowdin/lang/es-ES/messages.yml @@ -1567,3 +1567,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/fa-IR/messages.yml b/crowdin/lang/fa-IR/messages.yml index bc0b576489..4feb4ec09a 100644 --- a/crowdin/lang/fa-IR/messages.yml +++ b/crowdin/lang/fa-IR/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/fi-FI/messages.yml b/crowdin/lang/fi-FI/messages.yml index 383d0f59b1..7ba1148a81 100644 --- a/crowdin/lang/fi-FI/messages.yml +++ b/crowdin/lang/fi-FI/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/fr-FR/messages.yml b/crowdin/lang/fr-FR/messages.yml index 10e6c36b38..98e4b5875d 100644 --- a/crowdin/lang/fr-FR/messages.yml +++ b/crowdin/lang/fr-FR/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/he-IL/messages.yml b/crowdin/lang/he-IL/messages.yml index 1ca38b28b2..66eb35136a 100644 --- a/crowdin/lang/he-IL/messages.yml +++ b/crowdin/lang/he-IL/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/hi-IN/messages.yml b/crowdin/lang/hi-IN/messages.yml index 008e316b99..55c5fbdcb1 100644 --- a/crowdin/lang/hi-IN/messages.yml +++ b/crowdin/lang/hi-IN/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/hu-HU/messages.yml b/crowdin/lang/hu-HU/messages.yml index 3f73d2dbef..933188a854 100644 --- a/crowdin/lang/hu-HU/messages.yml +++ b/crowdin/lang/hu-HU/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/it-IT/messages.yml b/crowdin/lang/it-IT/messages.yml index 3cb05882d5..0d4d348ecb 100644 --- a/crowdin/lang/it-IT/messages.yml +++ b/crowdin/lang/it-IT/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/ja-JP/messages.yml b/crowdin/lang/ja-JP/messages.yml index a1c3950565..d5ed9fea99 100644 --- a/crowdin/lang/ja-JP/messages.yml +++ b/crowdin/lang/ja-JP/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/ko-KR/messages.yml b/crowdin/lang/ko-KR/messages.yml index 769e1b3913..3b6592b732 100644 --- a/crowdin/lang/ko-KR/messages.yml +++ b/crowdin/lang/ko-KR/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/lt-LT/messages.yml b/crowdin/lang/lt-LT/messages.yml index ed0c0012b0..3f18f7896e 100644 --- a/crowdin/lang/lt-LT/messages.yml +++ b/crowdin/lang/lt-LT/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/nl-NL/messages.yml b/crowdin/lang/nl-NL/messages.yml index c672c94e57..5af806d3ae 100644 --- a/crowdin/lang/nl-NL/messages.yml +++ b/crowdin/lang/nl-NL/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/no-NO/messages.yml b/crowdin/lang/no-NO/messages.yml index c267df140b..8420c79733 100644 --- a/crowdin/lang/no-NO/messages.yml +++ b/crowdin/lang/no-NO/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Ugyldig donasjonsnøkkel" kofi-thanks: "Spesiell takk til de som støtter QuickShop på Ko-Fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/pl-PL/messages.yml b/crowdin/lang/pl-PL/messages.yml index ca3f65d406..a4be6aa5a9 100644 --- a/crowdin/lang/pl-PL/messages.yml +++ b/crowdin/lang/pl-PL/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/pt-BR/messages.yml b/crowdin/lang/pt-BR/messages.yml index f61a8a1c5d..489eb08ee5 100644 --- a/crowdin/lang/pt-BR/messages.yml +++ b/crowdin/lang/pt-BR/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/pt-PT/messages.yml b/crowdin/lang/pt-PT/messages.yml index aeeac8afc7..40107bc7cc 100644 --- a/crowdin/lang/pt-PT/messages.yml +++ b/crowdin/lang/pt-PT/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/ro-RO/messages.yml b/crowdin/lang/ro-RO/messages.yml index 649b41f93d..5b0e594273 100644 --- a/crowdin/lang/ro-RO/messages.yml +++ b/crowdin/lang/ro-RO/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/ru-RU/messages.yml b/crowdin/lang/ru-RU/messages.yml index 2d570981ca..89858bfbcd 100644 --- a/crowdin/lang/ru-RU/messages.yml +++ b/crowdin/lang/ru-RU/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/sr-SP/messages.yml b/crowdin/lang/sr-SP/messages.yml index dee8dd8fcd..7908423aad 100644 --- a/crowdin/lang/sr-SP/messages.yml +++ b/crowdin/lang/sr-SP/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/sv-SE/messages.yml b/crowdin/lang/sv-SE/messages.yml index cca17024e5..45bebdd477 100644 --- a/crowdin/lang/sv-SE/messages.yml +++ b/crowdin/lang/sv-SE/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/th-TH/messages.yml b/crowdin/lang/th-TH/messages.yml index 6b4d05ed40..40fe225847 100644 --- a/crowdin/lang/th-TH/messages.yml +++ b/crowdin/lang/th-TH/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/tr-TR/messages.yml b/crowdin/lang/tr-TR/messages.yml index d34afdcfbf..a8482d8a31 100644 --- a/crowdin/lang/tr-TR/messages.yml +++ b/crowdin/lang/tr-TR/messages.yml @@ -1567,3 +1567,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/uk-UA/messages.yml b/crowdin/lang/uk-UA/messages.yml index 297634a70c..334928ff22 100644 --- a/crowdin/lang/uk-UA/messages.yml +++ b/crowdin/lang/uk-UA/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/vi-VN/messages.yml b/crowdin/lang/vi-VN/messages.yml index 43460d60fe..770efc9928 100644 --- a/crowdin/lang/vi-VN/messages.yml +++ b/crowdin/lang/vi-VN/messages.yml @@ -1568,3 +1568,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/zh-CN/messages.yml b/crowdin/lang/zh-CN/messages.yml index 71b31ba860..9cfa750b44 100644 --- a/crowdin/lang/zh-CN/messages.yml +++ b/crowdin/lang/zh-CN/messages.yml @@ -1576,3 +1576,4 @@ about: invalid-donation-key: "无效的捐赠密钥" kofi-thanks: "特别感谢那些在 Ko-Fi 上支持 QuickShop 的人 :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/zh-HK/messages.yml b/crowdin/lang/zh-HK/messages.yml index 025dafbb36..a68b17fc8f 100644 --- a/crowdin/lang/zh-HK/messages.yml +++ b/crowdin/lang/zh-HK/messages.yml @@ -1584,3 +1584,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." diff --git a/crowdin/lang/zh-TW/messages.yml b/crowdin/lang/zh-TW/messages.yml index 2acf40a9c3..dbcad8a813 100644 --- a/crowdin/lang/zh-TW/messages.yml +++ b/crowdin/lang/zh-TW/messages.yml @@ -1583,3 +1583,4 @@ about: invalid-donation-key: "Invalid donation key" kofi-thanks: "Special thanks to those who support QuickShop on Ko-fi :)" history-command-leave-blank: "" +shop-information-not-shown-due-an-internal-error: "An internal error occurred. The store information panel may be displayed incompletely, please contact the server administrator." From ee71453cdabd2466855b2bb9c72c1093bb69a858 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 22:56:30 +0800 Subject: [PATCH 70/81] Fix incorrect symbol link position creation --- .../quickshop/shop/SimpleShopManager.java | 125 ++++++++++-------- .../shop/history/ShopHistoryGUI.java | 1 - .../BukkitInventoryWrapperManager.java | 11 +- 3 files changed, 77 insertions(+), 60 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 98e15c9ff8..837f39a13e 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -4,6 +4,7 @@ import com.ghostchu.quickshop.api.economy.AbstractEconomy; import com.ghostchu.quickshop.api.event.*; import com.ghostchu.quickshop.api.inventory.InventoryWrapper; +import com.ghostchu.quickshop.api.inventory.InventoryWrapperManager; import com.ghostchu.quickshop.api.localization.text.ProxiedLocale; import com.ghostchu.quickshop.api.obj.QUser; import com.ghostchu.quickshop.api.shop.*; @@ -15,6 +16,7 @@ import com.ghostchu.quickshop.economy.SimpleEconomyTransaction; import com.ghostchu.quickshop.obj.QUserImpl; import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapper; +import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapperManager; import com.ghostchu.quickshop.util.ChatSheetPrinter; import com.ghostchu.quickshop.util.MsgUtil; import com.ghostchu.quickshop.util.PackageUtil; @@ -300,7 +302,19 @@ public void actionCreate(@NotNull Player p, Info info, @NotNull String message) BlockState state = info.getLocation().getBlock().getState(); if (state instanceof InventoryHolder holder) { // Create the basic shop - ContainerShop shop = new ContainerShop(plugin, -1, info.getLocation(), price, info.getItem(), createQUser, false, ShopType.SELLING, new YamlConfiguration(), null, false, null, plugin.getJavaPlugin().getName(), plugin.getInventoryWrapperManager().mklink(new BukkitInventoryWrapper((holder).getInventory())), null, Collections.emptyMap(), new SimpleBenefit()); + String symbolLink; + InventoryWrapperManager manager = plugin.getInventoryWrapperManager(); + if (manager instanceof BukkitInventoryWrapperManager bukkitInventoryWrapperManager) { + symbolLink = bukkitInventoryWrapperManager.mklink(info.getLocation()); + } else { + symbolLink = manager.mklink(new BukkitInventoryWrapper((holder).getInventory())); + } + ContainerShop shop = new ContainerShop(plugin, -1, info.getLocation(), + price, info.getItem(), createQUser, false, + ShopType.SELLING, new YamlConfiguration(), null, false, + null, plugin.getJavaPlugin().getName(), + symbolLink, + null, Collections.emptyMap(), new SimpleBenefit()); createShop(shop, info.getSignBlock(), info.isBypassed()); } else { plugin.text().of(p, "invalid-container").send(); @@ -1039,6 +1053,7 @@ private int buyingShopAllCalc(@NotNull AbstractEconomy eco, @NotNull Shop shop, public @NotNull PriceLimiter getPriceLimiter() { return this.priceLimiter; } + /** * Gets a shop in a specific location * @@ -1175,60 +1190,6 @@ private int sellingShopAllCalc(@NotNull AbstractEconomy eco, @NotNull Shop shop, return amount; } - - public class ShopIterator implements Iterator { - - protected final Iterator>> worlds; - - protected Iterator> chunks; - - protected Iterator shops; - - public ShopIterator() { - worlds = getShops().values().iterator(); - } - - /** - * Returns true if there is still more shops to iterate over. - */ - @Override - public boolean hasNext() { - if (shops == null || !shops.hasNext()) { - if (chunks == null || !chunks.hasNext()) { - if (!worlds.hasNext()) { - return false; - } else { - chunks = worlds.next().values().iterator(); - return hasNext(); - } - } else { - shops = chunks.next().values().iterator(); - return hasNext(); - } - } - return true; - } - - /** - * Fetches the next shop. Throws NoSuchElementException if there are no more shops. - */ - @Override - public @NotNull Shop next() { - if (shops == null || !shops.hasNext()) { - if (chunks == null || !chunks.hasNext()) { - if (!worlds.hasNext()) { - throw new NoSuchElementException("No more shops to iterate over!"); - } - chunks = worlds.next().values().iterator(); - } - shops = chunks.next().values().iterator(); - } - if (!shops.hasNext()) { - return this.next(); // Skip to the next one (Empty iterator?) - } - return shops.next(); - } - } public static class InteractiveManager implements ShopManager.InteractiveManager { private final Map actions = Maps.newConcurrentMap(); private final QuickShop plugin; @@ -1313,4 +1274,58 @@ private void sendRequest(UUID uuid) { } } } + + public class ShopIterator implements Iterator { + + protected final Iterator>> worlds; + + protected Iterator> chunks; + + protected Iterator shops; + + public ShopIterator() { + worlds = getShops().values().iterator(); + } + + /** + * Returns true if there is still more shops to iterate over. + */ + @Override + public boolean hasNext() { + if (shops == null || !shops.hasNext()) { + if (chunks == null || !chunks.hasNext()) { + if (!worlds.hasNext()) { + return false; + } else { + chunks = worlds.next().values().iterator(); + return hasNext(); + } + } else { + shops = chunks.next().values().iterator(); + return hasNext(); + } + } + return true; + } + + /** + * Fetches the next shop. Throws NoSuchElementException if there are no more shops. + */ + @Override + public @NotNull Shop next() { + if (shops == null || !shops.hasNext()) { + if (chunks == null || !chunks.hasNext()) { + if (!worlds.hasNext()) { + throw new NoSuchElementException("No more shops to iterate over!"); + } + chunks = worlds.next().values().iterator(); + } + shops = chunks.next().values().iterator(); + } + if (!shops.hasNext()) { + return this.next(); // Skip to the next one (Empty iterator?) + } + return shops.next(); + } + } } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java index 9f56663efe..5f40a1199d 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/history/ShopHistoryGUI.java @@ -19,7 +19,6 @@ import com.github.stefvanschie.inventoryframework.pane.StaticPane; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.entity.Player; diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java index e4725f577b..c9c06040e1 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/inventory/BukkitInventoryWrapperManager.java @@ -5,18 +5,15 @@ import com.ghostchu.quickshop.api.serialize.BlockPos; import com.ghostchu.quickshop.common.util.CommonUtil; import com.ghostchu.quickshop.common.util.JsonUtil; -import com.ghostchu.quickshop.util.PackageUtil; -import com.ghostchu.quickshop.util.Util; import com.ghostchu.quickshop.util.logger.Log; import com.ghostchu.quickshop.util.performance.PerfMonitor; import lombok.Builder; import lombok.Data; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockState; -import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.type.Chest; import org.bukkit.inventory.InventoryHolder; import org.jetbrains.annotations.NotNull; @@ -81,6 +78,12 @@ private InventoryWrapper locateOld(String symbolLink) { } } + public @NotNull String mklink(@NotNull Location location) throws IllegalArgumentException { + try (PerfMonitor ignored = new PerfMonitor("Mklink inventory wrapper")) { + return new BlockPos(location).serialize(); + } + } + @Deprecated public enum HolderType { BLOCK("block"), UNKNOWN("unknown"); From 05a38789b4bd97209839f8db702531daf0de6e2f Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:00:50 +0800 Subject: [PATCH 71/81] Mark 1.20.6 & Java 21 support --- .github/workflows/mc-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mc-publish.yml b/.github/workflows/mc-publish.yml index c52e8ebac8..c6313c066a 100644 --- a/.github/workflows/mc-publish.yml +++ b/.github/workflows/mc-publish.yml @@ -43,10 +43,11 @@ jobs: paper purpur game-versions: | - >=1.18.2 <=1.20.5 + >=1.18.2 <=1.20.6 game-version-filter: releases java: | 17 + 21 dependencies: | essentialsx(optional) nbtapi(optional) From ccf5c74f073543d002712ba84830048c69b49795 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:01:48 +0800 Subject: [PATCH 72/81] bump version --- 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 +- platform/quickshop-platform-spigot-v1_20_R4/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/addon/bluemap/pom.xml b/addon/bluemap/pom.xml index 5563f05806..86141d73f2 100644 --- a/addon/bluemap/pom.xml +++ b/addon/bluemap/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/discordsrv/pom.xml b/addon/discordsrv/pom.xml index e5a4b93034..c426425e4a 100644 --- a/addon/discordsrv/pom.xml +++ b/addon/discordsrv/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/discount/pom.xml b/addon/discount/pom.xml index f132b507d5..b31928bed4 100644 --- a/addon/discount/pom.xml +++ b/addon/discount/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/displaycontrol/pom.xml b/addon/displaycontrol/pom.xml index 597adfd3f5..e6b9865d11 100644 --- a/addon/displaycontrol/pom.xml +++ b/addon/displaycontrol/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/dynmap/pom.xml b/addon/dynmap/pom.xml index 9e5648c5c4..1a62c02784 100644 --- a/addon/dynmap/pom.xml +++ b/addon/dynmap/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/limited/pom.xml b/addon/limited/pom.xml index e49cdc4d6d..be20e7043d 100644 --- a/addon/limited/pom.xml +++ b/addon/limited/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/list/pom.xml b/addon/list/pom.xml index eed08e7776..70709d4cb9 100644 --- a/addon/list/pom.xml +++ b/addon/list/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/plan/pom.xml b/addon/plan/pom.xml index d8d493a7a2..05f63a5005 100644 --- a/addon/plan/pom.xml +++ b/addon/plan/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/reremake-migrator/pom.xml b/addon/reremake-migrator/pom.xml index dc0de76e01..90e55156db 100644 --- a/addon/reremake-migrator/pom.xml +++ b/addon/reremake-migrator/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/addon/shopitemonly/pom.xml b/addon/shopitemonly/pom.xml index 6199acb5fb..48cc457af7 100644 --- a/addon/shopitemonly/pom.xml +++ b/addon/shopitemonly/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.addon diff --git a/compatibility/advancedregionmarket/pom.xml b/compatibility/advancedregionmarket/pom.xml index f79eec45dd..892200cbd5 100644 --- a/compatibility/advancedregionmarket/pom.xml +++ b/compatibility/advancedregionmarket/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/angelchest/pom.xml b/compatibility/angelchest/pom.xml index 320532ac52..fab296eef3 100644 --- a/compatibility/angelchest/pom.xml +++ b/compatibility/angelchest/pom.xml @@ -6,7 +6,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/bentobox/pom.xml b/compatibility/bentobox/pom.xml index b005d742a6..9285bae4d5 100644 --- a/compatibility/bentobox/pom.xml +++ b/compatibility/bentobox/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/bungeecord-geyser/pom.xml b/compatibility/bungeecord-geyser/pom.xml index e64e95c8bb..a0142f6987 100644 --- a/compatibility/bungeecord-geyser/pom.xml +++ b/compatibility/bungeecord-geyser/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/bungeecord/pom.xml b/compatibility/bungeecord/pom.xml index a68f338646..546fc81191 100644 --- a/compatibility/bungeecord/pom.xml +++ b/compatibility/bungeecord/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/chestprotect/pom.xml b/compatibility/chestprotect/pom.xml index 87545a77f3..e8d14f3a86 100644 --- a/compatibility/chestprotect/pom.xml +++ b/compatibility/chestprotect/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/clearlag/pom.xml b/compatibility/clearlag/pom.xml index 2cda686d36..fc7706a34d 100644 --- a/compatibility/clearlag/pom.xml +++ b/compatibility/clearlag/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/common/pom.xml b/compatibility/common/pom.xml index 3885bf9061..d18fd0306f 100644 --- a/compatibility/common/pom.xml +++ b/compatibility/common/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/ecoenchants/pom.xml b/compatibility/ecoenchants/pom.xml index abe72da898..2d05d7c9bd 100644 --- a/compatibility/ecoenchants/pom.xml +++ b/compatibility/ecoenchants/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/elitemobs/pom.xml b/compatibility/elitemobs/pom.xml index 661943102d..34dadfec61 100644 --- a/compatibility/elitemobs/pom.xml +++ b/compatibility/elitemobs/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/griefprevention/pom.xml b/compatibility/griefprevention/pom.xml index 5577021642..2281b1f2f8 100644 --- a/compatibility/griefprevention/pom.xml +++ b/compatibility/griefprevention/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/itemsadder/pom.xml b/compatibility/itemsadder/pom.xml index 0a3ea89b1f..bbc2c09d4c 100644 --- a/compatibility/itemsadder/pom.xml +++ b/compatibility/itemsadder/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/lands/pom.xml b/compatibility/lands/pom.xml index b6287ec671..5209c66ac2 100644 --- a/compatibility/lands/pom.xml +++ b/compatibility/lands/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/openinv/pom.xml b/compatibility/openinv/pom.xml index 929ae706be..05193bcab7 100644 --- a/compatibility/openinv/pom.xml +++ b/compatibility/openinv/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/plotsquared/pom.xml b/compatibility/plotsquared/pom.xml index 9d2e0fd2c0..4c07c5e385 100644 --- a/compatibility/plotsquared/pom.xml +++ b/compatibility/plotsquared/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/reforges/pom.xml b/compatibility/reforges/pom.xml index 80e32afd10..55fa5745a2 100644 --- a/compatibility/reforges/pom.xml +++ b/compatibility/reforges/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/residence/pom.xml b/compatibility/residence/pom.xml index 21a2393dfc..d15a5b19f9 100644 --- a/compatibility/residence/pom.xml +++ b/compatibility/residence/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/slimefun/pom.xml b/compatibility/slimefun/pom.xml index 05344096cf..2d74481eba 100644 --- a/compatibility/slimefun/pom.xml +++ b/compatibility/slimefun/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/superiorskyblock/pom.xml b/compatibility/superiorskyblock/pom.xml index ff8336349f..f2caf92050 100644 --- a/compatibility/superiorskyblock/pom.xml +++ b/compatibility/superiorskyblock/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/towny/pom.xml b/compatibility/towny/pom.xml index 5545b59332..a89c93a908 100644 --- a/compatibility/towny/pom.xml +++ b/compatibility/towny/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/velocity/pom.xml b/compatibility/velocity/pom.xml index 72ab012d61..aadb15b029 100644 --- a/compatibility/velocity/pom.xml +++ b/compatibility/velocity/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/voidchest/pom.xml b/compatibility/voidchest/pom.xml index 33dfd7d427..d8549265e8 100644 --- a/compatibility/voidchest/pom.xml +++ b/compatibility/voidchest/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/worldedit/pom.xml b/compatibility/worldedit/pom.xml index 2218a7fd2c..9584ae8b0d 100644 --- a/compatibility/worldedit/pom.xml +++ b/compatibility/worldedit/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/compatibility/worldguard/pom.xml b/compatibility/worldguard/pom.xml index 56c8593452..faba475d6e 100644 --- a/compatibility/worldguard/pom.xml +++ b/compatibility/worldguard/pom.xml @@ -7,7 +7,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml com.ghostchu.quickshop.compatibility diff --git a/platform/quickshop-platform-interface/pom.xml b/platform/quickshop-platform-interface/pom.xml index a526aa70a8..8a5ceab7cd 100644 --- a/platform/quickshop-platform-interface/pom.xml +++ b/platform/quickshop-platform-interface/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-paper/pom.xml b/platform/quickshop-platform-paper/pom.xml index 3e60e55a20..2a2a4c3b5d 100644 --- a/platform/quickshop-platform-paper/pom.xml +++ b/platform/quickshop-platform-paper/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-abstract/pom.xml b/platform/quickshop-platform-spigot-abstract/pom.xml index e7861f42f9..94cac45529 100644 --- a/platform/quickshop-platform-spigot-abstract/pom.xml +++ b/platform/quickshop-platform-spigot-abstract/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_18_R1/pom.xml b/platform/quickshop-platform-spigot-v1_18_R1/pom.xml index f4a9b0019d..95b3b99648 100644 --- a/platform/quickshop-platform-spigot-v1_18_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_18_R1/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_18_R2/pom.xml b/platform/quickshop-platform-spigot-v1_18_R2/pom.xml index a44db68e83..3ca36b8184 100644 --- a/platform/quickshop-platform-spigot-v1_18_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_18_R2/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_19_R1/pom.xml b/platform/quickshop-platform-spigot-v1_19_R1/pom.xml index 0501903655..253dfe8a21 100644 --- a/platform/quickshop-platform-spigot-v1_19_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R1/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_19_R2/pom.xml b/platform/quickshop-platform-spigot-v1_19_R2/pom.xml index b8503920e9..d7c87f316f 100644 --- a/platform/quickshop-platform-spigot-v1_19_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R2/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_19_R3/pom.xml b/platform/quickshop-platform-spigot-v1_19_R3/pom.xml index a848527ca1..a6408d3bb9 100644 --- a/platform/quickshop-platform-spigot-v1_19_R3/pom.xml +++ b/platform/quickshop-platform-spigot-v1_19_R3/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_20_R1/pom.xml b/platform/quickshop-platform-spigot-v1_20_R1/pom.xml index ab671ea54c..bfe2eb36f8 100644 --- a/platform/quickshop-platform-spigot-v1_20_R1/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R1/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_20_R2/pom.xml b/platform/quickshop-platform-spigot-v1_20_R2/pom.xml index 7c4f801745..6c7317e3a2 100644 --- a/platform/quickshop-platform-spigot-v1_20_R2/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R2/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_20_R3/pom.xml b/platform/quickshop-platform-spigot-v1_20_R3/pom.xml index 173a5f84b0..03e5452117 100644 --- a/platform/quickshop-platform-spigot-v1_20_R3/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R3/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml index a095cc1155..b4d7eaacff 100644 --- a/platform/quickshop-platform-spigot-v1_20_R4/pom.xml +++ b/platform/quickshop-platform-spigot-v1_20_R4/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 ../../pom.xml diff --git a/pom.xml b/pom.xml index df6828c5f4..529edb6d1b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 pom quickshop-hikari Another QuickShop fork diff --git a/quickshop-api/pom.xml b/quickshop-api/pom.xml index 6885f97835..03383f8eae 100644 --- a/quickshop-api/pom.xml +++ b/quickshop-api/pom.xml @@ -5,7 +5,7 @@ quickshop-hikari com.ghostchu - 6.1.0.2 + 6.2.0.0 4.0.0 diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index b504e6a0f6..0f0ac16164 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -8,7 +8,7 @@ com.ghostchu quickshop-hikari - 6.1.0.2 + 6.2.0.0 quickshop-bukkit diff --git a/quickshop-common/pom.xml b/quickshop-common/pom.xml index 0b7d9b26ce..f279f51e07 100644 --- a/quickshop-common/pom.xml +++ b/quickshop-common/pom.xml @@ -5,7 +5,7 @@ quickshop-hikari com.ghostchu - 6.1.0.2 + 6.2.0.0 4.0.0 From a9498dab867e33badc9542475bdbd849cb006aeb Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:05:51 +0800 Subject: [PATCH 73/81] fix build error --- .../addon/reremakemigrator/migratecomponent/ShopMigrate.java | 1 - 1 file changed, 1 deletion(-) diff --git a/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java b/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java index 4f23477548..cde39f51c4 100644 --- a/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java +++ b/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java @@ -10,7 +10,6 @@ import com.ghostchu.quickshop.obj.QUserImpl; import com.ghostchu.quickshop.shop.ContainerShop; import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapper; -import com.ghostchu.quickshop.shop.inventory.BukkitListenerDrivenInventoryWrapper; import com.ghostchu.quickshop.util.ProgressMonitor; import com.ghostchu.quickshop.util.performance.BatchBukkitExecutor; import com.google.common.io.Files; From 555155991f1a387ce22d3aa87cfda00a21faf3c7 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:06:44 +0800 Subject: [PATCH 74/81] fix build error --- .../addon/reremakemigrator/migratecomponent/ShopMigrate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java b/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java index cde39f51c4..ae96b08a0b 100644 --- a/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java +++ b/addon/reremake-migrator/src/main/java/com/ghostchu/quickshop/addon/reremakemigrator/migratecomponent/ShopMigrate.java @@ -9,7 +9,7 @@ import com.ghostchu.quickshop.economy.SimpleBenefit; import com.ghostchu.quickshop.obj.QUserImpl; import com.ghostchu.quickshop.shop.ContainerShop; -import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapper; +import com.ghostchu.quickshop.shop.inventory.BukkitInventoryWrapperManager; import com.ghostchu.quickshop.util.ProgressMonitor; import com.ghostchu.quickshop.util.performance.BatchBukkitExecutor; import com.google.common.io.Files; @@ -83,7 +83,7 @@ public boolean migrate() { reremakeShop.isDisableDisplay(), reremakeShop.getTaxAccountActual() == null ? null : QUserImpl.createSync(getHikari().getPlayerFinder(), reremakeShop.getTaxAccountActual()), getHikari().getJavaPlugin().getName(), - getHikari().getInventoryWrapperManager().mklink(new BukkitInventoryWrapper(container.getInventory())), + ((BukkitInventoryWrapperManager)getHikari().getInventoryWrapperManager()).mklink(reremakeShop.getLocation()), null, Collections.emptyMap(), new SimpleBenefit() From 71398dbbad928aeb1efa5dd1e4a3602dd6a252ca Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:16:14 +0800 Subject: [PATCH 75/81] hacky adapt to the old versions --- .../com/ghostchu/quickshop/shop/SimpleShopManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 837f39a13e..52f5608591 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -868,7 +868,9 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); } - chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW) + .append(translation) + .append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } } } else { @@ -886,7 +888,8 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { } chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); //Because the bukkit API limit, we can't get the actual effect level - chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation)); + int level = potionData.isExtended() ? 2 : 1; + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + RomanNumber.toRoman(level)))); } if (potionMeta.hasCustomEffects()) { for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { From 2955e30629f4664e34d00bea933ae98a52e840ac Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:25:10 +0800 Subject: [PATCH 76/81] Revert "hacky adapt to the old versions" This reverts commit 71398dbbad928aeb1efa5dd1e4a3602dd6a252ca. --- .../com/ghostchu/quickshop/shop/SimpleShopManager.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 52f5608591..837f39a13e 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -868,9 +868,7 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); } - chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW) - .append(translation) - .append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } } } else { @@ -888,8 +886,7 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { } chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); //Because the bukkit API limit, we can't get the actual effect level - int level = potionData.isExtended() ? 2 : 1; - chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + RomanNumber.toRoman(level)))); + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation)); } if (potionMeta.hasCustomEffects()) { for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { From 0209d1cffe1e4593579666b05da0ff3cbdff958a Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:26:51 +0800 Subject: [PATCH 77/81] remove useless if statement --- .../quickshop/shop/SimpleShopManager.java | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index 837f39a13e..d57c36e309 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -872,34 +872,32 @@ public void sendShopInfo(@NotNull Player p, @NotNull Shop shop) { } } } else { - if (shouldDisplayPotionEffects) { - if (items.getItemMeta() instanceof PotionMeta potionMeta) { - PotionData potionData = potionMeta.getBasePotionData(); - PotionEffectType potionEffectType = potionData.getType().getEffectType(); - if (potionEffectType != null) { + if (items.getItemMeta() instanceof PotionMeta potionMeta) { + PotionData potionData = potionMeta.getBasePotionData(); + PotionEffectType potionEffectType = potionData.getType().getEffectType(); + if (potionEffectType != null) { + Component translation; + try { + translation = plugin.getPlatform().getTranslation(potionEffectType); + } catch (Throwable th) { + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffectType.getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffectType.getKey(), th); + } + chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); + //Because the bukkit API limit, we can't get the actual effect level + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation)); + } + if (potionMeta.hasCustomEffects()) { + for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { + int level = potionEffect.getAmplifier(); Component translation; try { - translation = plugin.getPlatform().getTranslation(potionEffectType); + translation = plugin.getPlatform().getTranslation(potionEffect.getType()); } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffectType.getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffectType.getKey(), th); - } - chatSheetPrinter.printLine(plugin.text().of(p, "menu.effects").forLocale()); - //Because the bukkit API limit, we can't get the actual effect level - chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation)); - } - if (potionMeta.hasCustomEffects()) { - for (PotionEffect potionEffect : potionMeta.getCustomEffects()) { - int level = potionEffect.getAmplifier(); - Component translation; - try { - translation = plugin.getPlatform().getTranslation(potionEffect.getType()); - } catch (Throwable th) { - translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); - plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); - } - chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); + translation = MsgUtil.setHandleFailedHover(p, Component.text(potionEffect.getType().getName())); + plugin.logger().warn("Failed to handle translation for PotionEffect {}", potionEffect.getType().getKey(), th); } + chatSheetPrinter.printLine(Component.empty().color(NamedTextColor.YELLOW).append(translation).append(Component.text(" " + (level <= 10 ? RomanNumber.toRoman(level) : level)))); } } } From c91d4a4804269c08ea607e38db4a6ddfba4a487b Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:29:13 +0800 Subject: [PATCH 78/81] fix tax missing currency --- .../java/com/ghostchu/quickshop/shop/SimpleShopManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java index d57c36e309..c54603dbf6 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/SimpleShopManager.java @@ -723,7 +723,7 @@ public void sendPurchaseSuccess(@NotNull QUser purchaser, @NotNull Shop shop, in chatSheetPrinter.printHeader(); chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.successful-purchase").forLocale()); if (showTax) { - chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price-tax", Component.text(amount * shop.getItem().getAmount()), Util.getItemStackName(shop.getItem()), format(total, shop), tax).forLocale()); + chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price-tax", Component.text(amount * shop.getItem().getAmount()), Util.getItemStackName(shop.getItem()), format(total, shop), format(tax,shop)).forLocale()); } else { chatSheetPrinter.printLine(plugin.text().of(purchaser, "menu.item-name-and-price", Component.text(amount * shop.getItem().getAmount()), Util.getItemStackName(shop.getItem()), format(total, shop)).forLocale()); } From c8ed9eeafb6cfa27a09f0067c81b012b6b0f3dc7 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 14 May 2024 23:58:47 +0800 Subject: [PATCH 79/81] Fix stop db queries --- .../quickshop/command/subcommand/SubCommand_Debug.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index b904ccae84..0809ba269f 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -193,10 +193,8 @@ private void handleDbConnectionTest(CommandSender sender, List subParams } private void handleStopDbQueries(CommandSender sender, List subParams) { - long stopped = plugin.getSqlManager().getActiveQuery().values().stream().map(s -> { - s.close(); - return null; - }).count(); + long stopped = plugin.getSqlManager().getActiveQuery().values().size(); + plugin.getSqlManager().getActiveQuery().values().forEach(SQLQuery::close); plugin.text().of(sender, "debug.queries-stopped", stopped).send(); } From 0eaedbb6dda675319f6beacff06c23749cabc933 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Wed, 15 May 2024 00:04:03 +0800 Subject: [PATCH 80/81] Remove unused debug command --- .../command/subcommand/SubCommand_Debug.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index 0809ba269f..dde0ddf3ef 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -9,7 +9,6 @@ import com.ghostchu.quickshop.api.command.CommandParser; import com.ghostchu.quickshop.api.shop.Shop; import com.ghostchu.quickshop.common.util.QuickExecutor; -import com.ghostchu.quickshop.shop.ContainerShop; import com.ghostchu.quickshop.shop.SimpleShopManager; import com.ghostchu.quickshop.shop.cache.SimpleShopCache; import com.ghostchu.quickshop.shop.display.AbstractDisplayItem; @@ -75,27 +74,6 @@ public SubCommand_Debug(QuickShop plugin) { subParamMapping.put("item-info", this::handleItemInfo); subParamMapping.put("mark-all-shops-dirty", this::handleShopsDirtyAndSave); subParamMapping.put("clean-display-entities", this::handleDisplayEntities); - subParamMapping.put("remove-container-shop-inventory-wrapper-cache", this::handleRemoveInventoryWrapperCache); - } - - private void handleRemoveInventoryWrapperCache(CommandSender sender, List strings) { - Shop shop = getLookingShop(sender); - if (shop == null) { - plugin.text().of(sender, "not-looking-at-shop").send(); - return; - } - ContainerShop containerShop = (ContainerShop) shop; - - try { - Field f = containerShop.getClass().getDeclaredField("inventoryWrapper"); - f.setAccessible(true); - f.set(containerShop, null); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(e); - } - - sender.sendMessage("Cleared! Re-locating InventoryWrapper..."); - shop.getInventory(); } private void handleDisplayEntities(CommandSender sender, List strings) { From 04bb91dff74a4d101f32593dd6850c1578621f82 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Wed, 15 May 2024 22:02:04 +0800 Subject: [PATCH 81/81] clean up --- .../ghostchu/quickshop/command/subcommand/SubCommand_Debug.java | 1 - 1 file changed, 1 deletion(-) diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java index dde0ddf3ef..4cbf6fbe2a 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Debug.java @@ -262,7 +262,6 @@ private void handleProperty(CommandSender sender, List subParams) { } else { String oldOne = System.setProperty(key, value); plugin.text().of(sender, "debug.property-changed", key, oldOne, value).send(); - sender.sendMessage("Property " + key + " has been changed from " + oldOne + " to " + value); } }