mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 01:47:54 +01:00
Add concurrencyLevel to the MapMaker
This commit is contained in:
parent
ac57726a98
commit
be5b31e207
@ -26,13 +26,15 @@ import static net.minestom.server.network.packet.server.play.BossBarPacket.Actio
|
|||||||
* boss bar management system.
|
* boss bar management system.
|
||||||
*/
|
*/
|
||||||
public class BossBarManager implements BossBar.Listener {
|
public class BossBarManager implements BossBar.Listener {
|
||||||
|
private static final int CONCURRENCY_LEVEL = 4;
|
||||||
|
|
||||||
private final Map<BossBar, Holder> bars;
|
private final Map<BossBar, Holder> bars;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new boss bar manager.
|
* Creates a new boss bar manager.
|
||||||
*/
|
*/
|
||||||
public BossBarManager() {
|
public BossBarManager() {
|
||||||
this.bars = new MapMaker().weakKeys().makeMap();
|
this.bars = new MapMaker().concurrencyLevel(CONCURRENCY_LEVEL).weakKeys().makeMap();
|
||||||
|
|
||||||
MinecraftServer.getGlobalEventHandler().addEventCallback(PlayerDisconnectEvent.class, this::onDisconnect);
|
MinecraftServer.getGlobalEventHandler().addEventCallback(PlayerDisconnectEvent.class, this::onDisconnect);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user