gt:             String name = player.getName();
context: package com.forgeessentials.api;
  
  import java.lang.ref.WeakReference;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  import java.util.UUID;
  
  import javax.annotation.Nullable;
  
  import net.minecraft.command.CommandBase;
  import net.minecraft.command.CommandException;
  import net.minecraft.command.EntitySelector;
  import net.minecraft.command.ICommandSender;
  import net.minecraft.entity.Entity;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.entity.player.EntityPlayerMP;
  import net.minecraft.network.rcon.RConConsoleSource;
  import net.minecraft.server.MinecraftServer;
  import net.minecraft.server.management.PlayerList;
  import net.minecraft.tileentity.CommandBlockBaseLogic;
  import net.minecraft.world.WorldServer;
  import net.minecraftforge.common.util.FakePlayer;
  import net.minecraftforge.common.util.FakePlayerFactory;
  import net.minecraftforge.fml.common.FMLCommonHandler;
  import net.minecraftforge.fml.common.eventhandler.Event;
  
  import com.forgeessentials.permissions.ModulePermissions;
  import com.forgeessentials.util.DoAsCommandSender;
  import com.forgeessentials.util.ServerUtil;
  import com.forgeessentials.util.UserIdentUtils;
  import com.forgeessentials.util.output.LoggingHandler;
  import com.google.gson.annotations.Expose;
  import com.mojang.authlib.GameProfile;
  
  public class UserIdent
  {
  
      public static class ServerUserIdent extends UserIdent
      {
  
          private ServerUserIdent(UUID uuid, String username)
          {
              super(uuid, username, null);
          }
  
          @Override
          public boolean isPlayer()
          {
              return false;
          }
  
      }
  
      public static class NpcUserIdent extends UserIdent
      {
  
          private NpcUserIdent(UUID uuid, String username)
          {
              super(uuid, username, null);
          }
  
          @Override
          public boolean isPlayer()
          {
              return false;
          }
  
          @Override
          public boolean isNpc()
          {
              return true;
          }
  
      }
  
      /* ------------------------------------------------------------ */
  
      public static class UserIdentInvalidatedEvent extends Event
      {
  
          public final UserIdent oldValue;
  
          public final UserIdent newValue;
  
          public UserIdentInvalidatedEvent(UserIdent oldValue, UserIdent newValue)
          {
              this.oldValue = oldValue;
              this.newValue = newValue;
          }
  
      }
  
      /* ------------------------------------------------------------ */
  
      private static final Map<UUID, UserIdent> byUuid = new HashMap<>();
  
      private static final Map<String, UserIdent> byUsername = new HashMap<>();
  
      /* ------------------------------------------------------------ */
  
      protected UUID uuid;
  
      protected String username;
  
      @Expose(serialize = false)
      protected int hashCode;
  
      @Expose(serialize = false)
      protected WeakReference<EntityPlayer> player;
  
      /* ------------------------------------------------------------ */
  
      private UserIdent(EntityPlayerMP player)
      {
          this(null, null, player);
      }
  
      private UserIdent(UUID identUuid, String identUsername, EntityPlayerMP identPlayer)
      {
          if (identUsername != null && identUsername.isEmpty())
              identUsername = null;
  
          UserIdent oldIdent = null;
          player = identPlayer == null ? null : new WeakReference<EntityPlayer>(identPlayer);
          if (identPlayer != null)
          {
              uuid = identPlayer.getPersistentID();
              username = identPlayer.getName();
              if (byUuid.containsKey(uuid)) {
                  oldIdent = byUuid.get(uuid);
              }
              byUuid.put(uuid, this);
              byUsername.put(username.toLowerCase(), this);
          }
          else
          {
              uuid = identUuid;
              username = identUsername;
  
              if (byUuid.containsKey(uuid)) {
                  oldIdent = byUuid.get(uuid);
              }
  
              if (uuid != null)
                  byUuid.put(this.uuid, this);
              if (identUsername != null && identUsername.charAt(0) != '@')
                  byUsername.put(identUsername.toLowerCase(), this);
  
              if (identUsername == null || identUsername.charAt(0) != '$' || identUsername.charAt(0) != '@') {
                  if (uuid == null && username != null)
                      uuid = UserIdentUtils.resolveMissingUUID(username);
                  else if (uuid != null && username == null)
                      username = UserIdentUtils.resolveMissingUsername(uuid);
              }
          }
  
          if (oldIdent != null && oldIdent.username != null && !oldIdent.username.equals(username)) {
              byUsername.remove(oldIdent.username);
              APIRegistry.getFEEventBus().post(new UserIdentInvalidatedEvent(oldIdent, this));
              LoggingHandler.felog.warn("Old Username: {} for uuid {}, was replaced with {}!",oldIdent.username, uuid, username);
          }
      }
  
      /* ------------------------------------------------------------ */
  
      public static synchronized UserIdent get(GameProfile profile)
      {
          return get(profile.getId(), profile.getName());
      }
      public static synchronized UserIdent get(UUID uuid, String username)
      {
          if (uuid == null && (username == null || username.isEmpty()))
              throw new IllegalArgumentException();
          if (username != null && username.isEmpty())
              username = null;
  
          if (uuid != null)
          {
              UserIdent ident = byUuid.get(uuid);
              if (ident != null)
                  return ident;
          }
  
          if (username != null)
          {
              UserIdent ident = byUsername.get(username.toLowerCase());
              if (ident != null)
              {
                  if (uuid != null && ident.uuid != uuid)
                  {
                      ident.uuid = uuid;
                      byUuid.put(uuid, ident);
                  }
                  return ident;
              }
              if (username.startsWith("$NPC"))
              {
                  return new NpcUserIdent(uuid, username);
              }
              else if (username.startsWith("$"))
              {
                  return new ServerUserIdent(uuid, username);
              }
          }
  
          return new UserIdent(uuid, username, UserIdent.getPlayerByUuid(uuid));
      }
  
      public static synchronized UserIdent get(String uuid, String username)
      {
          return get(uuid != null && !uuid.isEmpty() ? UUID.fromString(uuid) : null, username);
      }
  
      public static synchronized UserIdent get(UUID uuid)
      {
          if (uuid == null)
              throw new IllegalArgumentException();
  
          UserIdent ident = byUuid.get(uuid);
          if (ident != null)
              return ident;
  
          return new UserIdent(uuid, null, UserIdent.getPlayerByUuid(uuid));
      }
  
      public static synchronized UserIdent get(ICommandSender sender) {
          if (sender instanceof DoAsCommandSender)
          {
              return ((DoAsCommandSender) sender).getIdent();
          }
          else if (sender instanceof MinecraftServer)
          {
              return APIRegistry.IDENT_SERVER;
          }
          else if (sender instanceof RConConsoleSource)
          {
              return APIRegistry.IDENT_RCON;
          }
          else if (sender instanceof CommandBlockBaseLogic)
          {
              return APIRegistry.IDENT_CMDBLOCK;
          }
          else if (sender instanceof EntityPlayerMP)
          {
              return get((EntityPlayerMP) sender);
          }
          else
          {
              return UserIdent.getNpc(sender.getName());
          }
      }
      public static synchronized UserIdent getFromUuid(String uuid)
      {
          if (uuid == null)
              return null;
          try
          {
              return get(UUID.fromString(uuid));
          }
          catch (IllegalArgumentException e)
          {
              return null;
          }
      }
  
      public static synchronized UserIdent get(EntityPlayer player)
      {
          return player instanceof EntityPlayerMP ? get((EntityPlayerMP) player) : null;
      }
  
      public static synchronized UserIdent get(EntityPlayerMP player)
      {
          if (player == null)
              throw new IllegalArgumentException();
  
          if (player instanceof FakePlayer) {
              return getNpc(player.getName(), ModulePermissions.fakePlayerIsSpecialBunny ? null : player.getPersistentID());
          }
  
          UserIdent ident = byUuid.get(player.getPersistentID());
          if (ident == null)
          {
              ident = byUsername.get(player.getName().toLowerCase());
              if (ident != null)
              {
                  ident.uuid = player.getPersistentID();
                  byUuid.put(ident.uuid, ident);
              }
              else
                  ident = new UserIdent(player);
          }
          else
          {
  