Update comment in PlayerManagerImpl

This commit is contained in:
booky10 committed 2025-07-09 15:44:29 +02:00
1 parent e1a29a20a7
commit 4495db796d
1 file changed
+3 -4
@@ -39,17 +39,16 @@ import java.util.concurrent.ConcurrentHashMap;
public class PlayerManagerImpl implements PlayerManager {
// this map is only useful in a tiny edge case for versions older than 1.20.5;
// we associate the user object with a UUID upon receiving the ClientboundGameProfilePacket;
// but, as packets are send asynchronously, this causes a race condition between the packet being sent
// and the main thread login logic; if the packet gets processed by packetevents before the main thread login
// logic reaches the event where we process things, everything is fine; if not, the event won't know what
// to do with the player and will kick them
//
// this map gets used early on in the login process, were we don't have any connection info
// about players (at least in versions older than 1.20.5), but have their UUID;
// this map gets used early on in the login/join process, were we can't extract
// a reference to the player's connection from the player;
// this player reference may then get used by the packet handler to associate the user with a player
// from inside the packet handler
// from inside the packet handler, ensuring consistent results regardless of which thread is faster
@ApiStatus.Internal
public final Map<UUID, WeakReference<Player>> joiningPlayers = new ConcurrentHashMap<>();