Contents
Class PrefabBufferUtil
java.lang.Object
com.hypixel.hytale.server.core.prefab.selection.buffer.PrefabBufferUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PathCache path is used whenAssetModule.isAssetPathImmutable(Path)returnstrue.static final Patternstatic final Stringstatic final Stringstatic final Stringstatic final HytaleLoggerstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IPrefabBufferGets a PrefabBuffer accessor from the cache, loading from disk if necessary.static PrefabBufferloadBuffer(Path path) Loads a PrefabBuffer from disk bypassing PrefabBufferUtil's cache.static PrefabBufferloadFromJson(AssetPack pack, Path path, Path cachedLpfPath, Path jsonPath) static PrefabBufferloadFromLPF(Path path, Path realPath) static PrefabBufferreadFromFile(Path path) static CompletableFuture<PrefabBuffer> readFromFileAsync(Path path) static voidremoveCached(Path path) Remove the cache entry for the given prefab path.static CompletableFuture<Void> writeToFileAsync(PrefabBuffer prefab, Path path)
-
Field Details
-
CACHE_PATH
Cache path is used whenAssetModule.isAssetPathImmutable(Path)returnstrue. Configurable viaOptions.PREFAB_CACHE_DIRECTORY, defaults to ".cache/prefabs". -
LPF_FILE_SUFFIX
- See Also:
-
JSON_FILE_SUFFIX
- See Also:
-
JSON_LPF_FILE_SUFFIX
- See Also:
-
FILE_SUFFIX_REGEX
- See Also:
-
FILE_SUFFIX_PATTERN
-
LOGGER
-
-
Constructor Details
-
PrefabBufferUtil
public PrefabBufferUtil()
-
-
Method Details
-
getCached
Gets a PrefabBuffer accessor from the cache, loading from disk if necessary.- Parameters:
path- The path of the prefab to load.- Returns:
- The PrefabBuffer accessor.
-
removeCached
Remove the cache entry for the given prefab path.- Parameters:
path-
-
loadBuffer
Loads a PrefabBuffer from disk bypassing PrefabBufferUtil's cache.- Parameters:
path- The path of the prefab to load.- Returns:
- The loaded PrefabBuffer.
-
writeToFileAsync
@Nonnull public static CompletableFuture<Void> writeToFileAsync(@Nonnull PrefabBuffer prefab, @Nonnull Path path) -
readFromFile
-
readFromFileAsync
-
loadFromLPF
-
loadFromJson
@Nonnull public static PrefabBuffer loadFromJson(@Nullable AssetPack pack, Path path, @Nonnull Path cachedLpfPath, @Nonnull Path jsonPath) throws IOException - Throws:
IOException
-