Class AssetLoader<T>

java.lang.Object
com.sk89q.worldedit.util.asset.AssetLoader<T>
Direct Known Subclasses:
ImageHeightmapLoader

@Beta public abstract class AssetLoader<T> extends Object
  • Constructor Details

    • AssetLoader

      public AssetLoader(WorldEdit worldEdit, Path assetDir)
  • Method Details

    • getAsset

      @Nullable public T getAsset(String path)
      Loads an asset.
      Parameters:
      path - path in assets directory, can be with and without its file extension
      Returns:
      asset if successfully loaded, null otherwise
    • loadAssetFromPath

      @Nullable protected abstract T loadAssetFromPath(Path path) throws Exception
      Loads an asset from the given file if possible.
      Parameters:
      path - The file to load
      Returns:
      loaded asset, or null otherwise
      Throws:
      Exception
    • getAllowedExtensions

      public abstract Set<String> getAllowedExtensions()
      The extensions that this asset loader supports.
      Returns:
      The supported extensions