mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 09:27:58 +01:00
Use concurrent map instead of copyonwrite set for player's viewable entities
This commit is contained in:
parent
e9d76cc742
commit
c6c720e0c7
@ -64,6 +64,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@ -81,7 +82,7 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
private String username;
|
||||
protected final PlayerConnection playerConnection;
|
||||
// All the entities that this player can see
|
||||
protected final Set<Entity> viewableEntities = new CopyOnWriteArraySet<>();
|
||||
protected final Set<Entity> viewableEntities = ConcurrentHashMap.newKeySet();
|
||||
|
||||
private int latency;
|
||||
private JsonMessage displayName;
|
||||
|
Loading…
Reference in New Issue
Block a user