From 3d755c36f57cea80bd0291c987165bac6024911e Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 11 Jun 2023 10:51:07 +1000 Subject: [PATCH] #852: Add setMotd and setMaxPlayers By: Hannah --- paper-api/src/main/java/org/bukkit/Bukkit.java | 18 ++++++++++++++++++ paper-api/src/main/java/org/bukkit/Server.java | 14 ++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 653dffc6c7..e395a8299c 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -164,6 +164,15 @@ public final class Bukkit { return server.getMaxPlayers(); } + /** + * Set the maximum amount of players allowed to be logged in at once. + * + * @param maxPlayers The maximum amount of concurrent players + */ + public static void setMaxPlayers(int maxPlayers) { + server.setMaxPlayers(maxPlayers); + } + /** * Get the game port that the server runs on. * @@ -1534,6 +1543,15 @@ public final class Bukkit { return server.getMotd(); } + /** + * Set the message that is displayed on the server list. + * + * @param motd The message to be displayed + */ + public static void setMotd(@NotNull String motd) { + server.setMotd(motd); + } + /** * Gets the default message that is displayed when the server is stopped. * diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index b95dc5c431..62969fbc55 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -139,6 +139,13 @@ public interface Server extends PluginMessageRecipient { */ public int getMaxPlayers(); + /** + * Set the maximum amount of players allowed to be logged in at once. + * + * @param maxPlayers The maximum amount of concurrent players + */ + void setMaxPlayers(int maxPlayers); + /** * Get the game port that the server runs on. * @@ -1301,6 +1308,13 @@ public interface Server extends PluginMessageRecipient { @NotNull String getMotd(); + /** + * Set the message that is displayed on the server list. + * + * @param motd The message to be displayed + */ + void setMotd(@NotNull String motd); + /** * Gets the default message that is displayed when the server is stopped. *