Skip to content

Commit e57f428

Browse files
committed
Add option 'legacy-updater' to enable/disable the data updater
1 parent 0db27cf commit e57f428

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/main/java/org/maxgamer/quickshop/QuickShop.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ private void load3rdParty() {
350350
}
351351
if (getConfiguration().getBoolean("plugin.WorldEdit")) {
352352
String nmsVersion = ReflectFactory.getNMSVersion();
353-
// GameVersion gameVersion = GameVersion.get(nmsVersion);
353+
// GameVersion gameVersion = GameVersion.get(nmsVersion);
354354
this.worldEditPlugin = Bukkit.getPluginManager().getPlugin("WorldEdit");
355355
if (this.worldEditPlugin != null) {
356356
this.worldEditAdapter = new WorldEditAdapter(this, (WorldEditPlugin) this.worldEditPlugin);
@@ -1947,7 +1947,12 @@ private void updateConfig(int selectedVersion) throws IOException {
19471947
getConfiguration().set("config-version", ++selectedVersion);
19481948
}
19491949

1950-
1950+
if (selectedVersion == 144) {
1951+
// Updater set it to true because plugin upgrading
1952+
// Default configuration disable it cause probably fresh install
1953+
getConfiguration().getOrDefault("legacy-updater.shop-sign", true);
1954+
getConfiguration().set("config-version", ++selectedVersion);
1955+
}
19511956
if (getConfiguration().getInt("matcher.work-type") != 0 && GameVersion.get(ReflectFactory.getServerVersion()).name().contains("1_16")) {
19521957
getLogger().warning("You are not using QS Matcher, it may meeting item comparing issue mentioned there: https://hub.spigotmc.org/jira/browse/SPIGOT-5063");
19531958
}

src/main/java/org/maxgamer/quickshop/api/shop/Shop.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ default boolean isShopSign(@NotNull Sign sign, @Nullable Shop shop) {
590590
if (lines[1].startsWith(SHOP_SIGN_PATTERN)) {
591591
return true;
592592
} else {
593+
if (!QuickShop.getInstance().getConfiguration().getOrDefault("legacy-updater.shop-sign", false)) {
594+
return false;
595+
}
593596
String header = lines[0];
594597
String adminShopHeader = QuickShop.getInstance().text().of("signs.header", QuickShop.getInstance().text().of("admin-shop").forLocale()).forLocale();
595598
String signHeaderUsername = QuickShop.getInstance().text().of("signs.header", this.ownerName(true)).forLocale();

src/main/resources/config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# QuickShop-Reremake Plugin Configuration
22

33
#Do not touch this if you don't know what you're doing!
4-
config-version: 144
4+
config-version: 145
55

66
#This language will used by Shop signs and other texts that direct write on the block/entity.
77
language: en-US
@@ -763,6 +763,12 @@ debug:
763763
#Setting this to false will disable the loading of corrupt shops!
764764
delete-corrupt-shops: false
765765

766+
# Legacy data updater
767+
# Turn on this will make QuickShop to execute extra checks and may affect performance.
768+
# Only turn it on when you updating from old versions.
769+
legacy-updater:
770+
shop-sign: false
771+
766772
custom-commands:
767773
- shop
768774
- chestshop

0 commit comments

Comments
 (0)