aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0216-Add-setMaxPlayers-API.patch
blob: e37f12a879d1edab9fad3c3dc2129ea9fc721b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
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 f3f8a6db7ee1b4ea1aaf6bc972fa02a8af5f3772..2d26f1fd3bbbe95e7a73bb5ebc7d85c9e066c1ee 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -208,6 +208,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 4f17bc607639bb3d20a1694ffb02d22d283348b3..634a7e38987bc18232c07e5f767b37b523f13920 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -160,6 +160,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.
      *