From 8cfb1b67bdce2b0895d628c91e9edc9fdc99122a Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Fri, 2 Oct 2020 23:44:42 +0800 Subject: [PATCH] Fix config.yml could not be changed on 1.16+ server Former-commit-id: c4d0b2ee3bce2a2bf4c829b64a3accf58eebf03c --- src/main/java/org/maxgamer/quickshop/QuickShop.java | 7 ++++++- src/main/java/org/maxgamer/quickshop/RuntimeCatcher.java | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 2c1fb268b..d7c5da06b 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -975,9 +975,14 @@ public class QuickShop extends JavaPlugin { } } - @SuppressWarnings("UnusedAssignment") + private void updateConfig(int selectedVersion) { //fixConfiguration(); + GameVersion gameVersion = getRuntimeCatcher().getGameVersion(); + if (gameVersion == GameVersion.v1_16_R1 || gameVersion == GameVersion.v1_16_R2 || gameVersion == GameVersion.UNKNOWN) { + getLogger().warning("Force using QS Matcher due to a spigot bug: https://hub.spigotmc.org/jira/browse/SPIGOT-5063"); + getConfig().set("matcher.work-type", 0); + } String serverUUID = getConfig().getString("server-uuid"); if (serverUUID == null || serverUUID.isEmpty()) { UUID uuid = UUID.randomUUID(); diff --git a/src/main/java/org/maxgamer/quickshop/RuntimeCatcher.java b/src/main/java/org/maxgamer/quickshop/RuntimeCatcher.java index ea6b288da..1c11eb0c3 100644 --- a/src/main/java/org/maxgamer/quickshop/RuntimeCatcher.java +++ b/src/main/java/org/maxgamer/quickshop/RuntimeCatcher.java @@ -44,11 +44,6 @@ public class RuntimeCatcher { plugin.getLogger().warning("Alert: QuickShop may not fully support your current version " + nmsVersion + "/" + ReflectFactory.getServerVersion() + ", Some features may not working."); } - if (gameVersion == GameVersion.v1_16_R1 || gameVersion == GameVersion.v1_16_R2 || gameVersion == GameVersion.UNKNOWN) { - plugin.getLogger().warning("Force using QS Matcher due to a spigot bug: https://hub.spigotmc.org/jira/browse/SPIGOT-5063"); - plugin.getConfig().set("matcher.work-type", 0); - plugin.saveConfig(); - } if (!isSpigotBasedServer(plugin)) { plugin.getLogger().severe("FATAL: QSRR can only be run on Spigot servers and forks of Spigot!"); throw new RuntimeException("Server must be Spigot based, Don't use CraftBukkit!");