Class AssetLoaders

java.lang.Object
com.sk89q.worldedit.util.asset.AssetLoaders

@Beta public class AssetLoaders extends Object
Class to store the various asset loaders.
  • Constructor Details

    • AssetLoaders

      public AssetLoaders(WorldEdit worldEdit)
      Creates a new AssetManager to load and cache custom assets.
      Parameters:
      worldEdit - WorldEdit instance
  • Method Details

    • init

      public void init()
    • uninit

      public void uninit()
    • registerAssetLoader

      public <T> void registerAssetLoader(AssetLoader<T> loader, Class<T> assetClass)
    • getAssetLoader

      public <T> Optional<AssetLoader<T>> getAssetLoader(Class<T> assetClass, String filename)
      Gets the Asset Loader for the given file of the given type.
      Type Parameters:
      T - The returned asset type
      Parameters:
      assetClass - The class to get a loader for
      filename - The filename to attempt to load
    • getAssetLoaders

      public <T> List<AssetLoader<T>> getAssetLoaders(Class<T> assetClass)
      Get the Asset Loaders for the given type.
      Type Parameters:
      T - The asset type
      Parameters:
      assetClass - The class to get the loaders of
      Returns:
      The list of asset loaders
    • getFilesForAsset

      public List<Path> getFilesForAsset(Class<?> assetClass)
      Gets an immutable list of all files that match a certain asset type.
      Parameters:
      assetClass - The asset class
      Returns:
      The list of files
    • getAssetLoaders

      public List<AssetLoader<?>> getAssetLoaders()
      Gets an immutable copy of all registered asset loaders.
      Returns:
      The asset loaders