Skip to content

Commit

Permalink
Revert "Better name fetching"
Browse files Browse the repository at this point in the history
This reverts commit fafb64d.
  • Loading branch information
IThundxr committed Oct 17, 2024
1 parent eecea63 commit 529ca72
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package com.railwayteam.railways.compat.journeymap;

import com.mojang.authlib.GameProfile;
import com.railwayteam.railways.Railways;
import com.railwayteam.railways.annotation.event.MultiLoaderEvent;
import journeymap.client.api.IClientAPI;
Expand Down Expand Up @@ -190,14 +189,13 @@ public void onJoinWorld() {
}

public static String getNameFromUUID(UUID uuid) {
Minecraft mc = Minecraft.getInstance();
ClientPacketListener connection = mc.getConnection();
ClientPacketListener connection = Minecraft.getInstance().getConnection();
if (connection != null) {
PlayerInfo info = connection.getPlayerInfo(uuid);
if (info != null) {
return info.getProfile().getName();
}
}
return mc.getMinecraftSessionService().fillProfileProperties(new GameProfile(uuid, null), true).getName();
return "Unknown Player";
}
}

0 comments on commit 529ca72

Please sign in to comment.