mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
0ea3083817
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: 1e843b72 #510: Add NamespacedKey#fromString() to fetch from user input a4d18241 #581: Add methods to modify despawn delay for wandering villagers CraftBukkit Changes: 0cd8f19f #802: Add methods to modify despawn delay for wandering villagers d5c5d998 SPIGOT-6362: ConcurrentModificationException: null --> Server Crash 8c7d69fe SPIGOT-5228: Entities that are removed during chunk unloads are not properly removed from the chunk.
48 lines
1.6 KiB
Diff
48 lines
1.6 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 e340ef507d5a2b6b14114d0f061679c1a90884d4..9ec0608a79bc9cf3a992f9e549fd471e10e6bb5e 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 73537af41d010283221418084c244261f262ceab..69070e472518fba66581e6050d3308d46c1d1608 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 {
|
|
*/
|
|
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.
|
|
*
|