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
|
2022-06-03 04:26:56 +00:00
|
|
|
index 019bbc77fe0a85de6d8eef53496981d1d7d0c320..f9ef6e64b95f90d69a897dd996a587749776350d 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-11-24 16:06:46 +00:00
|
|
|
@@ -144,7 +144,7 @@ public abstract class PlayerList {
|
2021-06-11 12:02:28 +00:00
|
|
|
public final PlayerDataStorage playerIo;
|
|
|
|
private boolean doWhiteList;
|
2022-03-01 05:43:03 +00:00
|
|
|
private final RegistryAccess.Frozen registryHolder;
|
2021-06-11 12:02:28 +00: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 16:06:46 +00:00
|
|
|
private int simulationDistance;
|
2021-06-11 12:02:28 +00: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-06-07 17:03:07 +00:00
|
|
|
index 212e43114e4797669338ffdd47548d0100365380..ce09a46ed430a80471af48b7a8ca1bf7726395c9 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
|
2022-04-16 08:29:50 +00:00
|
|
|
@@ -668,6 +668,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
|