aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-API-Patches-Unmapped/0217-Add-setMaxPlayers-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-API-Patches-Unmapped/0217-Add-setMaxPlayers-API.patch')
-rw-r--r--Spigot-API-Patches-Unmapped/0217-Add-setMaxPlayers-API.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/Spigot-API-Patches-Unmapped/0217-Add-setMaxPlayers-API.patch b/Spigot-API-Patches-Unmapped/0217-Add-setMaxPlayers-API.patch
new file mode 100644
index 0000000000..17b9d923f2
--- /dev/null
+++ b/Spigot-API-Patches-Unmapped/0217-Add-setMaxPlayers-API.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mariell Hoversholm <[email protected]>
+Date: Sat, 22 Aug 2020 23:59:25 +0200
+Subject: [PATCH] Add #setMaxPlayers API
+
+
+diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
+index 1eaf6aae1e13c48a7f911e523015cb9b8cca8638..6228d7eca85fba52296c8d63d32804f32af1b421 100644
+--- a/src/main/java/org/bukkit/Bukkit.java
++++ b/src/main/java/org/bukkit/Bukkit.java
+@@ -171,6 +171,17 @@ public final class Bukkit {
+ return server.getMaxPlayers();
+ }
+
++ // Paper start
++ /**
++ * Set the maximum amount of players which can login to this server.
++ *
++ * @param maxPlayers the amount of players this server allows
++ */
++ public static void setMaxPlayers(int maxPlayers) {
++ server.setMaxPlayers(maxPlayers);
++ }
++ // Paper end
++
+ /**
+ * Get the game port that the server runs on.
+ *
+diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
+index 8ee02c3d6cc8751704e5993fecd05293714e492f..6237578b373002c009efde4fb4c1864f0bf4f19e 100644
+--- a/src/main/java/org/bukkit/Server.java
++++ b/src/main/java/org/bukkit/Server.java
+@@ -144,6 +144,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
+ */
+ public int getMaxPlayers();
+
++ // Paper start
++ /**
++ * Set the maximum amount of players which can login to this server.
++ *
++ * @param maxPlayers the amount of players this server allows
++ */
++ public void setMaxPlayers(int maxPlayers);
++ // Paper end
++
+ /**
+ * Get the game port that the server runs on.
+ *