Blacklisted ui-lib (startup crash)

This commit is contained in:
Anuken
2022-10-20 19:13:39 -04:00
parent 9a28e97774
commit 7409ff7fd8
3 changed files with 21 additions and 9 deletions

View File

@@ -32,6 +32,7 @@ import static mindustry.Vars.*;
public class Mods implements Loadable{
private static final String[] metaFiles = {"mod.json", "mod.hjson", "plugin.json", "plugin.hjson"};
private static final ObjectSet<String> blacklistedMods = ObjectSet.with("ui-lib");
private Json json = new Json();
private @Nullable Scripts scripts;
@@ -1053,11 +1054,16 @@ public class Mods implements Loadable{
/** @return whether this mod is supported by the game version */
public boolean isSupported(){
if(isOutdated()) return false;
if(isOutdated() || isBlacklisted()) return false;
return Version.isAtLeast(meta.minGameVersion);
}
/** Some mods are known to cause issues with the game; this detects and returns whether a mod is manually blacklisted. */
public boolean isBlacklisted(){
return blacklistedMods.contains(name);
}
/** @return whether this mod is outdated, e.g. not compatible with v7. */
public boolean isOutdated(){
//must be at least 136 to indicate v7 compat