#1184: Add setMotd and setMaxPlayers
This commit is contained in:
parent
245f2be151
commit
e472b6c172
@ -27,7 +27,7 @@
|
|||||||
public abstract class PlayerList {
|
public abstract class PlayerList {
|
||||||
|
|
||||||
public static final File USERBANLIST_FILE = new File("banned-players.json");
|
public static final File USERBANLIST_FILE = new File("banned-players.json");
|
||||||
@@ -119,14 +139,16 @@
|
@@ -119,32 +139,44 @@
|
||||||
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
|
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
|
||||||
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
|
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
|
||||||
private final MinecraftServer server;
|
private final MinecraftServer server;
|
||||||
@ -47,7 +47,12 @@
|
|||||||
public final WorldNBTStorage playerIo;
|
public final WorldNBTStorage playerIo;
|
||||||
private boolean doWhiteList;
|
private boolean doWhiteList;
|
||||||
private final LayeredRegistryAccess<RegistryLayer> registries;
|
private final LayeredRegistryAccess<RegistryLayer> registries;
|
||||||
@@ -138,13 +160,23 @@
|
private final IRegistryCustom.Dimension synchronizedRegistries;
|
||||||
|
- protected final int maxPlayers;
|
||||||
|
+ public int maxPlayers;
|
||||||
|
private int viewDistance;
|
||||||
|
private int simulationDistance;
|
||||||
|
private boolean allowCheatsForAllPlayers;
|
||||||
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
||||||
private int sendAllPlayerInfoIn;
|
private int sendAllPlayerInfoIn;
|
||||||
|
|
||||||
|
@ -631,6 +631,13 @@ public final class CraftServer implements Server {
|
|||||||
return playerList.getMaxPlayers();
|
return playerList.getMaxPlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMaxPlayers(int maxPlayers) {
|
||||||
|
Preconditions.checkArgument(maxPlayers >= 0, "maxPlayers must be >= 0");
|
||||||
|
|
||||||
|
playerList.maxPlayers = maxPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: These are dependent on the corresponding call in MinecraftServer
|
// NOTE: These are dependent on the corresponding call in MinecraftServer
|
||||||
// so if that changes this will need to as well
|
// so if that changes this will need to as well
|
||||||
@Override
|
@Override
|
||||||
@ -1954,6 +1961,11 @@ public final class CraftServer implements Server {
|
|||||||
return console.getMotd();
|
return console.getMotd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMotd(String motd) {
|
||||||
|
console.setMotd(motd);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WarningState getWarningState() {
|
public WarningState getWarningState() {
|
||||||
return warningState;
|
return warningState;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user