2021-06-11 12:02:28 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
|
|
Date: Sat, 22 Aug 2020 23:59:30 +0200
|
|
|
|
Subject: [PATCH] Add #setMaxPlayers API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-08-14 13:55:55 +00:00
|
|
|
index e990c9d936b9b2b510dd9c7f5a507b4ba9e79965..518c93b7aa7a77c19d0256f3d9c24e3b21ac44de 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-07-07 06:52:40 +00:00
|
|
|
@@ -145,7 +145,7 @@ public abstract class PlayerList {
|
2021-06-11 12:02:28 +00:00
|
|
|
public final PlayerDataStorage playerIo;
|
|
|
|
private boolean doWhiteList;
|
|
|
|
private final RegistryAccess.RegistryHolder registryHolder;
|
|
|
|
- protected final int maxPlayers;
|
|
|
|
+ protected int maxPlayers; public final void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } // Paper - remove final and add setter
|
|
|
|
private int viewDistance;
|
|
|
|
private boolean allowCheatsForAllPlayers;
|
2021-06-14 10:42:08 +00:00
|
|
|
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
2021-06-11 12:02:28 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2021-07-22 18:11:56 +00:00
|
|
|
index df20ac811d673c205695d563f84382d1bf1e82e1..c664c4fc1280fd57c3b7e8580294b3823b98eae9 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2021-07-22 18:11:56 +00:00
|
|
|
@@ -621,6 +621,13 @@ public final class CraftServer implements Server {
|
2021-06-14 10:42:08 +00:00
|
|
|
return this.playerList.getMaxPlayers();
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void setMaxPlayers(int maxPlayers) {
|
|
|
|
+ this.playerList.setMaxPlayers(maxPlayers);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// NOTE: These are dependent on the corresponding call in MinecraftServer
|
|
|
|
// so if that changes this will need to as well
|
|
|
|
@Override
|