Blacklisted ui-lib (startup crash)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -254,9 +254,14 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
text.row();
|
||||
|
||||
String tooltip = null;
|
||||
|
||||
if(item.isOutdated()){
|
||||
text.labelWrap("@mod.outdatedv7").growX();
|
||||
text.row();
|
||||
}else if(item.isBlacklisted()){
|
||||
text.labelWrap("@mod.blacklisted").growX();
|
||||
text.row();
|
||||
}else if(!item.isSupported()){
|
||||
text.labelWrap(Core.bundle.format("mod.requiresversion", item.meta.minGameVersion)).growX();
|
||||
text.row();
|
||||
|
||||
Reference in New Issue
Block a user