Skip to content

Commit 0d39c45

Browse files
authored
Merge pull request Ghost-chu#1535 from Ghost-chu/master
5.0.0.3
2 parents 3b960e4 + 450f9b5 commit 0d39c45

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<artifactId>QuickShop</artifactId>
2626

2727
<properties>
28-
<pluginver>5.0.0.2</pluginver>
28+
<pluginver>5.0.0.3</pluginver>
2929
<package>org.maxgamer.quickshop</package>
3030
<developer>Ghost-chu</developer>
3131
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -837,9 +837,9 @@
837837
<scope>provided</scope>
838838
</dependency>
839839
<dependency>
840-
<groupId>com.github.simplix-softworks</groupId>
840+
<groupId>org.maxgamer.storage</groupId>
841841
<artifactId>simplixstorage</artifactId>
842-
<version>3.2.3</version>
842+
<version>3.2.3.3</version>
843843
</dependency>
844844
<dependency>
845845
<groupId>de.tr7zw</groupId>

src/main/java/org/maxgamer/quickshop/localization/game/game/distributions/MojangDistribution.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public boolean grabIntoCaches(String url) {
132132
}
133133
requestCachePool.put(url, data);
134134
} catch (IOException e) {
135-
plugin.getLogger().log(Level.WARNING, "Failed to download manifest.json, multi-language system won't work");
135+
e.printStackTrace();
136+
plugin.getLogger().log(Level.WARNING, "Failed to download mojang manifest.json, multi-language system won't work");
136137
return false;
137138
}
138139
return true;

src/main/java/org/maxgamer/quickshop/localization/text/distributions/crowdin/CrowdinOTA.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public String getManifestJson() {
9595
}
9696
requestCachePool.put(url, data);
9797
} catch (IOException e) {
98+
e.printStackTrace();
9899
plugin.getLogger().log(Level.WARNING, "Failed to download manifest.json, multi-language system won't work");
99100
return null;
100101
}
@@ -208,9 +209,10 @@ public String getFile(String fileCrowdinPath, String crowdinLocale, boolean forc
208209
throw new OTAException(response.code(), data);
209210
}
210211
// save to local cache file
211-
Files.write(cachedDataFile.toPath(), data.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.CREATE);
212+
Files.write(cachedDataFile.toPath(), data.getBytes(StandardCharsets.UTF_8));
212213
} catch (IOException e) {
213214
plugin.getLogger().log(Level.WARNING, "Failed to download manifest.json, multi-language system may won't work");
215+
e.printStackTrace();
214216
return "";
215217
}
216218
// update cache index

src/main/java/org/maxgamer/quickshop/util/HttpUtil.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ public class HttpUtil {
3232
protected static final com.google.common.cache.Cache<String, String> requestCachePool = CacheBuilder.newBuilder()
3333
.expireAfterWrite(7, TimeUnit.DAYS)
3434
.build();
35-
private final OkHttpClient client = new OkHttpClient.Builder()
35+
private static final OkHttpClient client = new OkHttpClient.Builder()
3636
.cache(new Cache(getCacheFolder(), 50L * 1024L * 1024L)).build();
3737

3838
public static HttpUtil create() {
3939
return new HttpUtil();
4040
}
4141

4242
public static Response makeGet(@NotNull String url) throws IOException {
43-
return HttpUtil.create().getClient().newCall(new Request.Builder().get().url(url).build()).execute();
43+
return client.newCall(new Request.Builder().get().url(url).build()).execute();
4444
}
4545

4646
public static String createGet(@NotNull String url) {
4747
String cache = requestCachePool.getIfPresent(url);
4848
if (cache != null) {
4949
return cache;
5050
}
51-
try (Response response = HttpUtil.create().getClient().newCall(new Request.Builder().get().url(url).build()).execute()) {
51+
try (Response response = client.newCall(new Request.Builder().get().url(url).build()).execute()) {
5252
val body = response.body();
5353
if (body == null) {
5454
return null;
@@ -65,10 +65,10 @@ public static String createGet(@NotNull String url) {
6565
}
6666

6767
public static Response makePost(@NotNull String url, @NotNull RequestBody body) throws IOException {
68-
return HttpUtil.create().getClient().newCall(new Request.Builder().post(body).url(url).build()).execute();
68+
return client.newCall(new Request.Builder().post(body).url(url).build()).execute();
6969
}
7070

71-
private File getCacheFolder() {
71+
private static File getCacheFolder() {
7272
File file = new File(Util.getCacheFolder(), "okhttp_tmp");
7373
file.mkdirs();
7474
return file;

src/main/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ shop:
285285
#If nothing matches in this list, it falls back to the name of currency itself.
286286
alternate-currency-symbol-list:
287287
- USD;$
288+
- CNY;¥
288289

289290
#This should fix Vault or an economy plugin incorrectly processing the price and returning a "0" result.
290291
#If you enable this setting, then QS will force use the "alternate-currency-symbol".

0 commit comments

Comments
 (0)