Skip to content

Commit

Permalink
Proper shutdown when using restart cmd and restart script does not ex…
Browse files Browse the repository at this point in the history
…ist (#289)
  • Loading branch information
uRyanxD authored Feb 9, 2025
1 parent 553f945 commit b281d3b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
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 )

0 comments on commit b281d3b

Please sign in to comment.