Fix up state transition derp when the server crashes with an error- it shouldn't double-derp
This commit is contained in:
parent
ba5165f86b
commit
845a9c5792
2 changed files with 16 additions and 3 deletions
|
@ -262,4 +262,9 @@ public class LoadController
|
|||
boolean hasReachedState(LoaderState state) {
|
||||
return this.state.ordinal()>=state.ordinal() && this.state!=LoaderState.ERRORED;
|
||||
}
|
||||
|
||||
void forceState(LoaderState newState)
|
||||
{
|
||||
this.state = newState;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -776,7 +776,15 @@ public class Loader
|
|||
public void serverStopped()
|
||||
{
|
||||
modController.distributeStateMessage(LoaderState.SERVER_STOPPED);
|
||||
try
|
||||
{
|
||||
modController.transition(LoaderState.SERVER_STOPPED);
|
||||
}
|
||||
catch (LoaderException e)
|
||||
{
|
||||
modController.forceState(LoaderState.SERVER_STOPPED);
|
||||
// Discard any exceptions here - they mask other, real, exceptions
|
||||
}
|
||||
modController.transition(LoaderState.AVAILABLE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue