Class AssetFileSystem

java.lang.Object
com.hypixel.hytale.server.worldgen.loader.AssetFileSystem
All Implemented Interfaces:
FileIOSystem, AutoCloseable

public class AssetFileSystem extends Object implements FileIOSystem
  • Constructor Details

    • AssetFileSystem

      public AssetFileSystem(@Nonnull WorldGenConfig config)
  • Method Details

    • baseRoot

      @Nonnull public Path baseRoot()
      Description copied from interface: FileIOSystem
      Get the root Path of the base FileSystem used by this FileIOSystem.
      Specified by:
      baseRoot in interface FileIOSystem
      Returns:
      The base root Path.
    • roots

      @Nonnull public FileIOSystem.PathArray roots()
      Description copied from interface: FileIOSystem
      Get all root Paths used by this FileIOSystem.
      Specified by:
      roots in interface FileIOSystem
      Returns:
      An array of root Paths.
    • resolve

      @Nonnull public AssetPath resolve(@Nonnull Path path)
      Description copied from interface: FileIOSystem
      Convert an asset Path to the actual file Path found within the FileIOSystem.
      Specified by:
      resolve in interface FileIOSystem
      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: FileIOSystem
      Load an asset from a given file Path.
      Specified by:
      load in interface FileIOSystem
      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: FileIOSystem
      Close the FileIOSystem releasing any held resources. Implementation should finally call FileIO.closeFileIOSystem(this) to ensure proper cleanup.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface FileIOSystem
    • packs

      public List<AssetPack> 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

      public static Path[] getAssetRoots(@Nonnull List<AssetPack> packs)