mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-25 18:47:40 +01:00
*Actually important Microoptimization*
Anything that handles every single connected player should be optimized
This commit is contained in:
parent
3536bdc856
commit
12adb9a965
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user