3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00

Add maxPlayers API

Dieser Commit ist enthalten in:
RednedEpic 2022-03-19 22:35:41 -05:00
Ursprung f8e9662665
Commit 95747d5649
2 geänderte Dateien mit 14 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -123,6 +123,15 @@ public interface GeyserApi extends GeyserApiBase {
*/ */
BedrockListener bedrockListener(); BedrockListener bedrockListener();
/**
* Gets the maximum number of players that
* can join this Geyser instance.
*
* @return the maximum number of players that
* can join this Geyser instance
*/
int maxPlayers();
/** /**
* Gets the current {@link GeyserApiBase} instance. * Gets the current {@link GeyserApiBase} instance.
* *

Datei anzeigen

@ -591,6 +591,11 @@ public class GeyserImpl implements GeyserApi {
return this.bedrockListener; return this.bedrockListener;
} }
@Override
public int maxPlayers() {
return this.getConfig().getMaxPlayers();
}
public static GeyserImpl start(PlatformType platformType, GeyserBootstrap bootstrap) { public static GeyserImpl start(PlatformType platformType, GeyserBootstrap bootstrap) {
if (instance == null) { if (instance == null) {
return new GeyserImpl(platformType, bootstrap); return new GeyserImpl(platformType, bootstrap);