mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
feat: fetch all expansions (#952)
This commit is contained in:
parent
a497e05e55
commit
f91b4e3752
@ -72,6 +72,11 @@ public final class CommandECloudDownload extends PlaceholderCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!expansion.isVerified() && !plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions()) {
|
||||
Msg.msg(sender, "&cThe expansion '&f" + params.get(0) + "&c' is not verified and can only be downloaded manually from &fhttps://placeholderapi.com/ecloud");
|
||||
return;
|
||||
}
|
||||
|
||||
final CloudExpansion.Version version;
|
||||
if (params.size() < 2) {
|
||||
version = expansion.getVersion(expansion.getLatestVersion());
|
||||
@ -103,9 +108,7 @@ public final class CommandECloudDownload extends PlaceholderCommand {
|
||||
.getVersion() + "] &ato file: &f" + file.getName(),
|
||||
"&aMake sure to type &f/papi reload &ato enable your new expansion!");
|
||||
|
||||
plugin.getCloudExpansionManager().clean();
|
||||
plugin.getCloudExpansionManager()
|
||||
.fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions());
|
||||
plugin.getCloudExpansionManager().load();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,7 @@ public final class CommandECloudRefresh extends PlaceholderCommand {
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
plugin.getCloudExpansionManager().clean();
|
||||
plugin.getCloudExpansionManager()
|
||||
.fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions());
|
||||
plugin.getCloudExpansionManager().load();
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aThe eCloud manager has been refreshed!");
|
||||
|
@ -100,7 +100,7 @@ public final class CloudExpansionManager {
|
||||
|
||||
public void load() {
|
||||
clean();
|
||||
fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions());
|
||||
fetch();
|
||||
}
|
||||
|
||||
public void kill() {
|
||||
@ -170,7 +170,7 @@ public final class CloudExpansionManager {
|
||||
await.clear();
|
||||
}
|
||||
|
||||
public void fetch(final boolean allowUnverified) {
|
||||
public void fetch() {
|
||||
plugin.getLogger().info("Fetching available expansion information...");
|
||||
|
||||
ASYNC_EXECUTOR.submit(
|
||||
@ -190,9 +190,6 @@ public final class CloudExpansionManager {
|
||||
|| expansion.getVersion(expansion.getLatestVersion()) == null) {
|
||||
toRemove.add(entry.getKey());
|
||||
}
|
||||
if (!allowUnverified && !expansion.isVerified()) {
|
||||
toRemove.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
for (String name : toRemove) {
|
||||
@ -203,7 +200,7 @@ public final class CloudExpansionManager {
|
||||
plugin.getLogger().log(Level.WARNING, "Failed to download expansion information", e);
|
||||
}
|
||||
|
||||
// loop thru what's left on the main thread
|
||||
// loop through what's left on the main thread
|
||||
plugin
|
||||
.getServer()
|
||||
.getScheduler()
|
||||
|
Loading…
Reference in New Issue
Block a user