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
  • Field Details

  • Constructor Details

  • Method Details

    • getEventBus

      protected abstract IEventBus getEventBus()
    • addFileMonitor

      public abstract void addFileMonitor(@Nonnull String var1, Path var2)
    • removeFileMonitor

      public abstract void removeFileMonitor(Path var1)
    • handleRemoveOrUpdate

      protected abstract void handleRemoveOrUpdate(Set<K> var1, Map<K,T> var2, @Nonnull AssetUpdateQuery var3)
    • getKeyClass

      @Nonnull public Class<K> getKeyClass()
    • getAssetClass

      @Nonnull public Class<T> getAssetClass()
    • getPath

      public String getPath()
    • getExtension

      @Nonnull public String getExtension()
    • getCodec

      public AssetCodec<K,T> getCodec()
    • getKeyFunction

      public Function<T,K> getKeyFunction()
    • getLoadsAfter

      @Nonnull public Set<Class<? extends JsonAsset<?>>> getLoadsAfter()
    • getAssetMap

      public M getAssetMap()
    • getReplaceOnRemove

      public Function<K,T> getReplaceOnRemove()
    • isUnmodifiable

      public boolean isUnmodifiable()
    • getPreAddedAssets

      public List<T> getPreAddedAssets()
    • hasLoadedContainedAssetsFor

      public <X extends JsonAssetWithMap> boolean hasLoadedContainedAssetsFor(Class<X> x)
    • getIdProvider

      public Class<? extends JsonAsset<?>> getIdProvider()
    • getLogger

      @Nonnull public com.hypixel.hytale.logger.HytaleLogger getLogger()
    • simplifyLoadBeforeDependencies

      public void simplifyLoadBeforeDependencies()
    • injectLoadsAfter

      @Deprecated public <D extends JsonAsset<?>> void injectLoadsAfter(Class<D> aClass)
      Deprecated.
    • decodeFilePathKey

      @Nullable public K decodeFilePathKey(@Nonnull Path path)
    • decodeStringKey

      @Nullable public K decodeStringKey(String key)
    • transformKey

      @Nullable public K transformKey(@Nullable Object o)
    • validate

      public void validate(@Nullable K key, @Nonnull ValidationResults results, ExtraInfo extraInfo)
    • 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

      @Nonnull public AssetLoadResult<K,T> loadAssetsFromPaths(@Nonnull String packKey, @Nonnull List<Path> paths)
    • 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

      @Nonnull public AssetLoadResult<K,T> loadAssets(@Nonnull String packKey, @Nonnull List<T> assets)
    • 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

      @Nonnull public Set<K> removeAssetWithPaths(@Nonnull String packKey, @Nonnull List<Path> paths)
    • removeAssetWithPaths

      @Nonnull public Set<K> removeAssetWithPaths(@Nonnull String packKey, @Nonnull List<Path> paths, @Nonnull AssetUpdateQuery assetUpdateQuery)
    • removeAssetWithPath

      @Nonnull public Set<K> removeAssetWithPath(Path path)
    • removeAssetWithPath

      @Nonnull public Set<K> removeAssetWithPath(Path path, @Nonnull AssetUpdateQuery assetUpdateQuery)
    • removeAssets

      @Nonnull public Set<K> removeAssets(@Nonnull Collection<K> keys)
    • removeAssets

      @Nonnull public Set<K> removeAssets(@Nonnull String packKey, boolean all, @Nonnull Collection<K> keys, @Nonnull AssetUpdateQuery assetUpdateQuery)
    • removeAssetPack

      public void removeAssetPack(@Nonnull String name)
    • 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

      @Nonnull public T decode(@Nonnull String packKey, @Nonnull K key, @Nonnull org.bson.BsonDocument document)
    • 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

      private void reloadChildrenContainerAssets(@Nonnull String packKey, @Nonnull Map<K,T> loadedAssets)
    • collectChildrenInDifferentFile

      private void collectChildrenInDifferentFile(K key, @Nonnull Path path, @Nonnull Set<Path> paths, @Nonnull Map<Class<? extends JsonAssetWithMap<?,?>>,Set<Path>> typedPaths, @Nonnull Set<K> ignore)
    • removeChildrenAssets

      protected void removeChildrenAssets(@Nonnull String packKey, @Nonnull Set<K> toBeRemoved)
    • 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

      private void loadAllChildren(@Nonnull Map<K,T> loadedAssets, @Nonnull Collection<T> assetKeys, @Nonnull Set<Path> documents)
    • loadAllChildren

      protected boolean loadAllChildren(@Nonnull Set<Path> documents, K key)
    • collectAllChildren

      protected void collectAllChildren(K key, @Nonnull Set<K> children)
    • collectAllChildren0

      private boolean collectAllChildren0(K key, @Nonnull Set<K> children)
    • logChildTree

      protected void logChildTree(@Nonnull StringBuilder sb, String indent, K key, @Nonnull Set<K> children)
    • logRemoveChildren

      protected void logRemoveChildren(K parentKey, @Nonnull Set<K> toBeRemoved)
    • logRemoveChildren

      protected void logRemoveChildren(@Nonnull Map<K,K> toBeRemoved)
    • testKeyFormat

      protected void testKeyFormat(@Nonnull K key, @Nullable Path assetPath)
    • logUnusedKeys

      public void logUnusedKeys(@Nonnull K key, @Nullable Path assetPath, @Nonnull AssetExtraInfo<K> extraInfo)
    • logLoadedAsset

      protected void logLoadedAsset(K key, @Nullable K parentKey, @Nullable Path path)
    • logRemoveAsset

      protected void logRemoveAsset(K key, @Nullable Path path)
    • recordFailedToLoad

      private void recordFailedToLoad(@Nonnull Set<K> failedToLoadKeys, @Nonnull Set<Path> failedToLoadPaths, @Nullable K key, @Nullable Path path)
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object