2020-08-25 04:22:08 +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
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-05-16 01:42:36 +02:00
|
|
|
index d3f3dc4ad2c758482b7a8d5c07caa526ce1e3424..8bd55e3d2b5142081a7dfe1dbbd36f2f995e5856 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-03-16 14:04:28 +01:00
|
|
|
@@ -145,7 +145,7 @@ public abstract class PlayerList {
|
2020-08-25 04:22:08 +02:00
|
|
|
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
|
2021-05-18 06:54:25 +02:00
|
|
|
index cd85c77ae032d15c4bf64a1e93c851aaee53cc02..a44e50c31163d6930ae7ac580b0e8eda31ece9ac 100644
|
2020-08-25 04:22:08 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2021-05-18 06:54:25 +02:00
|
|
|
@@ -615,6 +615,13 @@ public final class CraftServer implements Server {
|
2020-08-25 04:22:08 +02:00
|
|
|
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
|