ForgePatch/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch

38 lines
1.7 KiB
Diff
Raw Normal View History

2018-09-05 00:23:45 +00:00
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -523,6 +523,7 @@
2018-09-05 00:23:45 +00:00
public void run() {
try {
if (this.init()) {
+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarted(this);
this.field_211151_aa = Util.func_211177_b();
this.statusResponse.setServerDescription(new TextComponentString(this.motd));
this.statusResponse.setVersion(new ServerStatusResponse.Version("1.13", 393));
@@ -546,7 +547,10 @@
2018-09-05 00:23:45 +00:00
this.serverIsRunning = true;
}
+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStopping(this);
+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions
} else {
+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions
this.finalTick((CrashReport)null);
}
} catch (Throwable throwable1) {
@@ -565,6 +569,7 @@
2018-09-05 00:23:45 +00:00
LOGGER.error("We were unable to save this crash report to disk.");
}
+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions
this.finalTick(crashreport);
} finally {
try {
@@ -573,6 +578,7 @@
2018-09-05 00:23:45 +00:00
} catch (Throwable throwable) {
LOGGER.error("Exception stopping the server", throwable);
} finally {
+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStopped(this);
this.systemExitNow();
}