Contents
Class AssetFileSystem
java.lang.Object
com.hypixel.hytale.server.worldgen.loader.AssetFileSystem
- All Implemented Interfaces:
FileIOSystem, AutoCloseable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface FileIOSystem
FileIOSystem.PathArray, FileIOSystem.Provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseRoot()Get the root Path of the base FileSystem used by this FileIOSystem.voidclose()Close the FileIOSystem releasing any held resources.getAssetPacks(WorldGenConfig config, Predicate<Path> filter) Get an immutable list of AssetPacks that apply to the given world-gen config and predicate.static Path[]getAssetRoots(List<AssetPack> packs) <T> Tload(AssetPath path, AssetLoader<T> loader) Load an asset from a given file Path.packs()Convert an asset Path to the actual file Path found within the FileIOSystem.roots()Get all root Paths used by this FileIOSystem.
-
Constructor Details
-
AssetFileSystem
-
-
Method Details
-
baseRoot
Description copied from interface:FileIOSystemGet the root Path of the base FileSystem used by this FileIOSystem.- Specified by:
baseRootin interfaceFileIOSystem- Returns:
- The base root Path.
-
roots
Description copied from interface:FileIOSystemGet all root Paths used by this FileIOSystem.- Specified by:
rootsin interfaceFileIOSystem- Returns:
- An array of root Paths.
-
resolve
Description copied from interface:FileIOSystemConvert an asset Path to the actual file Path found within the FileIOSystem.- Specified by:
resolvein interfaceFileIOSystem- Parameters:
path- The asset Path to resolve.- Returns:
- The resolved Path of the actual file found within the FileIOSystem.
-
load
@Nonnull public <T> T load(@Nonnull AssetPath path, @Nonnull AssetLoader<T> loader) throws IOException Description copied from interface:FileIOSystemLoad an asset from a given file Path.- Specified by:
loadin interfaceFileIOSystem- Parameters:
path- The asset Path to load the asset from.loader- The AssetLoader used to load the asset.- Returns:
- The loaded asset.
- Throws:
IOException- if the file does not exist or cannot otherwise be loaded.
-
close
public void close()Description copied from interface:FileIOSystemClose the FileIOSystem releasing any held resources. Implementation should finally call FileIO.closeFileIOSystem(this) to ensure proper cleanup.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceFileIOSystem
-
packs
-
getAssetPacks
public static List<AssetPack> getAssetPacks(@Nonnull WorldGenConfig config, @Nonnull Predicate<Path> filter) Get an immutable list of AssetPacks that apply to the given world-gen config and predicate.- Parameters:
config- The config for the world-gen to get asset packs for.filter- Path filter for matching pack root paths.- Returns:
- An immutable list of AssetPacks that match the config and predicate.
-
getAssetRoots
-