Skip to content

Commit b281d3b

Browse files
authoredFeb 9, 2025
Proper shutdown when using restart cmd and restart script does not exist (hpfxd#289)
1 parent 553f945 commit b281d3b

2 files changed

+27
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: uRyanxD <familiarodrigues123ro@gmail.com>
3+
Date: Sun, 9 Feb 2025 14:11:04 -0300
4+
Subject: [PATCH] Proper shutdown when restart script does not exist
5+
6+
Upstream commit: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/commits/34287dbe611efa0a37bfe76f72fa3ddfeceb4c30
7+
8+
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java
9+
index 429c25804654b6590c1ae1bc61af66fa1808214c..80fdb61dc4e772b4e7ca50d6d66a1a732dfa6a90 100644
10+
--- a/src/main/java/org/spigotmc/RestartCommand.java
11+
+++ b/src/main/java/org/spigotmc/RestartCommand.java
12+
@@ -114,6 +114,15 @@ public class RestartCommand extends Command
13+
} else
14+
{
15+
System.out.println( "Startup script '" + SpigotConfig.restartScript + "' does not exist! Stopping server." );
16+
+
17+
+ // PandaSpigot start - Proper shutdown when restart script does not exist
18+
+ try
19+
+ {
20+
+ MinecraftServer.getServer().stop();
21+
+ } catch (Throwable t)
22+
+ {
23+
+ }
24+
+ // PandaSpigot end
25+
}
26+
System.exit( 0 );
27+
} catch ( Exception ex )

0 commit comments

Comments
 (0)
Please sign in to comment.