fix PlayerStream.all crashing during early server init

This commit is contained in:
asie 2019-02-10 16:05:24 +01:00
parent c5b4685bdc
commit 8eb2bd8e35

View file

@ -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) {