2021-06-11 14:02:28 +02: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
|
2022-09-26 10:02:51 +02:00
|
|
|
index db03f510195981e9f860ce2fdc59d0a70283dc14..4d05d23f5b6967da29d5c9c91931cd79745f5dcb 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2022-07-27 22:46:05 +02:00
|
|
|
@@ -147,7 +147,7 @@ public abstract class PlayerList {
|
2021-06-11 14:02:28 +02:00
|
|
|
public final PlayerDataStorage playerIo;
|
|
|
|
private boolean doWhiteList;
|
2022-03-01 06:43:03 +01:00
|
|
|
private final RegistryAccess.Frozen registryHolder;
|
2021-06-11 14:02:28 +02:00
|
|
|
- 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;
|
2021-11-24 17:06:46 +01:00
|
|
|
private int simulationDistance;
|
2021-06-11 14:02:28 +02:00
|
|
|
private boolean allowCheatsForAllPlayers;
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2022-09-26 10:02:51 +02:00
|
|
|
index 007b85cfda82d245ae336efc26aa38ad2f6d2c28..e0050956b90ce35082017b3f1f697e455ecb9d34 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2022-08-09 09:18:08 +02:00
|
|
|
@@ -674,6 +674,13 @@ public final class CraftServer implements Server {
|
2021-06-14 12:42:08 +02:00
|
|
|
return this.playerList.getMaxPlayers();
|
2021-06-11 14:02:28 +02: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
|