*Actually important Microoptimization*

Anything that handles every single connected player should be optimized
This commit is contained in:
LeoDog896 2021-01-15 13:05:21 -05:00
parent 3536bdc856
commit 12adb9a965

View File

@ -476,9 +476,7 @@ public final class MinecraftServer {
MinecraftServer.chunkViewDistance = chunkViewDistance;
if (started) {
final Collection<Player> players = connectionManager.getOnlinePlayers();
players.forEach(player -> {
for (final Player player : connectionManager.getOnlinePlayers()) {
final Chunk playerChunk = player.getChunk();
if (playerChunk != null) {
@ -512,12 +510,12 @@ public final class MinecraftServer {
"The entity view distance must be between 0 and 32");
MinecraftServer.entityViewDistance = entityViewDistance;
if (started) {
connectionManager.getOnlinePlayers().forEach(player -> {
for (final Player player : connectionManager.getOnlinePlayers()) {
final Chunk playerChunk = player.getChunk();
if (playerChunk != null) {
player.refreshVisibleEntities(playerChunk);
}
});
}
}
}