mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Add user-friendly message when host can't connect to ecloud
This commit is contained in:
parent
e95f1b4850
commit
449c927c6c
@ -47,6 +47,10 @@ public class PlaceholderAPIConfig {
|
||||
return plugin.getConfig().getBoolean("cloud_enabled");
|
||||
}
|
||||
|
||||
public boolean isDebugMode() {
|
||||
return plugin.getConfig().getBoolean("debug", false);
|
||||
}
|
||||
|
||||
public void setCloudEnabled(boolean b) {
|
||||
plugin.getConfig().set("cloud_enabled", b);
|
||||
plugin.reloadConfig();
|
||||
|
@ -169,8 +169,13 @@ public class ExpansionCloudManager {
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(API_URL).openStream()))) {
|
||||
data.putAll(GSON.fromJson(reader, new TypeToken<Map<String, CloudExpansion>>() {}.getType()));
|
||||
} catch (Exception ex) {
|
||||
if (plugin.getPlaceholderAPIConfig().isDebugMode()) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
else {
|
||||
plugin.getLogger().warning("Unable to fetch expansions!\nThere was an error with the server host connecting to the PlaceholderAPI eCloud (https://api.extendedclip.com/v2/)");
|
||||
}
|
||||
}
|
||||
|
||||
final List<CloudExpansion> unsorted = new ArrayList<>();
|
||||
|
||||
|
@ -15,3 +15,4 @@ boolean:
|
||||
'true': 'yes'
|
||||
'false': 'no'
|
||||
date_format: MM/dd/yy HH:mm:ss
|
||||
debug: false
|
||||
|
Loading…
Reference in New Issue
Block a user