Fix config.yml could not be changed on 1.16+ server

Former-commit-id: c4d0b2ee3bce2a2bf4c829b64a3accf58eebf03c
This commit is contained in:
sandtechnology committed 2020-10-02 23:44:42 +08:00
1 parent 30f88eb63d
commit 8cfb1b67bd
2 files changed
+6 -6

No files matched your search

@@ -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();
@@ -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!");