Contents
Class AssetTree
java.lang.Object
com.hypixel.hytale.builtin.asseteditor.AssetTree
-
Constructor Summary
ConstructorsConstructorDescriptionAssetTree(Path rootPath, String packKey, boolean isReadOnly, boolean canBeDeleted, Collection<AssetTypeHandler> assetTypes) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyAssetChanges(Map<Path, ModifiedAsset> createdDirectories, Map<Path, ModifiedAsset> modifiedAssets) ensureAsset(Path path, boolean isDirectory) findAssetFilesByFilename(Path directory, String fileNameWithExtension) Finds every asset file directly or indirectly underdirectorywhose file name equalsassetId + extension, ignoring case.getAssetFile(Path path) booleanisDirectoryEmpty(Path path) removeAsset(Path path) voidreplaceAssetTree(AssetTree assetTree) voidsendPackets(EditorClient editorClient)
-
Constructor Details
-
AssetTree
-
AssetTree
public AssetTree(Path rootPath, String packKey, boolean isReadOnly, boolean canBeDeleted, @Nonnull Collection<AssetTypeHandler> assetTypes)
-
-
Method Details
-
replaceAssetTree
-
sendPackets
-
isDirectoryEmpty
- Parameters:
path- the path to test- Returns:
trueif the path is a directory and that directory doesn't contain any files
-
ensureAsset
- Parameters:
path- the asset pathisDirectory- if the path is a directory- Returns:
- the
AssetEditorFileEntryfor the inserted path ornullif asset already exists
-
findAssetFilesByFilename
@Nonnull public List<Path> findAssetFilesByFilename(@Nonnull Path directory, @Nonnull String fileNameWithExtension) Finds every asset file directly or indirectly underdirectorywhose file name equalsassetId + extension, ignoring case. The match is by file name only, so files with the same name in different sub-folders all qualify.- Parameters:
directory- the directory to search, relative to the pack root (for exampleServer/Item/ItemsorCommon/BlockTextures/)fileNameWithExtension- the asset file name with the extension (for example.jsonor.png)- Returns:
- the matching paths, relative to the pack root, in stable ascending path order (possibly empty)
-
getAssetFile
- Parameters:
path- the asset path- Returns:
- the
AssetEditorFileEntryfor the path ornullif none exists
-
removeAsset
- Parameters:
path- the path of the asset to remove- Returns:
- the removed
AssetEditorFileEntryfor the path ornullif none exists
-
applyAssetChanges
public void applyAssetChanges(@Nonnull Map<Path, ModifiedAsset> createdDirectories, @Nonnull Map<Path, ModifiedAsset> modifiedAssets)
-