Contents
Class AssetPrefabFileProvider
java.lang.Object
com.hypixel.hytale.builtin.buildertools.prefablist.AssetPrefabFileProvider
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface FileListProvider
FileListProvider.FileEntry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a list of file entries for display in the browser.getPackDisplayName(String packKey) Gets the display name for a pack key.static StringremoveExtension(String fileName) resolveVirtualPath(String virtualPath) Resolves a virtual path to an actual filesystem path.static StringtoNodeEditorPath(String virtualPath) Converts a virtual prefab browser path to the node editor path format.
-
Constructor Details
-
AssetPrefabFileProvider
public AssetPrefabFileProvider()
-
-
Method Details
-
getFiles
@Nonnull public List<FileListProvider.FileEntry> getFiles(@Nonnull Path currentDir, @Nonnull String searchQuery) Description copied from interface:FileListProviderGets a list of file entries for display in the browser.- Specified by:
getFilesin interfaceFileListProvider- Parameters:
currentDir- The current directory path (relative to root), may be empty for rootsearchQuery- The search query to filter results, empty string for no filtering- Returns:
- List of file entries to display
-
removeExtension
-
toNodeEditorPath
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
nullif the path has no sub-path (e.g., it is just a pack name or the root).
-
resolveVirtualPath
-
getPackDisplayName
-