From 6eeae8c49ff4359dc21c44eb73e4e043285cd8bf Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 7 Mar 2013 19:37:52 -0500 Subject: [PATCH] Fix up state transition derp when the server crashes with an error- it shouldn't double-derp --- common/cpw/mods/fml/common/LoadController.java | 7 ++++++- common/cpw/mods/fml/common/Loader.java | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/common/cpw/mods/fml/common/LoadController.java b/common/cpw/mods/fml/common/LoadController.java index 46c60c8e84..80e97e71b1 100644 --- a/common/cpw/mods/fml/common/LoadController.java +++ b/common/cpw/mods/fml/common/LoadController.java @@ -5,7 +5,7 @@ * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * + * * Contributors: * cpw - implementation */ @@ -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; + } } diff --git a/common/cpw/mods/fml/common/Loader.java b/common/cpw/mods/fml/common/Loader.java index 4683b7e4ad..c4a8950a21 100644 --- a/common/cpw/mods/fml/common/Loader.java +++ b/common/cpw/mods/fml/common/Loader.java @@ -5,7 +5,7 @@ * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * + * * Contributors: * cpw - implementation */ @@ -776,7 +776,15 @@ public class Loader public void serverStopped() { modController.distributeStateMessage(LoaderState.SERVER_STOPPED); - modController.transition(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); }