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-06-01 01:36:57 +02:00
|
|
|
index cfe2dea64104eeaffd6606fdff0d5a1a2c111329..0e22201853ae2befdc6904e194f8bbc6d57fc9f5 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-06-01 01:36:57 +02:00
|
|
|
index 5a09fa2042adc34d541b24fff12acca382a8f998..24d0419ac82ee388e8d545b3fb391eea424a53f7 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-06-01 01:36:57 +02:00
|
|
|
@@ -667,6 +667,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
|