mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Player#refreshVisibleEntities cleanup
This commit is contained in:
parent
cd0ea0c0c2
commit
748e3d7b39
@ -1640,9 +1640,9 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
final float maximalDistance = entityViewDistance * Chunk.CHUNK_SECTION_SIZE;
|
||||
|
||||
// Manage already viewable entities
|
||||
this.viewableEntities.forEach(entity -> {
|
||||
final double distance = entity.getDistance(this);
|
||||
if (distance > maximalDistance) {
|
||||
this.viewableEntities.stream()
|
||||
.filter(entity -> entity.getDistance(this) > maximalDistance)
|
||||
.forEach(entity -> {
|
||||
// Entity shouldn't be viewable anymore
|
||||
if (isAutoViewable()) {
|
||||
entity.removeViewer(this);
|
||||
@ -1650,7 +1650,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
if (entity instanceof Player && entity.isAutoViewable()) {
|
||||
removeViewer((Player) entity);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Manage entities in unchecked chunks
|
||||
|
Loading…
Reference in New Issue
Block a user