Package com.hypixel.hytale.assetstore
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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Mprotected final AssetCodec<K, T> static booleanstatic booleanprotected final Stringprotected Set<Class<? extends JsonAssetWithMap>> protected final com.hypixel.hytale.logger.HytaleLoggerprotected final Stringprotected final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<CK> voidaddChildAssetReferences(K parentKey, Class<? extends JsonAssetWithMap<CK, ?>> childAssetClass, Set<CK> childKeys) abstract voidaddFileMonitor(String var1, Path var2) protected voidcollectAllChildren(K key, Set<K> children) private booleancollectAllChildren0(K key, Set<K> children) private voidcollectChildrenInDifferentFile(K key, Path path, Set<Path> paths, Map<Class<? extends JsonAssetWithMap<?, ?>>, Set<Path>> typedPaths, Set<K> ignore) private AssetHolder<K> decodeAsset0(Map<K, T> loadedAssets, Map<K, Path> loadedKeyToPathMap, Set<K> failedToLoadKeys, Set<Path> failedToLoadPaths, M assetMap, AssetUpdateQuery query, boolean forceLoadAll, RawAsset<K> rawAsset, RawJsonReader reader) protected voiddecodeAssets(String packKey, List<RawAsset<K>> rawAssets, Map<K, T> loadedAssets, Map<K, Path> loadedKeyToPathMap, Map<K, Set<K>> loadedAssetChildren, Set<K> failedToLoadKeys, Set<Path> failedToLoadPaths, M assetMap, AssetUpdateQuery query, boolean forceLoadAll) private DecodedAsset<K, T> decodeAssetWithParent0(Map<K, T> loadedAssets, Map<K, Path> loadedKeyToPathMap, Map<K, Set<K>> loadedAssetChildren, Set<K> failedToLoadKeys, Set<Path> failedToLoadPaths, M assetMap, AssetUpdateQuery query, boolean forceLoadAll, RawAsset<K> rawAsset, RawJsonReader reader, T parent) decodeFilePathKey(Path path) decodeStringKey(String key) private CompletableFuture<DecodedAsset<K, T>> executeAssetDecode(Map<K, T> loadedAssets, Map<K, Path> loadedKeyToPathMap, Set<K> failedToLoadKeys, Set<Path> failedToLoadPaths, M assetMap, AssetUpdateQuery query, boolean forceLoadAll, Map<K, RawAsset<K>> waitingForParent, RawAsset<K> rawAsset) AssetCodec<K, T> getCodec()protected abstract IEventBuscom.hypixel.hytale.logger.HytaleLoggergetPath()protected abstract voidhandleRemoveOrUpdate(Set<K> var1, Map<K, T> var2, AssetUpdateQuery var3) <X extends JsonAssetWithMap>
boolean<D extends JsonAsset<?>>
voidinjectLoadsAfter(Class<D> aClass) Deprecated.booleanprivate voidloadAllChildren(Map<K, T> loadedAssets, Collection<T> assetKeys, Set<Path> documents) protected booleanloadAllChildren(Set<Path> documents, K key) loadAssets(String packKey, List<T> assets) loadAssets(String packKey, List<T> assets, AssetUpdateQuery query) loadAssets(String packKey, List<T> assets, AssetUpdateQuery query, boolean forceLoadAll) protected voidloadAssets0(String packKey, Map<K, T> loadedAssets, List<RawAsset<K>> preLoaded, Map<K, Path> loadedKeyToPathMap, Set<K> failedToLoadKeys, Set<Path> failedToLoadPaths, AssetUpdateQuery query, boolean forceLoadAll, Map<Class<? extends JsonAssetWithMap>, AssetLoadResult> childAssetResults) 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) protected voidloadContainedAssets(String packKey, Collection<T> assets, Map<Class<? extends JsonAssetWithMap>, AssetLoadResult> childAssetsResults, AssetUpdateQuery query, boolean forceLoadAll) protected voidlogChildTree(StringBuilder sb, String indent, K key, Set<K> children) voidprotected voidlogLoadedAsset(K key, K parentKey, Path path) protected voidlogRemoveAsset(K key, Path path) protected voidlogRemoveChildren(Map<K, K> toBeRemoved) protected voidlogRemoveChildren(K parentKey, Set<K> toBeRemoved) voidlogUnusedKeys(K key, Path assetPath, AssetExtraInfo<K> extraInfo) private voidprivate voidreloadChildrenContainerAssets(String packKey, Map<K, T> loadedAssets) 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) protected voidremoveChildrenAssets(String packKey, Set<K> toBeRemoved) abstract voidremoveFileMonitor(Path var1) voidprotected voidtestKeyFormat(K key, Path assetPath) toString()voidvalidate(K key, ValidationResults results, ExtraInfo extraInfo) voidwriteAssetToDisk(AssetPack pack, Map<Path, T> assetsByPath) writeAssetToDisk(AssetPack pack, Map<Path, T> assetsByPath, AssetUpdateQuery query)
-
Field Details
-
DISABLE_ASSET_COMPARE
public static boolean DISABLE_ASSET_COMPARE -
logger
@Nonnull protected final com.hypixel.hytale.logger.HytaleLogger logger -
kClass
-
tClass
-
path
-
extension
-
codec
-
keyFunction
-
loadsAfter
-
unmodifiableLoadsAfter
-
loadsBefore
-
assetMap
-
replaceOnRemove
-
isUnknown
-
unmodifiable
protected final boolean unmodifiable -
preAddedAssets
-
idProvider
-
childAssetsMap
-
loadedContainedAssetsFor
-
DISABLE_DYNAMIC_DEPENDENCIES
public static boolean DISABLE_DYNAMIC_DEPENDENCIES
-
-
Constructor Details
-
AssetStore
-
-
Method Details
-
getEventBus
-
addFileMonitor
-
removeFileMonitor
-
handleRemoveOrUpdate
-
getKeyClass
-
getAssetClass
-
getPath
-
getExtension
-
getCodec
-
getKeyFunction
-
getLoadsAfter
-
getAssetMap
-
getReplaceOnRemove
-
isUnmodifiable
public boolean isUnmodifiable() -
getPreAddedAssets
-
hasLoadedContainedAssetsFor
-
getIdProvider
-
getLogger
@Nonnull public com.hypixel.hytale.logger.HytaleLogger getLogger() -
simplifyLoadBeforeDependencies
public void simplifyLoadBeforeDependencies() -
injectLoadsAfter
Deprecated. -
decodeFilePathKey
-
decodeStringKey
-
transformKey
-
validate
-
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) 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
-
decode
-
addChildAssetReferences
public <CK> void addChildAssetReferences(K parentKey, Class<? extends JsonAssetWithMap<CK, ?>> childAssetClass, @Nonnull Set<CK> childKeys) -
loadAssets0
protected void loadAssets0(@Nonnull String packKey, @Nonnull Map<K, T> loadedAssets, @Nonnull List<RawAsset<K>> preLoaded, @Nonnull Map<K, Path> loadedKeyToPathMap, @Nonnull Set<K> failedToLoadKeys, @Nonnull Set<Path> failedToLoadPaths, @Nonnull AssetUpdateQuery query, boolean forceLoadAll, @Nonnull Map<Class<? extends JsonAssetWithMap>, AssetLoadResult> childAssetResults) -
reloadChildrenContainerAssets
-
collectChildrenInDifferentFile
-
removeChildrenAssets
-
loadContainedAssets
protected void loadContainedAssets(@Nonnull String packKey, @Nonnull Collection<T> assets, @Nonnull Map<Class<? extends JsonAssetWithMap>, AssetLoadResult> childAssetsResults, @Nonnull AssetUpdateQuery query, boolean forceLoadAll) -
decodeAssets
protected void decodeAssets(@Nonnull String packKey, @Nonnull List<RawAsset<K>> rawAssets, @Nonnull Map<K, T> loadedAssets, @Nonnull Map<K, Path> loadedKeyToPathMap, @Nonnull Map<K, Set<K>> loadedAssetChildren, @Nonnull Set<K> failedToLoadKeys, @Nonnull Set<Path> failedToLoadPaths, @Nullable M assetMap, @Nonnull AssetUpdateQuery query, boolean forceLoadAll) -
executeAssetDecode
@Nonnull private CompletableFuture<DecodedAsset<K,T>> executeAssetDecode(@Nonnull Map<K, T> loadedAssets, @Nonnull Map<K, Path> loadedKeyToPathMap, @Nonnull Set<K> failedToLoadKeys, @Nonnull Set<Path> failedToLoadPaths, M assetMap, @Nonnull AssetUpdateQuery query, boolean forceLoadAll, @Nonnull Map<K, RawAsset<K>> waitingForParent, @Nonnull RawAsset<K> rawAsset) -
decodeAsset0
@Nullable private AssetHolder<K> decodeAsset0(@Nonnull Map<K, T> loadedAssets, @Nonnull Map<K, Path> loadedKeyToPathMap, @Nonnull Set<K> failedToLoadKeys, @Nonnull Set<Path> failedToLoadPaths, @Nullable M assetMap, @Nonnull AssetUpdateQuery query, boolean forceLoadAll, @Nonnull RawAsset<K> rawAsset, @Nonnull RawJsonReader reader) -
decodeAssetWithParent0
@Nullable private DecodedAsset<K,T> decodeAssetWithParent0(@Nonnull Map<K, T> loadedAssets, @Nonnull Map<K, Path> loadedKeyToPathMap, @Nonnull Map<K, Set<K>> loadedAssetChildren, @Nonnull Set<K> failedToLoadKeys, @Nonnull Set<Path> failedToLoadPaths, @Nullable M assetMap, @Nonnull AssetUpdateQuery query, boolean forceLoadAll, @Nonnull RawAsset<K> rawAsset, @Nonnull RawJsonReader reader, T parent) -
loadAllChildren
-
loadAllChildren
-
collectAllChildren
-
collectAllChildren0
-
logChildTree
protected void logChildTree(@Nonnull StringBuilder sb, String indent, K key, @Nonnull Set<K> children) -
logRemoveChildren
-
logRemoveChildren
-
testKeyFormat
-
logUnusedKeys
public void logUnusedKeys(@Nonnull K key, @Nullable Path assetPath, @Nonnull AssetExtraInfo<K> extraInfo) -
logLoadedAsset
-
logRemoveAsset
-
recordFailedToLoad
-
toString
-