From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm 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 index 7127e5f2cd8eb72220c959cb83711ad9b9c240c2..231a1cf2a4bad62f9d317138c96f5922c14f1762 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -145,7 +145,7 @@ public abstract class PlayerList { public final WorldNBTStorage playerFileData; private boolean hasWhitelist; private final IRegistryCustom.Dimension s; - 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 EnumGamemode u; private boolean v; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index f8d040ba6c8b3a1294a8ac8d55cbd09705d4be76..1199644c6342379df21840aa144e731e9e9245ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -618,6 +618,13 @@ public final class CraftServer implements Server { return playerList.getMaxPlayers(); } + // 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