geforkt von Mirrors/Paper
c1def9d852
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: fd92f1e65 SPIGOT-7378: Add BlockDropItemEvent for Suspicious Sand & Gravel drops cb1b69d13 SPIGOT-7377: Server sends player list twice Spigot Changes: 16cfc987 Rebuild patches
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 36715e8bc9047962a2ced70d6838672159665771..b810ae5536cc1a64d44266f2158db0f6930429ff 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -155,7 +155,7 @@ public abstract class PlayerList {
|
|
private boolean doWhiteList;
|
|
private final LayeredRegistryAccess<RegistryLayer> 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 a71b5269354fcf5074aa2b018abf9e173bce79ae..1cc0c17d5211ae7ecf18c901cccbe55b655be561 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -672,6 +672,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
|