@SuppressWarnings("unchecked") private static void replacePlayerCape(AbstractClientPlayer player){
  final String displayName=player.getDisplayNameString();
  final NetworkPlayerInfo playerInfo;
  try {
    playerInfo=(NetworkPlayerInfo)GET_PLAYER_INFO.invokeExact(player);
  }
 catch (  Throwable throwable) {
    Logger.fatal(throwable,"Failed to get NetworkPlayerInfo of %s",displayName);
    return;
  }
  if (playerInfo == null) {
    Logger.fatal("NetworkPlayerInfo of %s is null",displayName);
    return;
  }
  final Map<MinecraftProfileTexture.Type,ResourceLocation> playerTextures;
  try {
    playerTextures=(Map<MinecraftProfileTexture.Type,ResourceLocation>)GET_PLAYER_TEXTURES.invokeExact(playerInfo);
  }
 catch (  Throwable throwable) {
    Logger.fatal(throwable,"Failed to get player textures of %s",displayName);
    return;
  }
  playerTextures.put(MinecraftProfileTexture.Type.CAPE,CAPE_LOCATION);
  Logger.info("Replaced cape of %s!",displayName);
}

@ SuppressWarnings ( "unchecked" ) private static void replacePlayerCape ( AbstractClientPlayer player ) { final String displayName = player . getDisplayNameString ( ) ; final NetworkPlayerInfo playerInfo ; try { playerInfo = ( NetworkPlayerInfo ) GET_PLAYER_INFO . invokeExact ( player ) ; } catch ( Throwable throwable ) { Logger . fatal ( throwable , "Failed to get NetworkPlayerInfo of %s" , displayName ) ; return ; } if ( playerInfo == null ) { Logger . fatal ( "NetworkPlayerInfo of %s is null" , displayName ) ; return ; } final Map < MinecraftProfileTexture . Type , ResourceLocation > playerTextures ; try { playerTextures = ( Map < MinecraftProfileTexture . Type , ResourceLocation > ) GET_PLAYER_TEXTURES . invokeExact ( playerInfo ) ; } catch ( Throwable throwable ) { Logger . fatal ( throwable , "Failed to get player textures of %s" , displayName ) ; return ; } playerTextures . put ( MinecraftProfileTexture . Type . CAPE , CAPE_LOCATION ) ; Logger . info ( "Replaced cape of %s!" , displayName ) ; }
replace a player ' s cape with the testmod3 cape .
