Class AssetPrefabFileProvider

java.lang.Object
com.hypixel.hytale.builtin.buildertools.prefablist.AssetPrefabFileProvider
All Implemented Interfaces:
FileListProvider

public class AssetPrefabFileProvider extends Object implements FileListProvider
Custom file provider for prefab browsing that aggregates all asset packs. At the root level, shows virtual folders for each asset pack. When navigating into a pack folder, shows the actual prefab files from that pack.
  • Constructor Details

    • AssetPrefabFileProvider

      public AssetPrefabFileProvider()
  • Method Details

    • getFiles

      @Nonnull public List<FileListProvider.FileEntry> getFiles(@Nonnull Path currentDir, @Nonnull String searchQuery)
      Description copied from interface: FileListProvider
      Gets a list of file entries for display in the browser.
      Specified by:
      getFiles in interface FileListProvider
      Parameters:
      currentDir - The current directory path (relative to root), may be empty for root
      searchQuery - The search query to filter results, empty string for no filtering
      Returns:
      List of file entries to display
    • removeExtension

      @Nonnull public static String removeExtension(@Nonnull String fileName)
    • toNodeEditorPath

      @Nullable public static String toNodeEditorPath(@Nonnull String virtualPath)
      Converts a virtual prefab browser path to the node editor path format.

      Virtual paths follow the structure PackDisplayName/sub/path.prefab.json. The node editor expects paths relative to the pack root, prefixed with / and without the prefab suffix. For example:

      • "HytaleAssets/Server/Prefabs/Trees/OakTree.prefab.json" → "/Server/Prefabs/Trees/OakTree"
      • "HytaleAssets/Server/Prefabs/Trees/" → "/Server/Prefabs/Trees/"
      Returns:
      the node editor path, or null if the path has no sub-path (e.g., it is just a pack name or the root).
    • resolveVirtualPath

      @Nullable public Path resolveVirtualPath(@Nonnull String virtualPath)
      Resolves a virtual path to an actual filesystem path. Virtual paths are in the format: PackDisplayName/subdir/file.prefab.json
    • getPackDisplayName

      @Nonnull public String getPackDisplayName(@Nonnull String packKey)
      Gets the display name for a pack key.