Added server mod error check
This commit is contained in:
@@ -54,9 +54,10 @@ public abstract class Content implements Comparable<Content>{
|
|||||||
/** The mod that loaded this piece of content. */
|
/** The mod that loaded this piece of content. */
|
||||||
public @Nullable LoadedMod mod;
|
public @Nullable LoadedMod mod;
|
||||||
/** File that this content was loaded from. */
|
/** File that this content was loaded from. */
|
||||||
public @Nullable
|
public @Nullable Fi sourceFile;
|
||||||
Fi sourceFile;
|
|
||||||
/** The error that occurred during loading, if applicable. Null if no error occurred. */
|
/** The error that occurred during loading, if applicable. Null if no error occurred. */
|
||||||
public @Nullable String error;
|
public @Nullable String error;
|
||||||
|
/** Base throwable that caused the error. */
|
||||||
|
public @Nullable Throwable baseError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -437,6 +437,7 @@ public class ContentParser{
|
|||||||
content.minfo.mod = mod;
|
content.minfo.mod = mod;
|
||||||
content.minfo.sourceFile = file;
|
content.minfo.sourceFile = file;
|
||||||
content.minfo.error = makeError(error, file);
|
content.minfo.error = makeError(error, file);
|
||||||
|
content.minfo.baseError = error;
|
||||||
if(mod != null){
|
if(mod != null){
|
||||||
mod.erroredContent.add(content);
|
mod.erroredContent.add(content);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=2db5436d41081362f15d1cf2175293a521d16e6f
|
archash=96b64c172da9fed6b23440372fd6c7a081b6ca2e
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import io.anuke.arc.files.*;
|
|||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.core.*;
|
import io.anuke.mindustry.core.*;
|
||||||
|
import io.anuke.mindustry.ctype.*;
|
||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
import io.anuke.mindustry.mod.*;
|
import io.anuke.mindustry.mod.*;
|
||||||
|
import io.anuke.mindustry.mod.Mods.*;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.net.*;
|
import io.anuke.mindustry.net.*;
|
||||||
|
|
||||||
@@ -58,6 +60,19 @@ public class ServerLauncher implements ApplicationListener{
|
|||||||
mods.loadScripts();
|
mods.loadScripts();
|
||||||
content.createModContent();
|
content.createModContent();
|
||||||
content.init();
|
content.init();
|
||||||
|
if(mods.hasContentErrors()){
|
||||||
|
Log.err("Error occurred loading mod content:");
|
||||||
|
for(LoadedMod mod : mods.list()){
|
||||||
|
if(mod.hasContentErrors()){
|
||||||
|
Log.err("| &ly[{0}]", mod.name);
|
||||||
|
for(Content cont : mod.erroredContent){
|
||||||
|
Log.err("| | &y{0}: &c{1}", cont.minfo.sourceFile.name(), Strings.getSimpleMessage(cont.minfo.baseError).replace("\n", " "));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.err("The server will now exit.");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
Core.app.addListener(logic = new Logic());
|
Core.app.addListener(logic = new Logic());
|
||||||
Core.app.addListener(netServer = new NetServer());
|
Core.app.addListener(netServer = new NetServer());
|
||||||
|
|||||||
Reference in New Issue
Block a user