From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm 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 a5bad2633506ded8394f7706c0eced9c395c13e8..d64d32fad3063b3337ddde7d1350101c5a4d8519 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 a0695411d3a55babd3cb5f926c3496985ef6e402..b0b6220d16c7889b4c7d81925db864b740d39a37 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. *