From 60d6f31876bd0ec69f45e487684cf9acbd9f81f3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 16 Dec 2013 22:41:13 +1100 Subject: [PATCH] Generate offline mode UUIDs the same way Mojang does. --- .../main/java/net/md_5/bungee/connection/InitialHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 9d33c05e..621ef385 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -1,5 +1,6 @@ package net.md_5.bungee.connection; +import com.google.common.base.Charsets; import com.google.common.base.Preconditions; import java.math.BigInteger; import java.net.InetSocketAddress; @@ -362,7 +363,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( UUID == null ) { - UUID = java.util.UUID.randomUUID().toString(); + UUID = java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + getName() ).getBytes( Charsets.UTF_8 ) ).toString(); } unsafe.sendPacket( new LoginSuccess( UUID, getName() ) ); ch.setProtocol( Protocol.GAME );