Allow setting a connections uuid when in offline mode
This commit is contained in:
parent
3776feb559
commit
415d5860e4
@ -54,6 +54,11 @@ public interface PendingConnection extends Connection
|
||||
*/
|
||||
UUID getUniqueId();
|
||||
|
||||
/**
|
||||
* Set the connection's uuid
|
||||
*/
|
||||
void setUniqueId(UUID uuid);
|
||||
|
||||
/**
|
||||
* Get this connection's online mode.
|
||||
*
|
||||
|
@ -571,6 +571,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||
this.onlineMode = onlineMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUniqueId(UUID uuid)
|
||||
{
|
||||
Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" );
|
||||
Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" );
|
||||
this.uniqueId = uuid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUUID()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user