SPIGOT-997: Add restart API for server.

This commit is contained in:
md_5 2015-07-13 19:12:24 +10:00
parent a5da72e7fa
commit fc3e568b8d
3 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
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();
--

View File

@ -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

View File

@ -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