forked from FabricMC/fabric
fix PlayerStream.all crashing during early server init
This commit is contained in:
parent
c5b4685bdc
commit
8eb2bd8e35
1 changed files with 5 additions and 1 deletions
|
@ -42,7 +42,11 @@ public final class PlayerStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Stream<ServerPlayerEntity> all(MinecraftServer server) {
|
public static Stream<ServerPlayerEntity> all(MinecraftServer server) {
|
||||||
|
if (server.getPlayerManager() != null) {
|
||||||
return server.getPlayerManager().getPlayerList().stream();
|
return server.getPlayerManager().getPlayerList().stream();
|
||||||
|
} else {
|
||||||
|
return Stream.empty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Stream<PlayerEntity> world(World world) {
|
public static Stream<PlayerEntity> world(World world) {
|
||||||
|
|
Loading…
Reference in a new issue