Fixed NPE in dedicated server languages. And fixed logger for main FML event bus.

This commit is contained in:
LexManos 2016-04-06 02:11:27 -07:00
parent 07a2b67b7f
commit 7973984227
2 changed files with 15 additions and 7 deletions

View file

@ -63,7 +63,14 @@ public class LoadController
public LoadController(Loader loader)
{
this.loader = loader;
this.masterChannel = new EventBus("FMLMainChannel");
this.masterChannel = new EventBus(new SubscriberExceptionHandler()
{
@Override
public void handleException(Throwable exception, SubscriberExceptionContext context)
{
FMLLog.log("FMLMainChannel", Level.ERROR, exception, "Could not dispatch event: %s to %s", context.getEvent(), context.getSubscriberMethod());
}
});
this.masterChannel.register(this);
state = LoaderState.NOINIT;
@ -159,8 +166,8 @@ public class LoadController
else
{
FMLLog.severe("The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base class" +
"ForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside of" +
"ForgeModLoader, especially Optifine, to see if there are fixes available.");
"ForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside of" +
"ForgeModLoader, especially Optifine, to see if there are fixes available.");
throw new RuntimeException("The ForgeModLoader state engine is invalid");
}
if (toThrow != null && toThrow instanceof RuntimeException)
@ -327,9 +334,9 @@ public class LoadController
return this.state == state;
}
boolean hasReachedState(LoaderState state) {
return this.state.ordinal()>=state.ordinal() && this.state!=LoaderState.ERRORED;
}
boolean hasReachedState(LoaderState state) {
return this.state.ordinal()>=state.ordinal() && this.state!=LoaderState.ERRORED;
}
void forceState(LoaderState newState)
{

View file

@ -256,7 +256,8 @@ public class FMLServerHandler implements IFMLSidedHandler
IOUtils.closeQuietly(stream);
try
{
zip.close();
if (zip != null)
zip.close();
}
catch (IOException e)
{