Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- addFileMonitor(String, Path)
- removeFileMonitor(Path)
- getKeyClass()
- getAssetClass()
- getPath()
- getExtension()
- getCodec()
- getKeyFunction()
- getLoadsAfter()
- getAssetMap()
- getReplaceOnRemove()
- isUnmodifiable()
- getPreAddedAssets()
- hasLoadedContainedAssetsFor(Class)
- getIdProvider()
- getLogger()
- simplifyLoadBeforeDependencies()
- injectLoadsAfter(Class)
- decodeFilePathKey(Path)
- decodeStringKey(String)
- transformKey(Object)
- validate(K, ValidationResults, ExtraInfo)
- validate(K, ValidationResults, ExtraInfo, boolean)
- validateCodecDefaults()
- logDependencies()
- loadAssetsFromDirectory(String, Path)
- loadAssetsFromPaths(String, List)
- loadAssetsFromPaths(String, Collection, AssetUpdateQuery)
- loadAssetsFromPaths(String, Collection, AssetUpdateQuery, boolean)
- loadBuffersWithKeys(String, List, AssetUpdateQuery, boolean)
- loadAssets(String, List)
- loadAssets(String, List, AssetUpdateQuery)
- loadAssets(String, List, AssetUpdateQuery, boolean)
- loadAssetsWithReferences(String, Map)
- loadAssetsWithReferences(String, Map, AssetUpdateQuery)
- loadAssetsWithReferences(String, Map, AssetUpdateQuery, boolean)
- removeAssetWithPaths(String, List)
- removeAssetWithPaths(String, List, AssetUpdateQuery)
- removeAssetWithPath(Path)
- removeAssetWithPath(Path, AssetUpdateQuery)
- removeAssets(Collection)
- removeAssets(String, boolean, Collection, AssetUpdateQuery)
- removeAssetPack(String)
- writeAssetToDisk(AssetPack, Map, boolean)
- writeAssetToDisk(AssetPack, Map, AssetUpdateQuery)
- writeAssetToDisk(AssetPack, Map, AssetUpdateQuery, boolean)
- decode(String, K, BsonDocument)
- addChildAssetReferences(K, Class, Set)
- logUnusedKeys(K, Path, AssetExtraInfo)
- toString()
Class AssetStore<K, T extends JsonAssetWithMap<K,M> , M extends AssetMap<K,T> >
java.lang.Object
com.hypixel.hytale.assetstore.AssetStore<K,T,M>
- Direct Known Subclasses:
HytaleAssetStore
public abstract class AssetStore<K, T extends JsonAssetWithMap<K,M>, M extends AssetMap<K,T>>
extends Object
- Since:
- 10/10/18
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic boolean -
Constructor Summary
ConstructorsConstructorDescriptionAssetStore(com.hypixel.hytale.assetstore.AssetStore.Builder<K, T, M, ?> builder) -
Method Summary
Modifier and TypeMethodDescription<CK> voidaddChildAssetReferences(K parentKey, Class<? extends JsonAssetWithMap<CK, ?>> childAssetClass, Set<CK> childKeys) abstract voidaddFileMonitor(String packKey, Path path) decodeFilePathKey(Path path) decodeStringKey(String key) AssetCodec<K, T> getCodec()getPath()<X extends JsonAssetWithMap>
boolean<D extends JsonAsset<?>>
voidinjectLoadsAfter(Class<D> aClass) Deprecated.booleanloadAssets(String packKey, List<T> assets) loadAssets(String packKey, List<T> assets, AssetUpdateQuery query) loadAssets(String packKey, List<T> assets, AssetUpdateQuery query, boolean forceLoadAll) loadAssetsFromDirectory(String packKey, Path assetsPath) loadAssetsFromPaths(String packKey, Collection<Path> paths, AssetUpdateQuery query) loadAssetsFromPaths(String packKey, Collection<Path> paths, AssetUpdateQuery query, boolean forceLoadAll) loadAssetsFromPaths(String packKey, List<Path> paths) loadAssetsWithReferences(String packKey, Map<T, List<AssetReferences<?, ?>>> assets) loadAssetsWithReferences(String packKey, Map<T, List<AssetReferences<?, ?>>> assets, AssetUpdateQuery query) loadAssetsWithReferences(String packKey, Map<T, List<AssetReferences<?, ?>>> assets, AssetUpdateQuery query, boolean forceLoadAll) loadBuffersWithKeys(String packKey, List<RawAsset<K>> preLoaded, AssetUpdateQuery query, boolean forceLoadAll) voidvoidlogUnusedKeys(K key, Path assetPath, AssetExtraInfo<K> extraInfo) voidremoveAssetPack(String name) removeAssets(String packKey, boolean all, Collection<K> keys, AssetUpdateQuery assetUpdateQuery) removeAssets(Collection<K> keys) removeAssetWithPath(Path path) removeAssetWithPath(Path path, AssetUpdateQuery assetUpdateQuery) removeAssetWithPaths(String packKey, List<Path> paths) removeAssetWithPaths(String packKey, List<Path> paths, AssetUpdateQuery assetUpdateQuery) abstract voidremoveFileMonitor(Path path) voidtoString()voidvalidate(K key, ValidationResults results, ExtraInfo extraInfo) voidvalidate(K key, ValidationResults results, ExtraInfo extraInfo, boolean lenient) Validate that a referenced asset exists.voidwriteAssetToDisk(AssetPack pack, Map<Path, T> assetsByPath, boolean playerIsOwner) writeAssetToDisk(AssetPack pack, Map<Path, T> assetsByPath, AssetUpdateQuery query) writeAssetToDisk(AssetPack pack, Map<Path, T> assetsByPath, AssetUpdateQuery query, boolean playerIsOwner)
-
Field Details
-
DISABLE_ASSET_COMPARE
public static boolean DISABLE_ASSET_COMPARE -
DISABLE_DYNAMIC_DEPENDENCIES
public static boolean DISABLE_DYNAMIC_DEPENDENCIES
-
-
Constructor Details
-
AssetStore
-
-
Method Details
-
addFileMonitor
-
removeFileMonitor
-
getKeyClass
-
getAssetClass
-
getPath
-
getExtension
-
getCodec
-
getKeyFunction
-
getLoadsAfter
-
getAssetMap
-
getReplaceOnRemove
-
isUnmodifiable
public boolean isUnmodifiable() -
getPreAddedAssets
-
hasLoadedContainedAssetsFor
-
getIdProvider
-
getLogger
-
simplifyLoadBeforeDependencies
public void simplifyLoadBeforeDependencies() -
injectLoadsAfter
Deprecated. -
decodeFilePathKey
-
decodeStringKey
-
transformKey
-
validate
-
validate
public void validate(@Nullable K key, @Nonnull ValidationResults results, ExtraInfo extraInfo, boolean lenient) Validate that a referenced asset exists.- Parameters:
lenient- iftrue, a missing reference is only fatal during asset authoring. When decoding persisted world data (chunk or entity components) a missing reference is reported as a warning instead of a failure. Use this for references stored in saved data, where the defining content can be removed after the reference is persisted.
-
validateCodecDefaults
public void validateCodecDefaults() -
logDependencies
public void logDependencies() -
loadAssetsFromDirectory
@Nonnull public AssetLoadResult<K,T> loadAssetsFromDirectory(@Nonnull String packKey, @Nonnull Path assetsPath) throws IOException - Throws:
IOException
-
loadAssetsFromPaths
-
loadAssetsFromPaths
@Nonnull public AssetLoadResult<K,T> loadAssetsFromPaths(@Nonnull String packKey, @Nonnull Collection<Path> paths, @Nonnull AssetUpdateQuery query) -
loadAssetsFromPaths
@Nonnull public AssetLoadResult<K,T> loadAssetsFromPaths(@Nonnull String packKey, @Nonnull Collection<Path> paths, @Nonnull AssetUpdateQuery query, boolean forceLoadAll) -
loadBuffersWithKeys
@Nonnull public AssetLoadResult<K,T> loadBuffersWithKeys(@Nonnull String packKey, @Nonnull List<RawAsset<K>> preLoaded, @Nonnull AssetUpdateQuery query, boolean forceLoadAll) -
loadAssets
-
loadAssets
@Nonnull public AssetLoadResult<K,T> loadAssets(@Nonnull String packKey, @Nonnull List<T> assets, @Nonnull AssetUpdateQuery query) -
loadAssets
@Nonnull public AssetLoadResult<K,T> loadAssets(@Nonnull String packKey, @Nonnull List<T> assets, @Nonnull AssetUpdateQuery query, boolean forceLoadAll) -
loadAssetsWithReferences
@Nonnull public AssetLoadResult<K,T> loadAssetsWithReferences(@Nonnull String packKey, @Nonnull Map<T, List<AssetReferences<?, ?>>> assets) -
loadAssetsWithReferences
@Nonnull public AssetLoadResult<K,T> loadAssetsWithReferences(@Nonnull String packKey, @Nonnull Map<T, List<AssetReferences<?, ?>>> assets, @Nonnull AssetUpdateQuery query) -
loadAssetsWithReferences
@Nonnull public AssetLoadResult<K,T> loadAssetsWithReferences(@Nonnull String packKey, @Nonnull Map<T, List<AssetReferences<?, ?>>> assets, @Nonnull AssetUpdateQuery query, boolean forceLoadAll) -
removeAssetWithPaths
-
removeAssetWithPaths
-
removeAssetWithPath
-
removeAssetWithPath
-
removeAssets
-
removeAssets
@Nonnull public Set<K> removeAssets(@Nonnull String packKey, boolean all, @Nonnull Collection<K> keys, @Nonnull AssetUpdateQuery assetUpdateQuery) -
removeAssetPack
-
writeAssetToDisk
public AssetLoadResult<K,T> writeAssetToDisk(@Nonnull AssetPack pack, @Nonnull Map<Path, T> assetsByPath, boolean playerIsOwner) throws IOException- Throws:
IOException
-
writeAssetToDisk
public AssetLoadResult<K,T> writeAssetToDisk(@Nonnull AssetPack pack, @Nonnull Map<Path, T> assetsByPath, @Nonnull AssetUpdateQuery query) throws IOException- Throws:
IOException
-
writeAssetToDisk
public AssetLoadResult<K,T> writeAssetToDisk(@Nonnull AssetPack pack, @Nonnull Map<Path, T> assetsByPath, @Nonnull AssetUpdateQuery query, boolean playerIsOwner) throws IOException- Throws:
IOException
-
decode
-
addChildAssetReferences
public <CK> void addChildAssetReferences(K parentKey, Class<? extends JsonAssetWithMap<CK, ?>> childAssetClass, @Nonnull Set<CK> childKeys) -
logUnusedKeys
public void logUnusedKeys(@Nonnull K key, @Nullable Path assetPath, @Nonnull AssetExtraInfo<K> extraInfo) -
toString
-