mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-02-05 11:57:14 +01:00
Merge branch 'hytale' into hytale-curseforge
This commit is contained in:
@@ -142,6 +142,16 @@ public final class CommandECloud extends PlaceholderCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!target.getLabel().equalsIgnoreCase("refresh") && plugin.cloudExpansionManager().isEmpty()) {
|
||||
sender.sendMessage(Message.raw("There is no available data from the eCloud. Please try running ").color(Color.RED)
|
||||
.insert(Message.raw("/papi ecloud refresh").color(Color.WHITE))
|
||||
.insert(Message.raw(" If this does not resolve the issue, the eCloud may be blocked by your firewall, server host or service provider.\n\n").color(Color.RED))
|
||||
.insert(Message.raw("More information: ").color(Color.RED))
|
||||
.insert(Message.raw("https://placeholderapi.com/ecloud-blocked").color(Color.WHITE).bold(true).italic(true).link("https://placeholderapi.com/ecloud-blocked")));
|
||||
// Msg.msg(sender, "&cThere is no available data from the eCloud. Please try running &f/papi ecloud refresh&c. If this does not resolve the issue, the eCloud may be blocked by your firewall, server host, or service provider.\n\nMore information: &fhttps://placeholderapi.com/ecloud-blocked");
|
||||
return;
|
||||
}
|
||||
|
||||
target.evaluate(plugin, sender, search, params.subList(1, params.size()));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.lang.reflect.Type;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -110,6 +111,10 @@ public final class CloudExpansionManager {
|
||||
return Map.copyOf(cache);
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return cache.isEmpty();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Map<String, CloudExpansion> getCloudExpansionsInstalled() {
|
||||
@@ -201,6 +206,8 @@ public final class CloudExpansionManager {
|
||||
for (String name : toRemove) {
|
||||
values.remove(name);
|
||||
}
|
||||
} catch (UnknownHostException e) {
|
||||
logger.atWarning().log("There is no data available from the eCloud. Please try running /papi refresh. If this does not resolve the issue, the eCloud may be blocked by your firewall, server host, or service provider.\n\nMore information: https://placeholderapi.com/ecloud-blocked", e);
|
||||
} catch (Throwable e) {
|
||||
// ugly swallowing of every throwable, but we have to be defensive
|
||||
logger.atWarning().log("Failed to download expansion information", e);
|
||||
|
||||
Reference in New Issue
Block a user