3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Fix when client doesn't have id

Dieser Commit ist enthalten in:
creeper123123321 2020-06-25 11:28:30 -03:00
Ursprung 3f93bb051d
Commit 9df545483c

Datei anzeigen

@ -59,7 +59,7 @@ public class ViaConnectionManager {
/** /**
* Returns the UUID from the frontend connection to this proxy server * Returns the UUID from the frontend connection to this proxy server
* Returns null when there isn't a server or frontend id was not found * Returns null when there isn't a server or this connection isn't frontend or it doesn't have an id
* When ViaVersion is reloaded, this method may not return some players. * When ViaVersion is reloaded, this method may not return some players.
* May not return ProtocolSupport players. * May not return ProtocolSupport players.
* <p> * <p>
@ -70,7 +70,8 @@ public class ViaConnectionManager {
public UUID getConnectedClientId(UserConnection conn) { public UUID getConnectedClientId(UserConnection conn) {
if (conn.getProtocolInfo() == null) return null; if (conn.getProtocolInfo() == null) return null;
UUID uuid = conn.getProtocolInfo().getUuid(); UUID uuid = conn.getProtocolInfo().getUuid();
if (clients.get(uuid).equals(conn)) { UserConnection client = clients.get(uuid);
if (client != null && client.equals(conn)) {
// This is frontend // This is frontend
return uuid; return uuid;
} }