Package com.sk89q.worldedit.util.asset
Class AssetLoaders
java.lang.Object
com.sk89q.worldedit.util.asset.AssetLoaders
Class to store the various asset loaders.
-
Constructor Summary
ConstructorsConstructorDescriptionAssetLoaders
(WorldEdit worldEdit) Creates a new AssetManager to load and cache custom assets. -
Method Summary
Modifier and TypeMethodDescription<T> Optional<AssetLoader<T>>
getAssetLoader
(Class<T> assetClass, String filename) Gets the Asset Loader for the given file of the given type.List<AssetLoader<?>>
Gets an immutable copy of all registered asset loaders.<T> List<AssetLoader<T>>
getAssetLoaders
(Class<T> assetClass) Get the Asset Loaders for the given type.getFilesForAsset
(Class<?> assetClass) Gets an immutable list of all files that match a certain asset type.void
init()
<T> void
registerAssetLoader
(AssetLoader<T> loader, Class<T> assetClass) void
uninit()
-
Constructor Details
-
AssetLoaders
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
-
getAssetLoader
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 forfilename
- The filename to attempt to load
-
getAssetLoaders
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
Gets an immutable list of all files that match a certain asset type.- Parameters:
assetClass
- The asset class- Returns:
- The list of files
-
getAssetLoaders
Gets an immutable copy of all registered asset loaders.- Returns:
- The asset loaders
-