public static @Nullable File getPluginResource(@NotNull Class<?> pluginClass, @NotNull String resourceName) {
    Path result = PluginManagerCoreKt.getPluginDistDirByClass(pluginClass);
    if (result != null) {
      return result.resolve(resourceName).toFile();
    }

    try {
      String pathForClass = PathManager.getJarPathForClass(pluginClass);
      assert pathForClass != null : pluginClass;
      if (!pathForClass.endsWith(".jar")) {
        URL resource = pluginClass.getClassLoader().getResource(resourceName);
        if (resource == null) {
          return null;
        }
        return new File(URLUtil.decode(resource.getPath()));
      }
      File jarFile = new File(pathForClass);
      if (!jarFile.isFile()) {
        return null;
      }

      File pluginBaseDir = jarFile.getParentFile().getParentFile();
      return new File(pluginBaseDir, resourceName);
    }
    catch (Exception e) {
      throw new RuntimeException(e.getMessage(), e);
    }
  }
public static @Nullable File getPluginResource(@NotNull Class<?> pluginClass, @NotNull String resourceName)