mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-06 08:57:45 +07:00
Fixed #8328
This commit is contained in:
parent
4410f31888
commit
39e88ae614
@ -428,7 +428,7 @@ public class Mods implements Loadable{
|
||||
|
||||
// Add local mods
|
||||
Seq.with(modDirectory.list())
|
||||
.filter(f -> f.extEquals("jar") || f.extEquals("zip") || (f.isDirectory() && (f.child("mod.json").exists() || f.child("mod.hjson").exists())))
|
||||
.filter(f -> f.extEquals("jar") || f.extEquals("zip") || (f.isDirectory() && Structs.contains(metaFiles, meta -> f.child(meta).exists())))
|
||||
.each(candidates::add);
|
||||
|
||||
// Add Steam workshop mods
|
||||
@ -1075,6 +1075,9 @@ public class Mods implements Loadable{
|
||||
|
||||
/** @return whether this mod is supported by the game version */
|
||||
public boolean isSupported(){
|
||||
//no unsupported mods on servers
|
||||
if(headless) return true;
|
||||
|
||||
if(isOutdated() || isBlacklisted()) return false;
|
||||
|
||||
return Version.isAtLeast(meta.minGameVersion);
|
||||
|
@ -265,8 +265,17 @@ public class ServerControl implements ApplicationListener{
|
||||
Core.settings.forceSave();
|
||||
}, saveInterval, saveInterval);
|
||||
|
||||
if(!mods.list().isEmpty()){
|
||||
info("@ mods loaded.", mods.list().size);
|
||||
if(!mods.orderedMods().isEmpty()){
|
||||
info("@ mods loaded.", mods.orderedMods().size);
|
||||
}
|
||||
|
||||
int unsupported = mods.list().count(l -> !l.enabled());
|
||||
|
||||
if(unsupported > 0){
|
||||
Log.err("There were errors loading @ mod(s):", unsupported);
|
||||
for(LoadedMod mod : mods.list().select(l -> !l.enabled())){
|
||||
Log.err("- @ &ly(" + mod.state + ")", mod.meta.name);
|
||||
}
|
||||
}
|
||||
|
||||
toggleSocket(Config.socketInput.bool());
|
||||
@ -459,7 +468,7 @@ public class ServerControl implements ApplicationListener{
|
||||
if(!mods.list().isEmpty()){
|
||||
info("Mods:");
|
||||
for(LoadedMod mod : mods.list()){
|
||||
info(" @ &fi@", mod.meta.displayName(), mod.meta.version);
|
||||
info(" @ &fi@ " + (mod.enabled() ? "" : " &lr(" + mod.state + ")"), mod.meta.displayName(), mod.meta.version);
|
||||
}
|
||||
}else{
|
||||
info("No mods found.");
|
||||
|
Loading…
Reference in New Issue
Block a user