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 19f525543e95a1b8de2ad3da45724969705e9c15..162b09cda517afe3b87321a4fe871c183db37621 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -153,7 +153,7 @@ public abstract class PlayerList { private boolean doWhiteList; private final LayeredRegistryAccess registries; private final RegistryAccess.Frozen synchronizedRegistries; - 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 int simulationDistance; private boolean allowCheatsForAllPlayers; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index cc728b3ec69dcd92d5c4ed97805bcbd5bcd2d3e3..af0e06a47173688b950ed4d376b23dc71854fd7b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -664,6 +664,13 @@ public final class CraftServer implements Server { return this.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