File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
src/main/kotlin/com/github/itsempa/nautilus Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,14 @@ object ConfigMapper : DataMapper<Features> {
2222 val newJson = NautilusConfigMigrator .fixConfig(jsonObject)
2323
2424 val run = { gson.fromJson<Features >(newJson) }
25- if (PlatformUtils .isDevEnvironment) {
25+ return if (PlatformUtils .isDevEnvironment) {
2626 try {
27- return run ()
27+ run ()
2828 } catch (e: Throwable ) {
2929 Nautilus .consoleLog(e.stackTraceToString())
3030 McClient .shutdown(" Nautilus Config is corrupt inside development environment." )
3131 }
3232 } else run ()
33- return gson.fromJson<Features >(string)
3433 }
3534 }
3635}
Original file line number Diff line number Diff line change @@ -32,10 +32,12 @@ object McClient {
3232 else DelayedRun .runNextTick(action)
3333 }
3434
35- fun shutdown (reason : String? = null) {
35+ fun shutdown (reason : String? = null): Nothing {
3636 val reasonLine = reason?.let { " Reason: ($it )" }.orEmpty()
37- System .err.println (" ${Nautilus .MOD_NAME } -${Nautilus .VERSION } forced the game to shutdown.$reasonLine " )
37+ val message = " ${Nautilus .MOD_NAME } -${Nautilus .VERSION } forced the game to shutdown.$reasonLine "
38+ System .err.println (message)
3839 FMLCommonHandler .instance().handleExit(- 1 )
40+ throw RuntimeException (message) // This is here so that shutdown can return "Nothing"
3941 }
4042
4143}
You can’t perform that action at this time.
0 commit comments