Skip to content

Commit af6e01a

Browse files
Fix broken maximumDigitsInPrice config option and config version
1 parent 5d8d286 commit af6e01a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,10 +2223,19 @@ private void updateConfig(int selectedVersion) throws IOException {
22232223
getConfig().set("database.mysql-connect-options", new ArrayList<>(Arrays.asList("autoReconnect=true", "useUnicode=true", "characterEncoding=utf8")));
22242224
getConfig().set("config-version", ++selectedVersion);
22252225
}
2226-
if (selectedVersion == 161) {
2226+
if (selectedVersion == 162) {
22272227
getConfig().set("include-offlineplayer-for-command", false);
22282228
getConfig().set("config-version", ++selectedVersion);
22292229
}
2230+
//Fix broken maximum-digits-in-price option
2231+
if (getConfig().isSet("maximum-digits-in-price")) {
2232+
int maximumDigitsInPrice = getConfig().getInt("maximum-digits-in-price", -1);
2233+
int maximumDigitsInPriceNew = getConfig().getInt("shop.maximum-digits-in-price", -1);
2234+
if (maximumDigitsInPrice != -1 && maximumDigitsInPriceNew == -1) {
2235+
getConfig().set("shop.maximum-digits-in-price", maximumDigitsInPrice);
2236+
}
2237+
getConfig().set("maximum-digits-in-price", null);
2238+
}
22302239
if (getConfig().isSet("shop.shop")) {
22312240
getConfig().set("shop.shop", null);
22322241
}

src/main/java/org/maxgamer/quickshop/shop/SimplePriceLimiter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public SimplePriceLimiter(QuickShop plugin) {
5959
plugin.getConfig().getInt("shop.maximum-price"),
6060
plugin.getConfig().getBoolean("shop.allow-free-shop"),
6161
plugin.getConfig().getBoolean("whole-number-prices-only"),
62-
plugin.getConfig().getInt("maximum-digits-in-price", -1));
62+
plugin.getConfig().getInt("shop.maximum-digits-in-price", -1));
6363
}
6464

6565
private DecimalFormat getDecimalFormat() {

0 commit comments

Comments
 (0)