Restore offline mode support for Fabric servers (#3576)

This commit is contained in:
nikijaz authored and GitHub committed 2023-01-29 10:41:38 +00:00
1 parent 3ecdeacaf8
commit a5ba53d765
1 file changed
+2 -1
@@ -46,6 +46,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerLoginNetworkHandler;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Uuids;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
@@ -69,7 +70,7 @@ public class FabricConnectionListener extends AbstractConnectionListener {
// Get their profile from the net handler - it should have been initialised by now.
GameProfile profile = ((ServerLoginNetworkHandlerAccessor) netHandler).getGameProfile();
UUID uniqueId = profile.getId();
UUID uniqueId = profile.isComplete() ? profile.getId() : Uuids.getOfflinePlayerUuid(profile.getName());
String username = profile.getName();
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {