Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-04 23:30:24 +01:00
ProtocolInfo is not a StoredObject
You can't actually call UserConnection#get with ProtocolInfo.class since the ProtocolInfo interface is not a StoredObject
Dieser Commit ist enthalten in:
Ursprung
8e15b6d42b
Commit
00746833ac
@ -23,7 +23,6 @@
|
||||
package com.viaversion.viaversion.connection;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.ProtocolInfo;
|
||||
import com.viaversion.viaversion.api.connection.StoredObject;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.protocol.ProtocolPipeline;
|
||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||
@ -31,7 +30,8 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ProtocolInfoImpl extends StoredObject implements ProtocolInfo {
|
||||
public class ProtocolInfoImpl implements ProtocolInfo {
|
||||
private final UserConnection connection;
|
||||
private State state = State.HANDSHAKE;
|
||||
private int protocolVersion = -1;
|
||||
private int serverProtocolVersion = -1;
|
||||
@ -39,8 +39,8 @@ public class ProtocolInfoImpl extends StoredObject implements ProtocolInfo {
|
||||
private UUID uuid;
|
||||
private ProtocolPipeline pipeline;
|
||||
|
||||
public ProtocolInfoImpl(UserConnection user) {
|
||||
super(user);
|
||||
public ProtocolInfoImpl(UserConnection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -106,6 +106,11 @@ public class ProtocolInfoImpl extends StoredObject implements ProtocolInfo {
|
||||
this.pipeline = pipeline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserConnection getUser() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProtocolInfo{" +
|
||||
|
@ -72,7 +72,6 @@ public class UserConnectionImpl implements UserConnection {
|
||||
public UserConnectionImpl(@Nullable Channel channel, boolean clientSide) {
|
||||
this.channel = channel;
|
||||
this.clientSide = clientSide;
|
||||
storedObjects.put(ProtocolInfo.class, (StoredObject) protocolInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren