mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 00:51:34 +01:00
use a ConcurrentHashMap key set instead of a CopyOnWriteArraySet for viewers so .contains() is O(1)
This commit is contained in:
parent
949794cbf5
commit
8975161edb
@ -81,7 +81,7 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
|
||||
|
||||
private boolean autoViewable;
|
||||
private final int id;
|
||||
protected final Set<Player> viewers = new CopyOnWriteArraySet<>();
|
||||
protected final Set<Player> viewers = ConcurrentHashMap.newKeySet();
|
||||
private final Set<Player> unmodifiableViewers = Collections.unmodifiableSet(viewers);
|
||||
private Data data;
|
||||
private final Set<Permission> permissions = new CopyOnWriteArraySet<>();
|
||||
|
Loading…
Reference in New Issue
Block a user