diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 9764489c0..a371da9d1 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -2980,8 +2980,19 @@ public final class Bukkit { } // Paper end - Folia region threading API + /** + * @deprecated All methods on this class have been deprecated, see the individual methods for replacements. + */ + @Deprecated(since = "1.21.4", forRemoval = true) @NotNull public static Server.Spigot spigot() { return server.spigot(); } + + /** + * Restarts the server. If the server administrator has not configured restarting, the server will stop. + */ + public static void restart() { + server.restart(); + } } diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index fa6f9d505..b136c30b9 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -2309,24 +2309,52 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi // Spigot start public class Spigot { + /** + * @deprecated Server config options may be renamed or removed without notice. Prefer using existing API + * wherever possible, rather than directly reading from a server config. + * + * @return The server's spigot config. + */ + @Deprecated(since = "1.21.4", forRemoval = true) @NotNull public org.bukkit.configuration.file.YamlConfiguration getConfig() { throw new UnsupportedOperationException("Not supported yet."); } + /** + * @deprecated Server config options may be renamed or removed without notice. Prefer using existing API + * wherever possible, rather than directly reading from a server config. + * + * @return The server's bukkit config. + */ // Paper start + @Deprecated(since = "1.21.4", forRemoval = true) @NotNull public org.bukkit.configuration.file.YamlConfiguration getBukkitConfig() { throw new UnsupportedOperationException( "Not supported yet." ); } + /** + * @deprecated Server config options may be renamed or removed without notice. Prefer using existing API + * wherever possible, rather than directly reading from a server config. + * + * @return The server's spigot config. + */ + @Deprecated(since = "1.21.4", forRemoval = true) @NotNull public org.bukkit.configuration.file.YamlConfiguration getSpigotConfig() { throw new UnsupportedOperationException("Not supported yet."); } + /** + * @deprecated Server config options may be renamed or removed without notice. Prefer using existing API + * wherever possible, rather than directly reading from a server config. + * + * @return The server's paper config. + */ + @Deprecated(since = "1.21.4", forRemoval = true) @NotNull public org.bukkit.configuration.file.YamlConfiguration getPaperConfig() { @@ -2358,16 +2386,28 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi /** * Restart the server. If the server administrator has not configured restarting, the server will stop. + * + * @deprecated Use {@link Server#restart()} instead. */ + @Deprecated(since = "1.21.4", forRemoval = true) public void restart() { throw new UnsupportedOperationException("Not supported yet."); } } + /** + * @deprecated All methods on this class have been deprecated, see the individual methods for replacements. + */ + @Deprecated(since = "1.21.4", forRemoval = true) @NotNull Spigot spigot(); // Spigot end + /** + * Restarts the server. If the server administrator has not configured restarting, the server will stop. + */ + void restart(); + void reloadPermissions(); // Paper boolean reloadCommandAliases(); // Paper diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 59eddee7e..a0a1ed48f 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -3053,7 +3053,7 @@ public final class CraftServer implements Server { @Override public void restart() { - org.spigotmc.RestartCommand.restart(); + CraftServer.this.restart(); } @Override @@ -3077,6 +3077,11 @@ public final class CraftServer implements Server { } // Spigot end + @Override + public void restart() { + org.spigotmc.RestartCommand.restart(); + } + @Override public double[] getTPS() { return new double[] {