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
|
2023-05-12 13:10:08 +02:00
|
|
|
index 14d00939b9a8488eba040bf435e6837ecb424d65..9b75cf08096689522b670ad48e73126ad4cfc9b5 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
|
2023-05-12 13:10:08 +02:00
|
|
|
@@ -155,7 +155,7 @@ public abstract class PlayerList {
|
2021-06-11 14:02:28 +02:00
|
|
|
private boolean doWhiteList;
|
2022-12-07 21:16:54 +01:00
|
|
|
private final LayeredRegistryAccess<RegistryLayer> registries;
|
|
|
|
private final RegistryAccess.Frozen synchronizedRegistries;
|
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
|
2023-05-12 13:10:08 +02:00
|
|
|
index 64e59d5c545e6bc4e000e2ca779df427a67e5aae..5891dc6a41a0043ff85d343b7da5024c96f9a77e 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
|
2023-05-12 13:10:08 +02:00
|
|
|
@@ -665,6 +665,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
|