mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-26 18:39:43 -05:00
Add canUpdate Method
This commit is contained in:
1 parent
2b68328fe1
commit
4323602375
1 file changed
+7
@@ -9,11 +9,14 @@ import java.io.*;
|
||||
public class ConfigUpdater {
|
||||
|
||||
private static List<String> NEWEST_CONFIG_INPUT = new ArrayList<>();
|
||||
private static boolean LOADED = false;
|
||||
|
||||
public static void initialize() {
|
||||
NEWEST_CONFIG_INPUT = new ConnectionBuilder().setUrl("https://raw.githubusercontent.com/RayzsYT/ProAntiTab/main/src/main/resources/files/"
|
||||
+ (Reflection.isProxyServer() ? " proxy" : "bukkit")
|
||||
+ "-config.yml").connect().getResponseList();
|
||||
|
||||
LOADED = !NEWEST_CONFIG_INPUT.isEmpty();
|
||||
}
|
||||
|
||||
public static void updateConfigFile(File file, String target, boolean section) {
|
||||
@@ -53,6 +56,10 @@ public class ConfigUpdater {
|
||||
return target;
|
||||
}
|
||||
|
||||
public static boolean canUpdate() {
|
||||
return LOADED;
|
||||
}
|
||||
|
||||
public static int[] getSectionPositionByTarget(List<String> lines, String targetPath, boolean comments) {
|
||||
HashMap<Integer, String> hash = new HashMap<>();
|
||||
int sections = 0;
|
||||
|
||||
Reference in new issue
Block a user