From fc3e568b8d1289bc72bad9114efd58595946c356 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 13 Jul 2015 19:12:24 +1000 Subject: [PATCH] SPIGOT-997: Add restart API for server. --- Bukkit-Patches/0029-Add-restart-API.patch | 25 +++++++++++++++++++ .../0048-Watchdog-Thread.patch | 16 ++++++++++++ .../0150-BungeeCord-Chat-API.patch | 4 +-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Bukkit-Patches/0029-Add-restart-API.patch diff --git a/Bukkit-Patches/0029-Add-restart-API.patch b/Bukkit-Patches/0029-Add-restart-API.patch new file mode 100644 index 0000000000..210a3ec824 --- /dev/null +++ b/Bukkit-Patches/0029-Add-restart-API.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Mon, 13 Jul 2015 19:10:15 +1000 +Subject: [PATCH] Add restart API. + + +diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { + public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { + throw new UnsupportedOperationException("Not supported yet."); + } ++ ++ /** ++ * Restart the server. If the server administrator has not configured restarting, the server will stop. ++ */ ++ public void restart() { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } + } + + Spigot spigot(); +-- \ No newline at end of file diff --git a/CraftBukkit-Patches/0048-Watchdog-Thread.patch b/CraftBukkit-Patches/0048-Watchdog-Thread.patch index 0f3eabe4de..926eda55c6 100644 --- a/CraftBukkit-Patches/0048-Watchdog-Thread.patch +++ b/CraftBukkit-Patches/0048-Watchdog-Thread.patch @@ -37,6 +37,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 SpigotTimings.serverTickTimer.stopTiming(); // Spigot org.spigotmc.CustomTimingsHandler.tick(); // Spigot } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + { + return org.spigotmc.SpigotConfig.config; + } ++ ++ @Override ++ public void restart() { ++ org.spigotmc.RestartCommand.restart(); ++ } + }; + + public Spigot spigot() diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch b/CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch index 9bc22daa16..7acdbcce6d 100644 --- a/CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch +++ b/CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch @@ -68,8 +68,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public final class CraftServer implements Server { private static final Player[] EMPTY_PLAYER_ARRAY = new Player[0]; @@ -0,0 +0,0 @@ public final class CraftServer implements Server { - { - return org.spigotmc.SpigotConfig.config; + public void restart() { + org.spigotmc.RestartCommand.restart(); } + + @Override