public void transition(LoaderState desiredState) { LoaderState oldState = state; state = state.transition(!errors.isEmpty()); if (state != desiredState) { Throwable toThrow = null; FMLLog.severe( "Fatal errors were detected during the transition from %s to %s. Loading cannot continue", oldState, desiredState); StringBuilder sb = new StringBuilder(); printModStates(sb); FMLLog.getLogger().severe(sb.toString()); if (errors.size() > 0) { FMLLog.severe("The following problems were captured during this phase"); for (Entry<String, Throwable> error : errors.entries()) { FMLLog.log(Level.SEVERE, error.getValue(), "Caught exception from %s", error.getKey()); if (error.getValue() instanceof IFMLHandledException) { toThrow = error.getValue(); } else if (toThrow == null) { toThrow = error.getValue(); } } } 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."); throw new RuntimeException("The ForgeModLoader state engine is invalid"); } if (toThrow != null && toThrow instanceof RuntimeException) { throw (RuntimeException) toThrow; } else { throw new LoaderException(toThrow); } } }