geforkt von Mirrors/Paper
d8c3fb7e47
Needs updating to hook into new entity storage system
38 Zeilen
1.8 KiB
Diff
38 Zeilen
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 9c594c0f142ca10b7c1df50faf45ccb3f7468ba9..31dd2c4a41e172c7eeb835ae61a45c954d0e647a 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -142,7 +142,7 @@ public abstract class PlayerList {
|
|
public final PlayerDataStorage playerIo;
|
|
private boolean doWhiteList;
|
|
private final RegistryAccess.RegistryHolder 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 boolean allowCheatsForAllPlayers;
|
|
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 407a91f64e040745dea17544d6b7c6d125866c62..c4d7ac8abd7d86e8a4e2d8a3340d04f8710e925c 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -616,6 +616,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
|