mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Check and filter unverified expansions
This commit is contained in:
parent
6825c9afc1
commit
7900ee71e0
@ -22,8 +22,6 @@ package me.clip.placeholderapi.expansion.cloud;
|
|||||||
|
|
||||||
import me.clip.placeholderapi.util.TimeUtil;
|
import me.clip.placeholderapi.util.TimeUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -65,7 +65,6 @@ public class ExpansionCloudManager {
|
|||||||
public void clean() {
|
public void clean() {
|
||||||
remote.clear();
|
remote.clear();
|
||||||
downloading.clear();
|
downloading.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDownloading(String expansion) {
|
public boolean isDownloading(String expansion) {
|
||||||
@ -162,7 +161,7 @@ public class ExpansionCloudManager {
|
|||||||
return ex;
|
return ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fetch() {
|
public void fetch(boolean allowUnverified) {
|
||||||
|
|
||||||
plugin.getLogger().info("Fetching available expansion information...");
|
plugin.getLogger().info("Fetching available expansion information...");
|
||||||
|
|
||||||
@ -226,6 +225,10 @@ public class ExpansionCloudManager {
|
|||||||
|
|
||||||
CloudExpansion ce = gson.fromJson(sub.toJSONString(), CloudExpansion.class);
|
CloudExpansion ce = gson.fromJson(sub.toJSONString(), CloudExpansion.class);
|
||||||
|
|
||||||
|
if (!allowUnverified && !ce.isVerified()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ce.getLatestVersion() == null || ce.getVersion(ce.getLatestVersion()) == null) {
|
if (ce.getLatestVersion() == null || ce.getVersion(ce.getLatestVersion()) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -315,7 +318,6 @@ public class ExpansionCloudManager {
|
|||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
|
|
||||||
if (ver == null) {
|
if (ver == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user