Check and filter unverified expansions

This commit is contained in:
extendedclip 2018-04-20 22:22:03 -04:00
parent 6825c9afc1
commit 7900ee71e0
2 changed files with 275 additions and 275 deletions

View File

@ -22,8 +22,6 @@ package me.clip.placeholderapi.expansion.cloud;
import me.clip.placeholderapi.util.TimeUtil;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

View File

@ -65,7 +65,6 @@ public class ExpansionCloudManager {
public void clean() {
remote.clear();
downloading.clear();
}
public boolean isDownloading(String expansion) {
@ -162,7 +161,7 @@ public class ExpansionCloudManager {
return ex;
}
public void fetch() {
public void fetch(boolean allowUnverified) {
plugin.getLogger().info("Fetching available expansion information...");
@ -226,6 +225,10 @@ public class ExpansionCloudManager {
CloudExpansion ce = gson.fromJson(sub.toJSONString(), CloudExpansion.class);
if (!allowUnverified && !ce.isVerified()) {
continue;
}
if (ce.getLatestVersion() == null || ce.getVersion(ce.getLatestVersion()) == null) {
continue;
}
@ -315,7 +318,6 @@ public class ExpansionCloudManager {
.findFirst()
.orElse(null);
if (ver == null) {
return;
}