38 lines
1.8 KiB
Diff
38 lines
1.8 KiB
Diff
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
|
|
index 8c1b6aa3957a988656eeb2ad6323fdbd2f67cd19..67c50a329e7bdf4056a1217963e29e8ceb99b20f 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -147,7 +147,7 @@ public abstract class PlayerList {
|
|
public final PlayerDataStorage playerIo;
|
|
private boolean doWhiteList;
|
|
private final RegistryAccess.Frozen registryHolder;
|
|
- 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 c7a6143ebb2ed0a0977e1d38c8adcccf09800638..72e545e9aa01ad7ae4180d5421e16e330b4c9934 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -674,6 +674,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
|