Paper/patches/api/0207-Add-setMaxPlayers-API.patch
Jake Potrebic 5730a94208
Updated Upstream (Bukkit/CraftBukkit) (#8991)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2b4582fb SPIGOT-5916: getLastColors does not work with the rgb colors

CraftBukkit Changes:
f7707086d SPIGOT-7299: Fix indirect/anvil damage events and minor improvements
2023-03-18 10:05:04 -07:00

49 Zeilen
1.7 KiB
Diff

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 93a74792837e6dcff354e5f0afb7aacd0a19f7e1..6d98664f2da191c2327e80b8212c1ad979f7d6ac 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 cd3ce4155ff46d85d4c603a688dd96893400ed77..936ebaf531a76cab12809cfa334e2b0d89e625c3 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.
*