-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper shutdown when using restart cmd and restart script does not ex…
…ist (#289)
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
patches/server/0108-Proper-shutdown-when-restart-script-does-not-exist.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: uRyanxD <[email protected]> | ||
Date: Sun, 9 Feb 2025 14:11:04 -0300 | ||
Subject: [PATCH] Proper shutdown when restart script does not exist | ||
|
||
Upstream commit: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/commits/34287dbe611efa0a37bfe76f72fa3ddfeceb4c30 | ||
|
||
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java | ||
index 429c25804654b6590c1ae1bc61af66fa1808214c..80fdb61dc4e772b4e7ca50d6d66a1a732dfa6a90 100644 | ||
--- a/src/main/java/org/spigotmc/RestartCommand.java | ||
+++ b/src/main/java/org/spigotmc/RestartCommand.java | ||
@@ -114,6 +114,15 @@ public class RestartCommand extends Command | ||
} else | ||
{ | ||
System.out.println( "Startup script '" + SpigotConfig.restartScript + "' does not exist! Stopping server." ); | ||
+ | ||
+ // PandaSpigot start - Proper shutdown when restart script does not exist | ||
+ try | ||
+ { | ||
+ MinecraftServer.getServer().stop(); | ||
+ } catch (Throwable t) | ||
+ { | ||
+ } | ||
+ // PandaSpigot end | ||
} | ||
System.exit( 0 ); | ||
} catch ( Exception ex ) |